We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f5d6b3a commit f244383Copy full SHA for f244383
src/libcore/hint.rs
@@ -97,7 +97,6 @@ pub fn spin_loop() {
97
/// elimination.
98
///
99
/// This function is a no-op, and does not even read from `dummy`.
100
-#[cfg_attr(any(target_arch = "asmjs", target_arch = "wasm32"), inline(never))]
101
#[unstable(feature = "test", issue = "27812")]
102
pub fn black_box<T>(dummy: T) -> T {
103
#[cfg(not(any(target_arch = "asmjs", target_arch = "wasm32")))] {
@@ -107,6 +106,7 @@ pub fn black_box<T>(dummy: T) -> T {
107
106
dummy
108
}
109
#[cfg(any(target_arch = "asmjs", target_arch = "wasm32"))] {
110
- dummy
+ #[inline(never)] fn black_box_(x: T) -> T { x }
+ black_box_(dummy)
111
112
0 commit comments