We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e114d62 commit caeb554Copy full SHA for caeb554
library/core/src/hint.rs
@@ -108,7 +108,8 @@ pub fn spin_loop() {
108
/// Note however, that `black_box` is only (and can only be) provided on a "best-effort" basis. The
109
/// extent to which it can block optimisations may vary depending upon the platform and code-gen
110
/// backend used. Programs cannot rely on `black_box` for *correctness* in any way.
111
-#[inline]
+#[cfg_attr(not(miri), inline)]
112
+#[cfg_attr(miri, inline(never))]
113
#[unstable(feature = "test", issue = "50297")]
114
#[allow(unreachable_code)] // this makes #[cfg] a bit easier below.
115
pub fn black_box<T>(dummy: T) -> T {
0 commit comments