Skip to content

Commit 1dd3df6

Browse files
committed
black_box: silence unused_mut warning when building with cfg(miri)
1 parent 95386b6 commit 1dd3df6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/hint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub fn spin_loop() {
110110
/// backend used. Programs cannot rely on `black_box` for *correctness* in any way.
111111
#[inline]
112112
#[unstable(feature = "test", issue = "50297")]
113-
#[allow(unreachable_code)] // this makes #[cfg] a bit easier below.
113+
#[cfg_attr(miri, allow(unused_mut))]
114114
pub fn black_box<T>(mut dummy: T) -> T {
115115
// We need to "use" the argument in some way LLVM can't introspect, and on
116116
// targets that support it we can typically leverage inline assembly to do

0 commit comments

Comments
 (0)