disable strict-provenance-violating doctests in Miri
This commit is contained in:
parent
a78c9bee4d
commit
3a95e12c9b
4 changed files with 12 additions and 0 deletions
|
@ -112,11 +112,13 @@ impl<T: ?Sized> *const T {
|
|||
///
|
||||
/// ```
|
||||
/// #![feature(ptr_to_from_bits)]
|
||||
/// # #[cfg(not(miri))] { // doctest does not work with strict provenance
|
||||
/// let array = [13, 42];
|
||||
/// let p0: *const i32 = &array[0];
|
||||
/// assert_eq!(<*const _>::from_bits(p0.to_bits()), p0);
|
||||
/// let p1: *const i32 = &array[1];
|
||||
/// assert_eq!(p1.to_bits() - p0.to_bits(), 4);
|
||||
/// # }
|
||||
/// ```
|
||||
#[unstable(feature = "ptr_to_from_bits", issue = "91126")]
|
||||
#[deprecated(
|
||||
|
@ -140,9 +142,11 @@ impl<T: ?Sized> *const T {
|
|||
///
|
||||
/// ```
|
||||
/// #![feature(ptr_to_from_bits)]
|
||||
/// # #[cfg(not(miri))] { // doctest does not work with strict provenance
|
||||
/// use std::ptr::NonNull;
|
||||
/// let dangling: *const u8 = NonNull::dangling().as_ptr();
|
||||
/// assert_eq!(<*const u8>::from_bits(1), dangling);
|
||||
/// # }
|
||||
/// ```
|
||||
#[unstable(feature = "ptr_to_from_bits", issue = "91126")]
|
||||
#[deprecated(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue