about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgnzlbg <gonzalobg88@gmail.com>2019-03-25 18:11:42 +0100
committergnzlbg <gonzalobg88@gmail.com>2019-03-25 18:43:51 +0100
commit24db5174191c915bb7a61809837aaa5cb98cfa11 (patch)
treece9295c723ae99e7f0923b95e74a1850afb5b352
parentcfa76c438a907bf223e4487ab4da2500277474cc (diff)
downloadrust-24db5174191c915bb7a61809837aaa5cb98cfa11.tar.gz
rust-24db5174191c915bb7a61809837aaa5cb98cfa11.zip
black_box should use inline assembly on wasm32
-rw-r--r--src/libcore/hint.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/hint.rs b/src/libcore/hint.rs
index abaf0b31b46..e73a1a28793 100644
--- a/src/libcore/hint.rs
+++ b/src/libcore/hint.rs
@@ -99,17 +99,17 @@ pub fn spin_loop() {
 /// This function is a no-op, and does not even read from `dummy`.
 #[unstable(feature = "test", issue = "27812")]
 pub fn black_box<T>(dummy: T) -> T {
-    #[cfg(not(any(target_arch = "asmjs", target_arch = "wasm32")))] {
+    #[cfg(not(target_arch = "asmjs"))] {
         // we need to "use" the argument in some way LLVM can't
         // introspect.
         unsafe { asm!("" : : "r"(&dummy)) }
         dummy
     }
-    #[cfg(any(target_arch = "asmjs", target_arch = "wasm32"))] {
+    #[cfg(target_arch = "asmjs")] {
         unsafe {
             let ret = crate::ptr::read_volatile(&dummy);
             crate::mem::forget(dummy);
             ret
         }
-   }
+    }
 }