From 1dd3df6738b5bbe676b6ae5b561c491ca483f017 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 17 Sep 2020 08:59:30 +0200 Subject: [PATCH] black_box: silence unused_mut warning when building with cfg(miri) --- library/core/src/hint.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs index 1192b9e164a..fdf5bbf6144 100644 --- a/library/core/src/hint.rs +++ b/library/core/src/hint.rs @@ -110,7 +110,7 @@ pub fn spin_loop() { /// backend used. Programs cannot rely on `black_box` for *correctness* in any way. #[inline] #[unstable(feature = "test", issue = "50297")] -#[allow(unreachable_code)] // this makes #[cfg] a bit easier below. +#[cfg_attr(miri, allow(unused_mut))] pub fn black_box(mut dummy: T) -> T { // We need to "use" the argument in some way LLVM can't introspect, and on // targets that support it we can typically leverage inline assembly to do