Skip to content

Commit

Permalink
black_box: silence unused_mut warning when building with cfg(miri)
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Sep 17, 2020
1 parent 95386b6 commit 1dd3df6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/core/src/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(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
Expand Down

0 comments on commit 1dd3df6

Please sign in to comment.