From 69ad63480820009278c470a67485e3505f03a633 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Thu, 12 May 2022 16:48:46 +1000 Subject: [PATCH] Do not include `const_ptr_sub_ptr` in this stabilization --- library/core/src/intrinsics.rs | 2 +- src/test/ui/consts/offset_from_ub.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs index c0066ff62c6f5..e31c226e818be 100644 --- a/library/core/src/intrinsics.rs +++ b/library/core/src/intrinsics.rs @@ -2017,7 +2017,7 @@ extern "rust-intrinsic" { pub fn ptr_offset_from(ptr: *const T, base: *const T) -> isize; /// See documentation of `<*const T>::sub_ptr` for details. - #[rustc_const_stable(feature = "const_ptr_offset_from", since = "1.65.0")] + #[rustc_const_unstable(feature = "const_ptr_sub_ptr", issue = "95892")] pub fn ptr_offset_from_unsigned(ptr: *const T, base: *const T) -> usize; /// See documentation of `<*const T>::guaranteed_eq` for details. diff --git a/src/test/ui/consts/offset_from_ub.rs b/src/test/ui/consts/offset_from_ub.rs index 264bd631b3ba2..51163e650d6aa 100644 --- a/src/test/ui/consts/offset_from_ub.rs +++ b/src/test/ui/consts/offset_from_ub.rs @@ -1,3 +1,4 @@ +#![feature(const_ptr_sub_ptr)] #![feature(core_intrinsics)] use std::intrinsics::{ptr_offset_from, ptr_offset_from_unsigned};