Skip to content

Commit

Permalink
Rollup merge of rust-lang#76823 - RalfJung:black-box-warn, r=joshtrip…
Browse files Browse the repository at this point in the history
…lett

black_box: silence unused_mut warning when building with cfg(miri)
  • Loading branch information
Dylan-DPC committed Sep 19, 2020
2 parents ea11a23 + 1dd3df6 commit d0d8e7d
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 @@ -111,7 +111,7 @@ pub fn spin_loop() {
#[cfg_attr(not(miri), inline)]
#[cfg_attr(miri, inline(never))]
#[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 d0d8e7d

Please sign in to comment.