about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/miri/README.md9
-rw-r--r--src/tools/miri/cargo-miri/src/main.rs1
-rw-r--r--src/tools/miri/rust-version2
-rw-r--r--src/tools/miri/src/lib.rs4
-rw-r--r--src/tools/miri/src/shims/unix/android/dlsym.rs2
-rw-r--r--src/tools/miri/src/shims/unix/fs.rs6
-rw-r--r--src/tools/miri/src/stacked_borrows/mod.rs1
-rw-r--r--src/tools/miri/src/stacked_borrows/stack.rs2
-rwxr-xr-xsrc/tools/miri/test-cargo-miri/run-test.py5
-rw-r--r--src/tools/miri/test-cargo-miri/test.filter.cross-target.stdout.ref5
-rw-r--r--src/tools/miri/test-cargo-miri/test.filter.stdout.ref10
-rw-r--r--src/tools/miri/tests/fail/concurrency/windows_join_detached.stderr2
-rw-r--r--src/tools/miri/tests/fail/erroneous_const2.stderr2
-rw-r--r--src/tools/miri/tests/fail/invalid_bool.rs1
-rw-r--r--src/tools/miri/tests/pass/float.rs2
-rw-r--r--src/tools/miri/tests/pass/issues/issue-miri-2433.rs24
-rw-r--r--src/tools/miri/tests/pass/u128.rs1
17 files changed, 56 insertions, 23 deletions
diff --git a/src/tools/miri/README.md b/src/tools/miri/README.md
index d75f0cc1e80..7ad51520a42 100644
--- a/src/tools/miri/README.md
+++ b/src/tools/miri/README.md
@@ -435,11 +435,10 @@ Moreover, Miri recognizes some environment variables:
   purpose.
 * `MIRI_NO_STD` (recognized by `cargo miri` and the test suite) makes sure that the target's
   sysroot is built without libstd. This allows testing and running no_std programs.
-* `MIRI_BLESS` (recognized by the test suite) overwrite all `stderr` and `stdout` files
-  instead of checking whether the output matches.
-* `MIRI_SKIP_UI_CHECKS` (recognized by the test suite) don't check whether the
-  `stderr` or `stdout` files match the actual output. Useful for the rustc test suite
-  which has subtle differences that we don't care about.
+* `MIRI_BLESS` (recognized by the test suite and `cargo-miri-test/run-test.py`): overwrite all
+  `stderr` and `stdout` files instead of checking whether the output matches.
+* `MIRI_SKIP_UI_CHECKS` (recognized by the test suite): don't check whether the
+  `stderr` or `stdout` files match the actual output.
 
 The following environment variables are *internal* and must not be used by
 anyone but Miri itself. They are used to communicate between different Miri
diff --git a/src/tools/miri/cargo-miri/src/main.rs b/src/tools/miri/cargo-miri/src/main.rs
index 9b5fa7ae873..c43bf0bfab1 100644
--- a/src/tools/miri/cargo-miri/src/main.rs
+++ b/src/tools/miri/cargo-miri/src/main.rs
@@ -1,3 +1,4 @@
+#![cfg_attr(bootstrap, feature(let_else))]
 #![allow(clippy::useless_format, clippy::derive_partial_eq_without_eq, rustc::internal)]
 
 #[macro_use]
diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version
index 78b9a110aa7..7729a184d32 100644
--- a/src/tools/miri/rust-version
+++ b/src/tools/miri/rust-version
@@ -1 +1 @@
-acb8934fd57b3c2740c4abac0a5728c2c9b1423b
+e42c4d7218b2596276152c5eb1e69335621f3086
diff --git a/src/tools/miri/src/lib.rs b/src/tools/miri/src/lib.rs
index 463feb4dcc8..8e2222c39a2 100644
--- a/src/tools/miri/src/lib.rs
+++ b/src/tools/miri/src/lib.rs
@@ -7,9 +7,10 @@
 #![feature(int_log)]
 #![feature(variant_count)]
 #![feature(yeet_expr)]
-#![feature(is_some_with)]
+#![feature(is_some_and)]
 #![feature(nonzero_ops)]
 #![feature(local_key_cell_methods)]
+#![cfg_attr(bootstrap, feature(let_else))]
 // Configure clippy and other lints
 #![allow(
     clippy::collapsible_else_if,
@@ -27,6 +28,7 @@
     clippy::type_complexity,
     clippy::single_element_loop,
     clippy::needless_return,
+    clippy::bool_to_int_with_if,
     // We are not implementing queries here so it's fine
     rustc::potential_query_instability
 )]
diff --git a/src/tools/miri/src/shims/unix/android/dlsym.rs b/src/tools/miri/src/shims/unix/android/dlsym.rs
index 4cb78d4dabd..b0c9d729c9d 100644
--- a/src/tools/miri/src/shims/unix/android/dlsym.rs
+++ b/src/tools/miri/src/shims/unix/android/dlsym.rs
@@ -42,7 +42,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
                     );
                 }
 
-                let &[ref _sig, ref _func] = check_arg_count(args)?;
+                let [_sig, _func] = check_arg_count(args)?;
                 this.write_null(dest)?;
             }
         }
diff --git a/src/tools/miri/src/shims/unix/fs.rs b/src/tools/miri/src/shims/unix/fs.rs
index 9713cd9265e..ed68976773d 100644
--- a/src/tools/miri/src/shims/unix/fs.rs
+++ b/src/tools/miri/src/shims/unix/fs.rs
@@ -1073,7 +1073,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
                 mask |= this.eval_libc("STATX_ATIME")?.to_u32()?;
                 InterpResult::Ok(tup)
             })
-            .unwrap_or(Ok((0, 0)))?;
+            .unwrap_or_else(|| Ok((0, 0)))?;
 
         let (created_sec, created_nsec) = metadata
             .created
@@ -1081,7 +1081,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
                 mask |= this.eval_libc("STATX_BTIME")?.to_u32()?;
                 InterpResult::Ok(tup)
             })
-            .unwrap_or(Ok((0, 0)))?;
+            .unwrap_or_else(|| Ok((0, 0)))?;
 
         let (modified_sec, modified_nsec) = metadata
             .modified
@@ -1089,7 +1089,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
                 mask |= this.eval_libc("STATX_MTIME")?.to_u32()?;
                 InterpResult::Ok(tup)
             })
-            .unwrap_or(Ok((0, 0)))?;
+            .unwrap_or_else(|| Ok((0, 0)))?;
 
         // Now we write everything to `statxbuf`. We write a zero for the unavailable fields.
         this.write_int_fields_named(
diff --git a/src/tools/miri/src/stacked_borrows/mod.rs b/src/tools/miri/src/stacked_borrows/mod.rs
index 2888f8e81fb..09d36ca9dfd 100644
--- a/src/tools/miri/src/stacked_borrows/mod.rs
+++ b/src/tools/miri/src/stacked_borrows/mod.rs
@@ -45,6 +45,7 @@ impl SbTag {
     }
 
     // The default to be used when SB is disabled
+    #[allow(clippy::should_implement_trait)]
     pub fn default() -> Self {
         Self::new(1).unwrap()
     }
diff --git a/src/tools/miri/src/stacked_borrows/stack.rs b/src/tools/miri/src/stacked_borrows/stack.rs
index 57de1c21c8b..07c211512f8 100644
--- a/src/tools/miri/src/stacked_borrows/stack.rs
+++ b/src/tools/miri/src/stacked_borrows/stack.rs
@@ -214,7 +214,7 @@ impl<'tcx> Stack {
         }
 
         // Couldn't find it in the stack; but if there is an unknown bottom it might be there.
-        let found = self.unknown_bottom.is_some_and(|&unknown_limit| {
+        let found = self.unknown_bottom.is_some_and(|unknown_limit| {
             tag.0 < unknown_limit.0 // unknown_limit is an upper bound for what can be in the unknown bottom.
         });
         if found { Ok(None) } else { Err(()) }
diff --git a/src/tools/miri/test-cargo-miri/run-test.py b/src/tools/miri/test-cargo-miri/run-test.py
index 4485d3252cc..c611b9c44be 100755
--- a/src/tools/miri/test-cargo-miri/run-test.py
+++ b/src/tools/miri/test-cargo-miri/run-test.py
@@ -33,10 +33,13 @@ def normalize_stderr(str):
     return str
 
 def check_output(actual, path, name):
+    if 'MIRI_BLESS' in os.environ:
+        open(path, mode='w').write(actual)
+        return True
     expected = open(path).read()
     if expected == actual:
         return True
-    print(f"{path} did not match reference!")
+    print(f"{name} output did not match reference in {path}!")
     print(f"--- BEGIN diff {name} ---")
     for text in difflib.unified_diff(expected.split("\n"), actual.split("\n")):
         print(text)
diff --git a/src/tools/miri/test-cargo-miri/test.filter.cross-target.stdout.ref b/src/tools/miri/test-cargo-miri/test.filter.cross-target.stdout.ref
index bb0282d6c91..39e1857060d 100644
--- a/src/tools/miri/test-cargo-miri/test.filter.cross-target.stdout.ref
+++ b/src/tools/miri/test-cargo-miri/test.filter.cross-target.stdout.ref
@@ -1,6 +1,11 @@
 
 running 0 tests
 
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
+
+
+running 0 tests
+
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out
 
 imported main
diff --git a/src/tools/miri/test-cargo-miri/test.filter.stdout.ref b/src/tools/miri/test-cargo-miri/test.filter.stdout.ref
index c618956656a..39e1857060d 100644
--- a/src/tools/miri/test-cargo-miri/test.filter.stdout.ref
+++ b/src/tools/miri/test-cargo-miri/test.filter.stdout.ref
@@ -1,6 +1,11 @@
 
 running 0 tests
 
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
+
+
+running 0 tests
+
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out
 
 imported main
@@ -10,8 +15,3 @@ test simple ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out
 
-
-running 0 tests
-
-test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in $TIME
-
diff --git a/src/tools/miri/tests/fail/concurrency/windows_join_detached.stderr b/src/tools/miri/tests/fail/concurrency/windows_join_detached.stderr
index 78c75611d33..20f34cf104d 100644
--- a/src/tools/miri/tests/fail/concurrency/windows_join_detached.stderr
+++ b/src/tools/miri/tests/fail/concurrency/windows_join_detached.stderr
@@ -8,7 +8,7 @@ LL |         let rc = unsafe { c::WaitForSingleObject(self.handle.as_raw_handle(
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
    = note: inside `std::sys::PLATFORM::thread::Thread::join` at RUSTLIB/std/src/sys/PLATFORM/thread.rs:LL:CC
-   = note: inside `std::thread::JoinInner::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
+   = note: inside `std::thread::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
    = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
 note: inside `main` at $DIR/windows_join_detached.rs:LL:CC
   --> $DIR/windows_join_detached.rs:LL:CC
diff --git a/src/tools/miri/tests/fail/erroneous_const2.stderr b/src/tools/miri/tests/fail/erroneous_const2.stderr
index 05ed8ea1c14..4d402257b8b 100644
--- a/src/tools/miri/tests/fail/erroneous_const2.stderr
+++ b/src/tools/miri/tests/fail/erroneous_const2.stderr
@@ -4,9 +4,9 @@ error: any use of this value will cause an error
 LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
    | --------------    ^^^^^ attempt to compute `5_u32 - 6_u32`, which would overflow
    |
-   = note: `#[deny(const_err)]` on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+   = note: `#[deny(const_err)]` on by default
 
 error[E0080]: evaluation of constant value failed
   --> $DIR/erroneous_const2.rs:LL:CC
diff --git a/src/tools/miri/tests/fail/invalid_bool.rs b/src/tools/miri/tests/fail/invalid_bool.rs
index 525f8831c1c..fe9bb3bed7f 100644
--- a/src/tools/miri/tests/fail/invalid_bool.rs
+++ b/src/tools/miri/tests/fail/invalid_bool.rs
@@ -1,7 +1,6 @@
 // Validation makes this fail in the wrong place
 // Make sure we find these even with many checks disabled.
 //@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
-#![feature(bench_black_box)]
 
 fn main() {
     let b = unsafe { std::mem::transmute::<u8, bool>(2) };
diff --git a/src/tools/miri/tests/pass/float.rs b/src/tools/miri/tests/pass/float.rs
index 48dd99441eb..ce62fb0de04 100644
--- a/src/tools/miri/tests/pass/float.rs
+++ b/src/tools/miri/tests/pass/float.rs
@@ -1,4 +1,4 @@
-#![feature(stmt_expr_attributes, bench_black_box)]
+#![feature(stmt_expr_attributes)]
 #![allow(arithmetic_overflow)]
 use std::fmt::Debug;
 use std::hint::black_box;
diff --git a/src/tools/miri/tests/pass/issues/issue-miri-2433.rs b/src/tools/miri/tests/pass/issues/issue-miri-2433.rs
new file mode 100644
index 00000000000..a8281d30bac
--- /dev/null
+++ b/src/tools/miri/tests/pass/issues/issue-miri-2433.rs
@@ -0,0 +1,24 @@
+#![feature(type_alias_impl_trait)]
+
+trait T {
+    type Item;
+}
+
+type Alias<'a> = impl T<Item = &'a ()>;
+
+struct S;
+impl<'a> T for &'a S {
+    type Item = &'a ();
+}
+
+fn filter_positive<'a>() -> Alias<'a> {
+    &S
+}
+
+fn with_positive(fun: impl Fn(Alias<'_>)) {
+    fun(filter_positive());
+}
+
+fn main() {
+    with_positive(|_| ());
+}
diff --git a/src/tools/miri/tests/pass/u128.rs b/src/tools/miri/tests/pass/u128.rs
index 0ef7a514cb6..6def529dbe7 100644
--- a/src/tools/miri/tests/pass/u128.rs
+++ b/src/tools/miri/tests/pass/u128.rs
@@ -1,4 +1,3 @@
-#![feature(bench_black_box)]
 use std::hint::black_box as b;
 
 fn main() {