about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/hint.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/hint.rs b/src/libcore/hint.rs
index d6ddab0d8f5..75d64bbe0fb 100644
--- a/src/libcore/hint.rs
+++ b/src/libcore/hint.rs
@@ -97,7 +97,6 @@ pub fn spin_loop() {
 /// elimination.
 ///
 /// This function is a no-op, and does not even read from `dummy`.
-#[cfg_attr(any(target_arch = "asmjs", target_arch = "wasm32"), inline(never))]
 #[unstable(feature = "test", issue = "27812")]
 pub fn black_box<T>(dummy: T) -> T {
     #[cfg(not(any(target_arch = "asmjs", target_arch = "wasm32")))] {
@@ -107,6 +106,7 @@ pub fn black_box<T>(dummy: T) -> T {
         dummy
     }
     #[cfg(any(target_arch = "asmjs", target_arch = "wasm32"))] {
-        dummy
+        #[inline(never)] fn black_box_(x: T) -> T { x }
+        black_box_(dummy)
     }
 }