From 6de7fd1feec480ba6af5eaa3a412255a8c8dd3d9 Mon Sep 17 00:00:00 2001 From: tiif Date: Wed, 26 Feb 2025 12:47:41 +0800 Subject: [PATCH 01/26] Resolve more FIXMEs --- src/tools/miri/tests/pass-dep/libc/libc-pipe.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/tools/miri/tests/pass-dep/libc/libc-pipe.rs b/src/tools/miri/tests/pass-dep/libc/libc-pipe.rs index 01433edf9a3c0..d6072c2569e92 100644 --- a/src/tools/miri/tests/pass-dep/libc/libc-pipe.rs +++ b/src/tools/miri/tests/pass-dep/libc/libc-pipe.rs @@ -56,8 +56,7 @@ fn test_pipe_threaded() { assert_eq!(res, 5); assert_eq!(buf, "abcde".as_bytes()); }); - // FIXME: we should yield here once blocking is implemented. - //thread::yield_now(); + thread::yield_now(); let data = "abcde".as_bytes().as_ptr(); let res = unsafe { libc::write(fds[1], data as *const libc::c_void, 5) }; assert_eq!(res, 5); @@ -65,14 +64,11 @@ fn test_pipe_threaded() { // Read and write from different direction let thread2 = thread::spawn(move || { - // FIXME: we should yield here once blocking is implemented. - //thread::yield_now(); + thread::yield_now(); let data = "12345".as_bytes().as_ptr(); let res = unsafe { libc::write(fds[1], data as *const libc::c_void, 5) }; assert_eq!(res, 5); }); - // FIXME: we should not yield here once blocking is implemented. - thread::yield_now(); let mut buf: [u8; 5] = [0; 5]; let res = unsafe { libc::read(fds[0], buf.as_mut_ptr().cast(), buf.len() as libc::size_t) }; assert_eq!(res, 5); From 292256e9c3fb02a99e17c41dab62b8dc5207b527 Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Wed, 26 Feb 2025 04:59:11 +0000 Subject: [PATCH 02/26] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index b3e207f53b8b7..9ab3d5a6e7f5c 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -f5729cfed3c45e061e8a443677fc1d5ef9277df7 +cb06d12710575a0d7ff71d6fe108f3bcff4f9195 From 530b35b805bbe7f7541ee4ec62b91978a1d2580f Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Wed, 26 Feb 2025 05:07:23 +0000 Subject: [PATCH 03/26] fmt --- src/tools/miri/tests/pass/float.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tools/miri/tests/pass/float.rs b/src/tools/miri/tests/pass/float.rs index b3b6fe1a5d733..05ac5e82b564e 100644 --- a/src/tools/miri/tests/pass/float.rs +++ b/src/tools/miri/tests/pass/float.rs @@ -1281,7 +1281,6 @@ fn test_non_determinism() { /// Ensure that the operation is non-deterministic #[track_caller] fn ensure_nondet(f: impl Fn() -> T) { - let rounds = 16; let first = f(); for _ in 1..rounds { From 410b09f28843fcdeaa39b6b918f2d657c1700eea Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 26 Feb 2025 10:29:05 +0000 Subject: [PATCH 04/26] Update ui test --- src/tools/miri/Cargo.lock | 4 ++-- src/tools/miri/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/miri/Cargo.lock b/src/tools/miri/Cargo.lock index 57a757f9085ca..b8100d0e7ad99 100644 --- a/src/tools/miri/Cargo.lock +++ b/src/tools/miri/Cargo.lock @@ -1079,9 +1079,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ui_test" -version = "0.28.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7484683d60d50ca1d1b6433c3dbf6c5ad71d20387acdcfb16fe79573f3fba576" +checksum = "14bf63f2931a28a04af0bd24c5f850223d29f3a40afae49ed6ce442a65eb8652" dependencies = [ "annotate-snippets", "anyhow", diff --git a/src/tools/miri/Cargo.toml b/src/tools/miri/Cargo.toml index 728a7552fd8cf..5d8c9a8664456 100644 --- a/src/tools/miri/Cargo.toml +++ b/src/tools/miri/Cargo.toml @@ -47,7 +47,7 @@ windows-sys = { version = "0.52", features = [ ] } [dev-dependencies] -ui_test = "0.28.0" +ui_test = "0.29.1" colored = "2" rustc_version = "0.4" regex = "1.5.5" From ac2ddc14af00f2b37e0ba499b35ef31e681aa2ff Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 27 Feb 2025 14:18:38 +0100 Subject: [PATCH 05/26] before_terminator: add some minor clarifying comments --- src/tools/miri/src/machine.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/miri/src/machine.rs b/src/tools/miri/src/machine.rs index 4ece8f7895dee..45764b70dfb6f 100644 --- a/src/tools/miri/src/machine.rs +++ b/src/tools/miri/src/machine.rs @@ -1532,7 +1532,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> { fn before_terminator(ecx: &mut InterpCx<'tcx, Self>) -> InterpResult<'tcx> { ecx.machine.basic_block_count += 1u64; // a u64 that is only incremented by 1 will "never" overflow ecx.machine.since_gc += 1; - // Possibly report our progress. + // Possibly report our progress. This will point at the terminator we are about to execute. if let Some(report_progress) = ecx.machine.report_progress { if ecx.machine.basic_block_count % u64::from(report_progress) == 0 { ecx.emit_diagnostic(NonHaltingDiagnostic::ProgressReport { @@ -1551,6 +1551,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> { } // These are our preemption points. + // (This will only take effect after the terminator has been executed.) ecx.maybe_preempt_active_thread(); // Make sure some time passes. From 33b78f2be1b71b282c952775e98265d177406701 Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Sun, 2 Mar 2025 05:03:55 +0000 Subject: [PATCH 06/26] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index 9ab3d5a6e7f5c..92f8fa089b0d3 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -cb06d12710575a0d7ff71d6fe108f3bcff4f9195 +1c3b035542775e9a5decc93167d351b062942d32 From c40d30eb6ee63b32927cbed250c076e5e53db1b5 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 2 Mar 2025 10:01:38 +0100 Subject: [PATCH 07/26] clippy --- src/tools/miri/cargo-miri/src/phases.rs | 2 +- src/tools/miri/src/eval.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tools/miri/cargo-miri/src/phases.rs b/src/tools/miri/cargo-miri/src/phases.rs index d7b4421061c6b..71ea07f34636a 100644 --- a/src/tools/miri/cargo-miri/src/phases.rs +++ b/src/tools/miri/cargo-miri/src/phases.rs @@ -467,7 +467,7 @@ pub fn phase_rustc(mut args: impl Iterator, phase: RustcPhase) { if let Some(i) = val.iter().position(|&s| s == "link") { emit_link_hack = true; val.remove(i); - if !val.iter().any(|&s| s == "metadata") { + if !val.contains(&"metadata") { val.push("metadata"); } } diff --git a/src/tools/miri/src/eval.rs b/src/tools/miri/src/eval.rs index 36b15dbf623da..ed13f670a90e3 100644 --- a/src/tools/miri/src/eval.rs +++ b/src/tools/miri/src/eval.rs @@ -434,7 +434,6 @@ pub fn create_ecx<'tcx>( /// Evaluates the entry function specified by `entry_id`. /// Returns `Some(return_code)` if program execution completed. /// Returns `None` if an evaluation error occurred. -#[expect(clippy::needless_lifetimes)] pub fn eval_entry<'tcx>( tcx: TyCtxt<'tcx>, entry_id: DefId, From f6fc17a4c8ccc88096785dfb50e553003e99f147 Mon Sep 17 00:00:00 2001 From: Jake Goulding Date: Mon, 3 Mar 2025 13:16:14 -0500 Subject: [PATCH 08/26] Add an anchor to directly link to the -Zmiri-tree-borrows docs --- src/tools/miri/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/miri/README.md b/src/tools/miri/README.md index 4ae901be9b43b..d64de4b1976d3 100644 --- a/src/tools/miri/README.md +++ b/src/tools/miri/README.md @@ -432,7 +432,8 @@ to Miri failing to detect cases of undefined behavior in a program. * `-Zmiri-track-weak-memory-loads` shows a backtrace when weak memory emulation returns an outdated value from a load. This can help diagnose problems that disappear under `-Zmiri-disable-weak-memory-emulation`. -* `-Zmiri-tree-borrows` replaces [Stacked Borrows] with the [Tree Borrows] rules. +* + `-Zmiri-tree-borrows` replaces [Stacked Borrows] with the [Tree Borrows] rules. Tree Borrows is even more experimental than Stacked Borrows. While Tree Borrows is still sound in the sense of catching all aliasing violations that current versions of the compiler might exploit, it is likely that the eventual final aliasing model From 2ff10504401ba4619e2416c4afa0a6789c3aaff3 Mon Sep 17 00:00:00 2001 From: Thalia Archibald Date: Tue, 4 Mar 2025 20:28:38 -0800 Subject: [PATCH 09/26] Use size_of from the prelude instead of imported It was added to all preludes in Rust 1.80. --- src/tools/miri/bench-cargo-miri/mse/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/bench-cargo-miri/mse/src/main.rs b/src/tools/miri/bench-cargo-miri/mse/src/main.rs index e16ccd2c0d735..06d5487d1d4ea 100644 --- a/src/tools/miri/bench-cargo-miri/mse/src/main.rs +++ b/src/tools/miri/bench-cargo-miri/mse/src/main.rs @@ -10,7 +10,7 @@ fn main() { } fn read_i16(buffer: &[u8], index: usize) -> i16 { - const SIZE: usize = std::mem::size_of::(); + const SIZE: usize = size_of::(); let mut bytes: [u8; SIZE] = [0u8; SIZE]; bytes.copy_from_slice(&buffer[(index * SIZE)..(index * SIZE + SIZE)]); unsafe { std::mem::transmute(bytes) } From 95a65704d9ed8fb175eeb1143c675e4f96e2bd40 Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Thu, 6 Mar 2025 05:05:15 +0000 Subject: [PATCH 10/26] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index 92f8fa089b0d3..f6fd106fa5236 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -1c3b035542775e9a5decc93167d351b062942d32 +30f168ef811aec63124eac677e14699baa9395bd From 726c8d4c57f31a4ff6e37d73224fc37bdd2830b9 Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Tue, 4 Mar 2025 20:21:37 -0500 Subject: [PATCH 11/26] Fix tier 2 sysroots job --- src/tools/miri/.github/workflows/sysroots.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/miri/.github/workflows/sysroots.yml b/src/tools/miri/.github/workflows/sysroots.yml index 6a4f44ddd507a..11bcaec9255b6 100644 --- a/src/tools/miri/.github/workflows/sysroots.yml +++ b/src/tools/miri/.github/workflows/sysroots.yml @@ -16,6 +16,7 @@ jobs: - uses: actions/checkout@v4 - name: Build the sysroots run: | + rustup toolchain install nightly cargo install -f rustup-toolchain-install-master ./miri toolchain -c rust-docs # Docs are the only place targets are separated by tier ./miri install From b709bdeb94c9fcc9a68123a83a46d16907b2a5c0 Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Thu, 6 Mar 2025 19:34:57 -0500 Subject: [PATCH 12/26] Update documentation about nextest --- src/tools/miri/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tools/miri/README.md b/src/tools/miri/README.md index d64de4b1976d3..201aa1f538695 100644 --- a/src/tools/miri/README.md +++ b/src/tools/miri/README.md @@ -237,8 +237,7 @@ inherent interpreter slowdown and a loss of parallelism. You can get your test suite's parallelism back by running `cargo miri nextest run -jN` (note that you will need [`cargo-nextest`](https://nexte.st) installed). This works because `cargo-nextest` collects a list of all tests then launches a -separate `cargo miri run` for each test. You will need to specify a `-j` or `--test-threads`; -by default `cargo miri nextest run` runs one test at a time. For more details, see the +separate `cargo miri run` for each test. For more information about nextest, see the [`cargo-nextest` Miri documentation](https://nexte.st/book/miri.html). Note: This one-test-per-process model means that `cargo miri test` is able to detect data From 7e3daf4edae9d4586478d0dda1930698aaec86e3 Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Fri, 7 Mar 2025 05:16:53 +0000 Subject: [PATCH 13/26] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index f6fd106fa5236..f403fba2f9da5 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -30f168ef811aec63124eac677e14699baa9395bd +98a48781feb1220c0cf2feea23f9ef92cdfa7437 From 5cf0c95552a8400046cfe00afd0d6e8c3970fa10 Mon Sep 17 00:00:00 2001 From: Stypox Date: Fri, 7 Mar 2025 10:20:13 +0100 Subject: [PATCH 14/26] Show interpreter backtrace error on Ctrl+C See https://github.com/rust-lang/rust/pull/111769 --- src/tools/miri/src/concurrency/thread.rs | 2 +- src/tools/miri/src/diagnostics.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tools/miri/src/concurrency/thread.rs b/src/tools/miri/src/concurrency/thread.rs index a8a2491304dd1..94629964ea604 100644 --- a/src/tools/miri/src/concurrency/thread.rs +++ b/src/tools/miri/src/concurrency/thread.rs @@ -1150,7 +1150,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { loop { if CTRL_C_RECEIVED.load(Relaxed) { this.machine.handle_abnormal_termination(); - std::process::exit(1); + throw_machine_stop!(TerminationInfo::Interrupted); } match this.machine.threads.schedule(&this.machine.clock)? { SchedulingAction::ExecuteStep => { diff --git a/src/tools/miri/src/diagnostics.rs b/src/tools/miri/src/diagnostics.rs index 1a12d4139c719..014b1299f2dd0 100644 --- a/src/tools/miri/src/diagnostics.rs +++ b/src/tools/miri/src/diagnostics.rs @@ -16,6 +16,8 @@ pub enum TerminationInfo { leak_check: bool, }, Abort(String), + /// Miri was interrupted by a Ctrl+C from the user + Interrupted, UnsupportedInIsolation(String), StackedBorrowsUb { msg: String, @@ -63,6 +65,7 @@ impl fmt::Display for TerminationInfo { match self { Exit { code, .. } => write!(f, "the evaluated program completed with exit code {code}"), Abort(msg) => write!(f, "{msg}"), + Interrupted => write!(f, "interpretation was interrupted"), UnsupportedInIsolation(msg) => write!(f, "{msg}"), Int2PtrWithStrictProvenance => write!( @@ -226,6 +229,7 @@ pub fn report_error<'tcx>( let title = match info { &Exit { code, leak_check } => return Some((code, leak_check)), Abort(_) => Some("abnormal termination"), + Interrupted => None, UnsupportedInIsolation(_) | Int2PtrWithStrictProvenance | UnsupportedForeignItem(_) => Some("unsupported operation"), StackedBorrowsUb { .. } | TreeBorrowsUb { .. } | DataRace { .. } => From 5889b95f4e04716058da56a5162b4f62338cd922 Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Tue, 11 Mar 2025 05:14:57 +0000 Subject: [PATCH 15/26] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index f403fba2f9da5..8b14b51496a8e 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -98a48781feb1220c0cf2feea23f9ef92cdfa7437 +90384941aae4ea38de00e4702b50757e9b882a19 From 0346e926a805a338754a192714cd7f11b29ba816 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 12 Mar 2025 18:39:06 +0100 Subject: [PATCH 16/26] alloc_addresses: use MemoryKind instead of tcx query to determine global allocations --- src/tools/miri/src/alloc_addresses/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tools/miri/src/alloc_addresses/mod.rs b/src/tools/miri/src/alloc_addresses/mod.rs index ff3a25e94bd5d..26d71dca36066 100644 --- a/src/tools/miri/src/alloc_addresses/mod.rs +++ b/src/tools/miri/src/alloc_addresses/mod.rs @@ -170,20 +170,22 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { // This ensures the interpreted program and native code have the same view of memory. let base_ptr = match info.kind { AllocKind::LiveData => { - if this.tcx.try_get_global_alloc(alloc_id).is_some() { + if memory_kind == MiriMemoryKind::Global.into() { // For new global allocations, we always pre-allocate the memory to be able use the machine address directly. let prepared_bytes = MiriAllocBytes::zeroed(info.size, info.align) .unwrap_or_else(|| { panic!("Miri ran out of memory: cannot create allocation of {size:?} bytes", size = info.size) }); let ptr = prepared_bytes.as_ptr(); - // Store prepared allocation space to be picked up for use later. + // Store prepared allocation to be picked up for use later. global_state .prepared_alloc_bytes .try_insert(alloc_id, prepared_bytes) .unwrap(); ptr } else { + // Non-global allocations are already in memory at this point so + // we can just get a pointer to where their data is stored. this.get_alloc_bytes_unchecked_raw(alloc_id)? } } @@ -382,6 +384,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { align: Align, ) -> InterpResult<'tcx, MiriAllocBytes> { let this = self.eval_context_ref(); + assert!(this.tcx.try_get_global_alloc(id).is_some()); if this.machine.native_lib.is_some() { // In native lib mode, MiriAllocBytes for global allocations are handled via `prepared_alloc_bytes`. // This additional call ensures that some `MiriAllocBytes` are always prepared, just in case From 82dfa03a71c4be11633bcc35fba7b4898c10d9a3 Mon Sep 17 00:00:00 2001 From: geetanshjuneja Date: Wed, 12 Mar 2025 23:14:14 +0530 Subject: [PATCH 17/26] added check_shim_abi added input arg mismatch test added detailed ub messages added return type mismatch test --- src/tools/miri/src/helpers.rs | 81 +++++++++++++++++-- .../miri/src/shims/unix/foreign_items.rs | 11 ++- .../tests/fail/shims/input_arg_mismatch.rs | 21 +++++ .../fail/shims/input_arg_mismatch.stderr | 17 ++++ .../tests/fail/shims/return_type_mismatch.rs | 21 +++++ .../fail/shims/return_type_mismatch.stderr | 17 ++++ 6 files changed, 161 insertions(+), 7 deletions(-) create mode 100644 src/tools/miri/tests/fail/shims/input_arg_mismatch.rs create mode 100644 src/tools/miri/tests/fail/shims/input_arg_mismatch.stderr create mode 100644 src/tools/miri/tests/fail/shims/return_type_mismatch.rs create mode 100644 src/tools/miri/tests/fail/shims/return_type_mismatch.stderr diff --git a/src/tools/miri/src/helpers.rs b/src/tools/miri/src/helpers.rs index 12e7d0f1a62cf..d1429a0be1d0f 100644 --- a/src/tools/miri/src/helpers.rs +++ b/src/tools/miri/src/helpers.rs @@ -14,7 +14,7 @@ use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc_middle::middle::dependency_format::Linkage; use rustc_middle::middle::exported_symbols::ExportedSymbol; use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, MaybeResult, TyAndLayout}; -use rustc_middle::ty::{self, FloatTy, IntTy, Ty, TyCtxt, UintTy}; +use rustc_middle::ty::{self, Binder, FloatTy, FnSig, IntTy, Ty, TyCtxt, UintTy}; use rustc_session::config::CrateType; use rustc_span::{Span, Symbol}; use rustc_target::callconv::{Conv, FnAbi}; @@ -994,10 +994,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { exp_abi: Conv, link_name: Symbol, args: &'a [OpTy<'tcx>], - ) -> InterpResult<'tcx, &'a [OpTy<'tcx>; N]> - where - &'a [OpTy<'tcx>; N]: TryFrom<&'a [OpTy<'tcx>]>, - { + ) -> InterpResult<'tcx, &'a [OpTy<'tcx>; N]> { self.check_abi_and_shim_symbol_clash(abi, exp_abi, link_name)?; if abi.c_variadic { @@ -1015,6 +1012,80 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { ) } + /// Check that the given `caller_fn_abi` matches the expected ABI described by + /// `callee_abi`, `callee_input_tys`, `callee_output_ty`, and the return the list of + /// arguments. + fn check_shim_abi<'a, const N: usize>( + &mut self, + link_name: Symbol, + caller_fn_abi: &FnAbi<'tcx, Ty<'tcx>>, + callee_abi: ExternAbi, + callee_input_tys: [Ty<'tcx>; N], + callee_output_ty: Ty<'tcx>, + caller_args: &'a [OpTy<'tcx>], + ) -> InterpResult<'tcx, &'a [OpTy<'tcx>; N]> { + let this = self.eval_context_mut(); + let mut inputs_and_output = callee_input_tys.to_vec(); + inputs_and_output.push(callee_output_ty); + let fn_sig_binder = Binder::dummy(FnSig { + inputs_and_output: this.machine.tcx.mk_type_list(&inputs_and_output), + c_variadic: false, + // This does not matter for the ABI. + safety: Safety::Safe, + abi: callee_abi, + }); + let callee_fn_abi = this.fn_abi_of_fn_ptr(fn_sig_binder, Default::default())?; + + this.check_abi_and_shim_symbol_clash(caller_fn_abi, callee_fn_abi.conv, link_name)?; + + if caller_fn_abi.c_variadic { + throw_ub_format!( + "ABI mismatch: calling a non-variadic function with a variadic caller-side signature" + ); + } + + if callee_fn_abi.fixed_count != caller_fn_abi.fixed_count { + throw_ub_format!( + "ABI mismatch: expected {} arguments, found {} arguments ", + callee_fn_abi.fixed_count, + caller_fn_abi.fixed_count + ); + } + + if callee_fn_abi.can_unwind && !caller_fn_abi.can_unwind { + throw_ub_format!( + "ABI mismatch: callee may unwind, but caller-side signature prohibits unwinding", + ); + } + + if !this.check_argument_compat(&caller_fn_abi.ret, &callee_fn_abi.ret)? { + throw_ub!(AbiMismatchReturn { + caller_ty: caller_fn_abi.ret.layout.ty, + callee_ty: callee_fn_abi.ret.layout.ty + }); + } + + if let Some(index) = caller_fn_abi + .args + .iter() + .zip(callee_fn_abi.args.iter()) + .map(|(caller_arg, callee_arg)| this.check_argument_compat(caller_arg, callee_arg)) + .collect::>>()? + .into_iter() + .position(|b| !b) + { + throw_ub!(AbiMismatchArgument { + caller_ty: caller_fn_abi.args[index].layout.ty, + callee_ty: callee_fn_abi.args[index].layout.ty + }); + } + + if let Ok(ops) = caller_args.try_into() { + return interp_ok(ops); + } + unreachable!() + } + /// Check shim for variadic function. /// Returns a tuple that consisting of an array of fixed args, and a slice of varargs. fn check_shim_variadic<'a, const N: usize>( diff --git a/src/tools/miri/src/shims/unix/foreign_items.rs b/src/tools/miri/src/shims/unix/foreign_items.rs index 09757071075ad..1770b99c0a22b 100644 --- a/src/tools/miri/src/shims/unix/foreign_items.rs +++ b/src/tools/miri/src/shims/unix/foreign_items.rs @@ -1,7 +1,7 @@ use std::ffi::OsStr; use std::str; -use rustc_abi::Size; +use rustc_abi::{ExternAbi, Size}; use rustc_middle::ty::Ty; use rustc_middle::ty::layout::LayoutOf; use rustc_span::Symbol; @@ -200,7 +200,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { this.write(fd, buf, count, Some(offset), dest)?; } "close" => { - let [fd] = this.check_shim(abi, Conv::C, link_name, args)?; + let [fd] = this.check_shim_abi( + link_name, + abi, + ExternAbi::C { unwind: false }, + [this.tcx.types.i32], + this.tcx.types.i32, + args, + )?; let result = this.close(fd)?; this.write_scalar(result, dest)?; } diff --git a/src/tools/miri/tests/fail/shims/input_arg_mismatch.rs b/src/tools/miri/tests/fail/shims/input_arg_mismatch.rs new file mode 100644 index 0000000000000..eb8de04dcc41b --- /dev/null +++ b/src/tools/miri/tests/fail/shims/input_arg_mismatch.rs @@ -0,0 +1,21 @@ +//@ignore-target: windows # File handling is not implemented yet +//@compile-flags: -Zmiri-disable-isolation +use std::ffi::{CString, OsStr, c_char, c_int}; +use std::os::unix::ffi::OsStrExt; + +extern "C" { + fn open(path: *const c_char, oflag: c_int, ...) -> c_int; + // correct fd type is i32 + fn close(fd: u32) -> c_int; +} + +fn main() { + let c_path = CString::new(OsStr::new("./text").as_bytes()).expect("CString::new failed"); + let fd = unsafe { + open(c_path.as_ptr(), /* value does not matter */ 0) + } as u32; + let _ = unsafe { + close(fd); + //~^ ERROR: calling a function with argument of type i32 passing data of type u32 + }; +} diff --git a/src/tools/miri/tests/fail/shims/input_arg_mismatch.stderr b/src/tools/miri/tests/fail/shims/input_arg_mismatch.stderr new file mode 100644 index 0000000000000..90d4ce78ad4eb --- /dev/null +++ b/src/tools/miri/tests/fail/shims/input_arg_mismatch.stderr @@ -0,0 +1,17 @@ +error: Undefined Behavior: calling a function with argument of type i32 passing data of type u32 + --> tests/fail/shims/input_arg_mismatch.rs:LL:CC + | +LL | close(fd); + | ^^^^^^^^^ calling a function with argument of type i32 passing data of type u32 + | + = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior + = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets + = help: if you think this code should be accepted anyway, please report an issue with Miri + = note: BACKTRACE: + = note: inside `main` at tests/fail/shims/input_arg_mismatch.rs:LL:CC + +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace + +error: aborting due to 1 previous error + diff --git a/src/tools/miri/tests/fail/shims/return_type_mismatch.rs b/src/tools/miri/tests/fail/shims/return_type_mismatch.rs new file mode 100644 index 0000000000000..6dbdd3f539b38 --- /dev/null +++ b/src/tools/miri/tests/fail/shims/return_type_mismatch.rs @@ -0,0 +1,21 @@ +//@ignore-target: windows # File handling is not implemented yet +//@compile-flags: -Zmiri-disable-isolation +use std::ffi::{CString, OsStr, c_char, c_int, c_short}; +use std::os::unix::ffi::OsStrExt; + +extern "C" { + fn open(path: *const c_char, oflag: c_int, ...) -> c_int; + // correct return type is i32 + fn close(fd: c_int) -> c_short; +} + +fn main() { + let c_path = CString::new(OsStr::new("./text").as_bytes()).expect("CString::new failed"); + let fd = unsafe { + open(c_path.as_ptr(), /* value does not matter */ 0) + }; + let _ = unsafe { + close(fd); + //~^ ERROR: calling a function with return type i32 passing return place of type i16 + }; +} diff --git a/src/tools/miri/tests/fail/shims/return_type_mismatch.stderr b/src/tools/miri/tests/fail/shims/return_type_mismatch.stderr new file mode 100644 index 0000000000000..062aa7b49275f --- /dev/null +++ b/src/tools/miri/tests/fail/shims/return_type_mismatch.stderr @@ -0,0 +1,17 @@ +error: Undefined Behavior: calling a function with return type i32 passing return place of type i16 + --> tests/fail/shims/return_type_mismatch.rs:LL:CC + | +LL | close(fd); + | ^^^^^^^^^ calling a function with return type i32 passing return place of type i16 + | + = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior + = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets + = help: if you think this code should be accepted anyway, please report an issue with Miri + = note: BACKTRACE: + = note: inside `main` at tests/fail/shims/return_type_mismatch.rs:LL:CC + +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace + +error: aborting due to 1 previous error + From 18299e4491cac4c21f4f989cf4028022dbcf1002 Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Fri, 14 Mar 2025 04:55:48 +0000 Subject: [PATCH 18/26] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index 8b14b51496a8e..2e649e688fa2f 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -90384941aae4ea38de00e4702b50757e9b882a19 +addae0705c7cf5b2f2ed7faeec026c894f497b3d From ebc55522cbe8ce0fb2fd1b2fd5e24b13382b3e89 Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Sat, 15 Mar 2025 05:05:16 +0000 Subject: [PATCH 19/26] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index 2e649e688fa2f..cc3d0cfc717bb 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -addae0705c7cf5b2f2ed7faeec026c894f497b3d +d9e5539a39192028a7b15ae596a8685017faecee From 642634c39b00a4630e461b431cce0fc38a640b66 Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Sun, 16 Mar 2025 05:05:14 +0000 Subject: [PATCH 20/26] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index cc3d0cfc717bb..94b593e0e3264 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -d9e5539a39192028a7b15ae596a8685017faecee +9f274ba3997030a2b7656755a6810fd26cb709f3 From c2c50c62e952a1ef4f8882bdbbe503e86b1a1f69 Mon Sep 17 00:00:00 2001 From: The Miri Cronjob Bot Date: Thu, 20 Mar 2025 05:03:55 +0000 Subject: [PATCH 21/26] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index 94b593e0e3264..db300f1475d44 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -9f274ba3997030a2b7656755a6810fd26cb709f3 +70237a8cb905fc48ed6148d2f2dba756535a5940 From 38e7bb0fb1c53d4ddf7b333eb242839e4d226e28 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 21 Mar 2025 10:30:18 +0100 Subject: [PATCH 22/26] catch_unwind: do not permit catch function to unwind --- src/tools/miri/src/shims/panic.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/miri/src/shims/panic.rs b/src/tools/miri/src/shims/panic.rs index fc58d88591f81..18af82148763a 100644 --- a/src/tools/miri/src/shims/panic.rs +++ b/src/tools/miri/src/shims/panic.rs @@ -144,7 +144,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { // Directly return to caller of `try`. StackPopCleanup::Goto { ret: catch_unwind.ret, - unwind: mir::UnwindAction::Continue, + // `catch_fn` must not unwind. + unwind: mir::UnwindAction::Unreachable, }, )?; From 29f022ce3c3ae31cc3a7542f17156efb3dbea308 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 21 Mar 2025 14:56:20 +0100 Subject: [PATCH 23/26] Preparing for merge from rustc --- src/tools/miri/rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index db300f1475d44..cf36b6fd03854 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -70237a8cb905fc48ed6148d2f2dba756535a5940 +4ac032f857b46037b55c1fc0fa702450aad37f43 From c845ff0d7111ec31a44648a085a3fa3fc0fa7143 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 27 Mar 2025 15:05:37 +0100 Subject: [PATCH 24/26] run a few more concurrency tests on aarch64-linux-android --- src/tools/miri/ci/ci.sh | 2 +- src/tools/miri/tests/pass-dep/concurrency/linux-futex.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tools/miri/ci/ci.sh b/src/tools/miri/ci/ci.sh index 3327ad17c44ef..7155d692ee5c9 100755 --- a/src/tools/miri/ci/ci.sh +++ b/src/tools/miri/ci/ci.sh @@ -166,7 +166,7 @@ case $HOST_TARGET in 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 TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC $UNIX time hashmap random threadname pthread fs libc-pipe TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX time hashmap random threadname pthread fs libc-pipe - TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX time hashmap random sync threadname pthread epoll eventfd + TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX time hashmap random sync concurrency thread epoll eventfd TEST_TARGET=wasm32-wasip2 run_tests_minimal $BASIC wasm TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std TEST_TARGET=thumbv7em-none-eabihf run_tests_minimal no_std diff --git a/src/tools/miri/tests/pass-dep/concurrency/linux-futex.rs b/src/tools/miri/tests/pass-dep/concurrency/linux-futex.rs index 0ca13b5039dde..f8f1c554f0d71 100644 --- a/src/tools/miri/tests/pass-dep/concurrency/linux-futex.rs +++ b/src/tools/miri/tests/pass-dep/concurrency/linux-futex.rs @@ -64,7 +64,7 @@ fn wait_wrong_val() { ), -1, ); - assert_eq!(*libc::__errno_location(), libc::EAGAIN); + assert_eq!(io::Error::last_os_error().raw_os_error().unwrap(), libc::EAGAIN); } } @@ -85,7 +85,7 @@ fn wait_timeout() { ), -1, ); - assert_eq!(*libc::__errno_location(), libc::ETIMEDOUT); + assert_eq!(io::Error::last_os_error().raw_os_error().unwrap(), libc::ETIMEDOUT); } assert!((200..1000).contains(&start.elapsed().as_millis())); @@ -124,7 +124,7 @@ fn wait_absolute_timeout() { ), -1, ); - assert_eq!(*libc::__errno_location(), libc::ETIMEDOUT); + assert_eq!(io::Error::last_os_error().raw_os_error().unwrap(), libc::ETIMEDOUT); } assert!((200..1000).contains(&start.elapsed().as_millis())); From 024c8c306318d8dfd6a8d63f7df1b22423fa1398 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 28 Mar 2025 12:07:33 +0100 Subject: [PATCH 25/26] cache mangle_internal_symbol results --- src/tools/miri/src/helpers.rs | 13 ++++++ src/tools/miri/src/machine.rs | 5 +++ src/tools/miri/src/shims/foreign_items.rs | 55 +++++++++-------------- 3 files changed, 40 insertions(+), 33 deletions(-) diff --git a/src/tools/miri/src/helpers.rs b/src/tools/miri/src/helpers.rs index d1429a0be1d0f..29ed94a2e4a29 100644 --- a/src/tools/miri/src/helpers.rs +++ b/src/tools/miri/src/helpers.rs @@ -17,6 +17,7 @@ use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, MaybeResult, TyAndLayout}; use rustc_middle::ty::{self, Binder, FloatTy, FnSig, IntTy, Ty, TyCtxt, UintTy}; use rustc_session::config::CrateType; use rustc_span::{Span, Symbol}; +use rustc_symbol_mangling::mangle_internal_symbol; use rustc_target::callconv::{Conv, FnAbi}; use crate::*; @@ -1258,6 +1259,18 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { interp_ok(array) } + + fn mangle_internal_symbol<'a>(&'a mut self, name: &'static str) -> &'a str + where + 'tcx: 'a, + { + let this = self.eval_context_mut(); + let tcx = *this.tcx; + this.machine + .mangle_internal_symbol_cache + .entry(name) + .or_insert_with(|| mangle_internal_symbol(tcx, name)) + } } impl<'tcx> MiriMachine<'tcx> { diff --git a/src/tools/miri/src/machine.rs b/src/tools/miri/src/machine.rs index bd901a4ed19eb..fb99bdc51764d 100644 --- a/src/tools/miri/src/machine.rs +++ b/src/tools/miri/src/machine.rs @@ -611,6 +611,9 @@ pub struct MiriMachine<'tcx> { pub(crate) reject_in_isolation_warned: RefCell>, /// Remembers which int2ptr casts we have already warned about. pub(crate) int2ptr_warned: RefCell>, + + /// Cache for `mangle_internal_symbol`. + pub(crate) mangle_internal_symbol_cache: FxHashMap<&'static str, String>, } impl<'tcx> MiriMachine<'tcx> { @@ -757,6 +760,7 @@ impl<'tcx> MiriMachine<'tcx> { native_call_mem_warned: Cell::new(false), reject_in_isolation_warned: Default::default(), int2ptr_warned: Default::default(), + mangle_internal_symbol_cache: Default::default(), } } @@ -930,6 +934,7 @@ impl VisitProvenance for MiriMachine<'_> { native_call_mem_warned: _, reject_in_isolation_warned: _, int2ptr_warned: _, + mangle_internal_symbol_cache: _, } = self; threads.visit_provenance(visit); diff --git a/src/tools/miri/src/shims/foreign_items.rs b/src/tools/miri/src/shims/foreign_items.rs index 03c6081e992c5..52c16a0c2e2dc 100644 --- a/src/tools/miri/src/shims/foreign_items.rs +++ b/src/tools/miri/src/shims/foreign_items.rs @@ -9,10 +9,9 @@ use rustc_hir::def::DefKind; use rustc_hir::def_id::CrateNum; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc_middle::mir::interpret::AllocInit; -use rustc_middle::ty::Ty; +use rustc_middle::ty::{Instance, Ty}; use rustc_middle::{mir, ty}; use rustc_span::Symbol; -use rustc_symbol_mangling::mangle_internal_symbol; use rustc_target::callconv::{Conv, FnAbi}; use self::helpers::{ToHost, ToSoft}; @@ -52,7 +51,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { // Some shims forward to other MIR bodies. match link_name.as_str() { - name if name == mangle_internal_symbol(*this.tcx, "__rust_alloc_error_handler") => { + name if name == this.mangle_internal_symbol("__rust_alloc_error_handler") => { // Forward to the right symbol that implements this function. let Some(handler_kind) = this.tcx.alloc_error_handler_kind(()) else { // in real code, this symbol does not exist without an allocator @@ -60,11 +59,11 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { "`__rust_alloc_error_handler` cannot be called when no alloc error handler is set" ); }; - let name = - mangle_internal_symbol(*this.tcx, alloc_error_handler_name(handler_kind)); - let handler = this - .lookup_exported_symbol(Symbol::intern(&name))? - .expect("missing alloc error handler symbol"); + let name = Symbol::intern( + this.mangle_internal_symbol(alloc_error_handler_name(handler_kind)), + ); + let handler = + this.lookup_exported_symbol(name)?.expect("missing alloc error handler symbol"); return interp_ok(Some(handler)); } _ => {} @@ -138,30 +137,22 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { // Find it if it was not cached. let mut instance_and_crate: Option<(ty::Instance<'_>, CrateNum)> = None; helpers::iter_exported_symbols(tcx, |cnum, def_id| { + let attrs = tcx.codegen_fn_attrs(def_id); + // Skip over imports of items. if tcx.is_foreign_item(def_id) { - // Skip over imports of items return interp_ok(()); } - - let attrs = tcx.codegen_fn_attrs(def_id); - // FIXME use tcx.symbol_name(instance) instead - let symbol_name = if let Some(export_name) = attrs.export_name { - export_name - } else if attrs.flags.contains(CodegenFnAttrFlags::NO_MANGLE) - || attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL) + // Skip over items without an explicitly defined symbol name. + if !(attrs.export_name.is_some() + || attrs.flags.contains(CodegenFnAttrFlags::NO_MANGLE) + || attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL)) { - tcx.item_name(def_id) - } else { - // Skip over items without an explicitly defined symbol name. return interp_ok(()); - }; - let symbol_name = - if attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL) { - Symbol::intern(&mangle_internal_symbol(tcx, symbol_name.as_str())) - } else { - symbol_name - }; - if symbol_name == link_name { + } + + let instance = Instance::mono(tcx, def_id); + let symbol_name = tcx.symbol_name(instance).name; + if symbol_name == link_name.as_str() { if let Some((original_instance, original_cnum)) = instance_and_crate { // Make sure we are consistent wrt what is 'first' and 'second'. let original_span = tcx.def_span(original_instance.def_id()).data(); @@ -505,9 +496,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { } // Rust allocation - name if name == mangle_internal_symbol(*this.tcx, "__rust_alloc") - || name == "miri_alloc" => - { + name if name == this.mangle_internal_symbol("__rust_alloc") || name == "miri_alloc" => { let default = |ecx: &mut MiriInterpCx<'tcx>| { // Only call `check_shim` when `#[global_allocator]` isn't used. When that // macro is used, we act like no shim exists, so that the exported function can run. @@ -540,7 +529,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { _ => return this.emulate_allocator(default), } } - name if name == mangle_internal_symbol(*this.tcx, "__rust_alloc_zeroed") => { + name if name == this.mangle_internal_symbol("__rust_alloc_zeroed") => { return this.emulate_allocator(|this| { // See the comment for `__rust_alloc` why `check_shim` is only called in the // default case. @@ -559,7 +548,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { this.write_pointer(ptr, dest) }); } - name if name == mangle_internal_symbol(*this.tcx, "__rust_dealloc") + name if name == this.mangle_internal_symbol("__rust_dealloc") || name == "miri_dealloc" => { let default = |ecx: &mut MiriInterpCx<'tcx>| { @@ -592,7 +581,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> { _ => return this.emulate_allocator(default), } } - name if name == mangle_internal_symbol(*this.tcx, "__rust_realloc") => { + name if name == this.mangle_internal_symbol("__rust_realloc") => { return this.emulate_allocator(|this| { // See the comment for `__rust_alloc` why `check_shim` is only called in the // default case. From 7310925076c797d67d3df026c6b22f9a73380661 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 28 Mar 2025 15:28:14 +0100 Subject: [PATCH 26/26] update lockfile --- Cargo.lock | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 856d293d610e4..90e035e801069 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -547,7 +547,7 @@ dependencies = [ "termize", "tokio", "toml 0.7.8", - "ui_test 0.29.2", + "ui_test", "walkdir", ] @@ -2292,7 +2292,7 @@ dependencies = [ "smallvec", "tempfile", "tikv-jemalloc-sys", - "ui_test 0.28.0", + "ui_test", "windows-sys 0.52.0", ] @@ -5486,32 +5486,6 @@ dependencies = [ "regex-lite", ] -[[package]] -name = "ui_test" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7484683d60d50ca1d1b6433c3dbf6c5ad71d20387acdcfb16fe79573f3fba576" -dependencies = [ - "annotate-snippets 0.11.5", - "anyhow", - "bstr", - "cargo-platform", - "cargo_metadata 0.18.1", - "color-eyre", - "colored", - "comma", - "crossbeam-channel", - "indicatif", - "levenshtein", - "prettydiff", - "regex", - "rustc_version", - "rustfix", - "serde", - "serde_json", - "spanned", -] - [[package]] name = "ui_test" version = "0.29.2"