Skip to content
/ rust Public
forked from rust-lang/rust

Commit 8587c95

Browse files
authored
Rollup merge of rust-lang#139813 - RalfJung:miri-sync, r=RalfJung
Miri subtree update r? `@ghost` Fixes build failures on macOS
2 parents 04d1052 + 758e99a commit 8587c95

File tree

8 files changed

+46
-18
lines changed

8 files changed

+46
-18
lines changed

Diff for: Cargo.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -2038,19 +2038,19 @@ dependencies = [
20382038

20392039
[[package]]
20402040
name = "libffi"
2041-
version = "3.2.0"
2041+
version = "4.0.0"
20422042
source = "registry+https://github.com/rust-lang/crates.io-index"
2043-
checksum = "ce826c243048e3d5cec441799724de52e2d42f820468431fc3fceee2341871e2"
2043+
checksum = "4a9434b6fc77375fb624698d5f8c49d7e80b10d59eb1219afda27d1f824d4074"
20442044
dependencies = [
20452045
"libc",
20462046
"libffi-sys",
20472047
]
20482048

20492049
[[package]]
20502050
name = "libffi-sys"
2051-
version = "2.3.0"
2051+
version = "3.2.0"
20522052
source = "registry+https://github.com/rust-lang/crates.io-index"
2053-
checksum = "f36115160c57e8529781b4183c2bb51fdc1f6d6d1ed345591d84be7703befb3c"
2053+
checksum = "ead36a2496acfc8edd6cc32352110e9478ac5b9b5f5b9856ebd3d28019addb84"
20542054
dependencies = [
20552055
"cc",
20562056
]

Diff for: src/tools/miri/Cargo.lock

+6-6
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ dependencies = [
257257

258258
[[package]]
259259
name = "crossbeam-channel"
260-
version = "0.5.14"
260+
version = "0.5.15"
261261
source = "registry+https://github.com/rust-lang/crates.io-index"
262-
checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471"
262+
checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2"
263263
dependencies = [
264264
"crossbeam-utils",
265265
]
@@ -436,19 +436,19 @@ checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6"
436436

437437
[[package]]
438438
name = "libffi"
439-
version = "3.2.0"
439+
version = "4.0.0"
440440
source = "registry+https://github.com/rust-lang/crates.io-index"
441-
checksum = "ce826c243048e3d5cec441799724de52e2d42f820468431fc3fceee2341871e2"
441+
checksum = "4a9434b6fc77375fb624698d5f8c49d7e80b10d59eb1219afda27d1f824d4074"
442442
dependencies = [
443443
"libc",
444444
"libffi-sys",
445445
]
446446

447447
[[package]]
448448
name = "libffi-sys"
449-
version = "2.3.0"
449+
version = "3.2.0"
450450
source = "registry+https://github.com/rust-lang/crates.io-index"
451-
checksum = "f36115160c57e8529781b4183c2bb51fdc1f6d6d1ed345591d84be7703befb3c"
451+
checksum = "ead36a2496acfc8edd6cc32352110e9478ac5b9b5f5b9856ebd3d28019addb84"
452452
dependencies = [
453453
"cc",
454454
]

Diff for: src/tools/miri/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ features = ['unprefixed_malloc_on_supported_platforms']
3737

3838
[target.'cfg(unix)'.dependencies]
3939
libc = "0.2"
40-
libffi = "3.2.0"
40+
libffi = "4.0.0"
4141
libloading = "0.8"
4242

4343
[target.'cfg(target_family = "windows")'.dependencies]

Diff for: src/tools/miri/ci/ci.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ case $HOST_TARGET in
164164
# Partially supported targets (tier 2)
165165
BASIC="empty_main integer heap_alloc libc-mem vec string btreemap" # ensures we have the basics: pre-main code, system allocator
166166
UNIX="hello panic/panic panic/unwind concurrency/simple atomic libc-mem libc-misc libc-random env num_cpus" # the things that are very similar across all Unixes, and hence easily supported there
167-
TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC $UNIX time hashmap random threadname pthread fs libc-pipe concurrency sync
168-
TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX time hashmap random threadname pthread fs libc-pipe
169-
TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX time hashmap random sync concurrency thread epoll eventfd
167+
TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC $UNIX time hashmap random thread sync concurrency fs libc-pipe
168+
TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX time hashmap random thread sync concurrency fs libc-pipe
169+
TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX time hashmap random thread sync concurrency epoll eventfd
170170
TEST_TARGET=wasm32-wasip2 run_tests_minimal $BASIC wasm
171171
TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std
172172
TEST_TARGET=thumbv7em-none-eabihf run_tests_minimal no_std

Diff for: src/tools/miri/rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7d7de5bf3c3cbf9c2c5bbc5cbfb9197a8a427d35
1+
1bc56185ee257ed829a0aea7abdc3b03c5fed887

Diff for: src/tools/miri/src/shims/windows/foreign_items.rs

+20-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ fn win_get_full_path_name<'tcx>(path: &Path) -> InterpResult<'tcx, io::Result<Pa
6565
}
6666
// Otherwise we try to do something kind of close to what Windows does, but this is probably not
6767
// right in all cases.
68-
let mut result: Vec<&[u8]> = vec![]; // will be a vecot of components, joined by `/`.
68+
let mut result: Vec<&[u8]> = vec![]; // will be a vector of components, joined by `/`.
6969
let mut bytes = bytes; // the remaining bytes to process
7070
let mut stop = false;
7171
while !stop {
@@ -396,6 +396,25 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
396396
let last_error = this.get_last_error()?;
397397
this.write_scalar(last_error, dest)?;
398398
}
399+
"RtlNtStatusToDosError" => {
400+
let [status] = this.check_shim(abi, sys_conv, link_name, args)?;
401+
let status = this.read_scalar(status)?.to_u32()?;
402+
let err = match status {
403+
// STATUS_MEDIA_WRITE_PROTECTED => ERROR_WRITE_PROTECT
404+
0xC00000A2 => 19,
405+
// STATUS_FILE_INVALID => ERROR_FILE_INVALID
406+
0xC0000098 => 1006,
407+
// STATUS_DISK_FULL => ERROR_DISK_FULL
408+
0xC000007F => 112,
409+
// STATUS_IO_DEVICE_ERROR => ERROR_IO_DEVICE
410+
0xC0000185 => 1117,
411+
// STATUS_ACCESS_DENIED => ERROR_ACCESS_DENIED
412+
0xC0000022 => 5,
413+
// Anything without an error code => ERROR_MR_MID_NOT_FOUND
414+
_ => 317,
415+
};
416+
this.write_scalar(Scalar::from_i32(err), dest)?;
417+
}
399418

400419
// Querying system information
401420
"GetSystemInfo" => {

Diff for: src/tools/miri/tests/pass-dep/shims/windows-fs.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ use std::ptr;
1010
mod utils;
1111

1212
use windows_sys::Win32::Foundation::{
13-
CloseHandle, ERROR_ALREADY_EXISTS, GENERIC_READ, GENERIC_WRITE, GetLastError,
13+
CloseHandle, ERROR_ACCESS_DENIED, ERROR_ALREADY_EXISTS, ERROR_IO_DEVICE, GENERIC_READ,
14+
GENERIC_WRITE, GetLastError, RtlNtStatusToDosError, STATUS_ACCESS_DENIED,
15+
STATUS_IO_DEVICE_ERROR,
1416
};
1517
use windows_sys::Win32::Storage::FileSystem::{
1618
BY_HANDLE_FILE_INFORMATION, CREATE_ALWAYS, CREATE_NEW, CreateFileW, FILE_ATTRIBUTE_DIRECTORY,
@@ -26,6 +28,7 @@ fn main() {
2628
test_create_always_twice();
2729
test_open_always_twice();
2830
test_open_dir_reparse();
31+
test_ntstatus_to_dos();
2932
}
3033
}
3134

@@ -191,6 +194,12 @@ unsafe fn test_open_dir_reparse() {
191194
};
192195
}
193196

197+
unsafe fn test_ntstatus_to_dos() {
198+
// We won't test all combinations, just a couple common ones
199+
assert_eq!(RtlNtStatusToDosError(STATUS_IO_DEVICE_ERROR), ERROR_IO_DEVICE);
200+
assert_eq!(RtlNtStatusToDosError(STATUS_ACCESS_DENIED), ERROR_ACCESS_DENIED);
201+
}
202+
194203
fn to_wide_cstr(path: &Path) -> Vec<u16> {
195204
let mut raw_path = path.as_os_str().encode_wide().collect::<Vec<_>>();
196205
raw_path.extend([0, 0]);

Diff for: src/tools/miri/tests/pass/issues/issue-134713-swap_nonoverlapping_untyped.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::mem::{size_of, align_of};
1+
use std::mem::{align_of, size_of};
22

33
// See <https://github.com/rust-lang/rust/issues/134713>
44

0 commit comments

Comments
 (0)