summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-11-22 11:28:35 +0100
committerRalf Jung <post@ralfj.de>2022-11-22 11:49:02 +0100
commit3a95e12c9bbe978fc2e89ec50bb8aa82694003e8 (patch)
tree147ad7d0b476ec56ee3c3ddc4459867de03486c9 /library/std/src
parenta78c9bee4d9d51a3891bd8ecae1f28a93b83653b (diff)
downloadrust-3a95e12c9bbe978fc2e89ec50bb8aa82694003e8.tar.gz
rust-3a95e12c9bbe978fc2e89ec50bb8aa82694003e8.zip
disable strict-provenance-violating doctests in Miri
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/primitive_docs.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/std/src/primitive_docs.rs b/library/std/src/primitive_docs.rs
index 331714a993c..d6e9da187e8 100644
--- a/library/std/src/primitive_docs.rs
+++ b/library/std/src/primitive_docs.rs
@@ -1493,11 +1493,13 @@ mod prim_ref {}
 /// However, a direct cast back is not possible. You need to use `transmute`:
 ///
 /// ```rust
+/// # #[cfg(not(miri))] { // FIXME: use strict provenance APIs once they are stable, then remove this `cfg`
 /// # let fnptr: fn(i32) -> i32 = |x| x+2;
 /// # let fnptr_addr = fnptr as usize;
 /// let fnptr = fnptr_addr as *const ();
 /// let fnptr: fn(i32) -> i32 = unsafe { std::mem::transmute(fnptr) };
 /// assert_eq!(fnptr(40), 42);
+/// # }
 /// ```
 ///
 /// Crucially, we `as`-cast to a raw pointer before `transmute`ing to a function pointer.