From 4f92f0d31bcdb25ab54e2deffa7f194c13d1c7ee Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 11 Jul 2020 14:19:07 +0200 Subject: [PATCH] remove feature gate from tests --- library/core/src/ptr/const_ptr.rs | 4 ---- library/core/src/ptr/mut_ptr.rs | 4 ---- src/test/ui/consts/offset.rs | 1 - src/test/ui/consts/offset_from.rs | 1 - src/test/ui/consts/offset_from_ub.rs | 1 - src/test/ui/consts/offset_from_ub.stderr | 20 ++++++++++---------- src/test/ui/offset_from.rs | 2 -- 7 files changed, 10 insertions(+), 23 deletions(-) diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs index 999c908ca66..4b776e128ea 100644 --- a/library/core/src/ptr/const_ptr.rs +++ b/library/core/src/ptr/const_ptr.rs @@ -339,8 +339,6 @@ impl *const T { /// Basic usage: /// /// ``` - /// #![feature(ptr_offset_from)] - /// /// let a = [0; 5]; /// let ptr1: *const i32 = &a[1]; /// let ptr2: *const i32 = &a[3]; @@ -355,8 +353,6 @@ impl *const T { /// *Incorrect* usage: /// /// ```rust,no_run - /// #![feature(ptr_offset_from)] - /// /// let ptr1 = Box::into_raw(Box::new(0u8)) as *const u8; /// let ptr2 = Box::into_raw(Box::new(1u8)) as *const u8; /// let diff = (ptr2 as isize).wrapping_sub(ptr1 as isize); diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs index f4b28290f32..c3a818e4b3f 100644 --- a/library/core/src/ptr/mut_ptr.rs +++ b/library/core/src/ptr/mut_ptr.rs @@ -510,8 +510,6 @@ impl *mut T { /// Basic usage: /// /// ``` - /// #![feature(ptr_offset_from)] - /// /// let mut a = [0; 5]; /// let ptr1: *mut i32 = &mut a[1]; /// let ptr2: *mut i32 = &mut a[3]; @@ -526,8 +524,6 @@ impl *mut T { /// *Incorrect* usage: /// /// ```rust,no_run - /// #![feature(ptr_offset_from)] - /// /// let ptr1 = Box::into_raw(Box::new(0u8)); /// let ptr2 = Box::into_raw(Box::new(1u8)); /// let diff = (ptr2 as isize).wrapping_sub(ptr1 as isize); diff --git a/src/test/ui/consts/offset.rs b/src/test/ui/consts/offset.rs index f64242d568e..a491f1c92d3 100644 --- a/src/test/ui/consts/offset.rs +++ b/src/test/ui/consts/offset.rs @@ -1,7 +1,6 @@ // run-pass #![feature(const_ptr_offset)] #![feature(const_ptr_offset_from)] -#![feature(ptr_offset_from)] use std::ptr; #[repr(C)] diff --git a/src/test/ui/consts/offset_from.rs b/src/test/ui/consts/offset_from.rs index 8c1b2784262..8d501e0d953 100644 --- a/src/test/ui/consts/offset_from.rs +++ b/src/test/ui/consts/offset_from.rs @@ -2,7 +2,6 @@ #![feature(const_raw_ptr_deref)] #![feature(const_ptr_offset_from)] -#![feature(ptr_offset_from)] struct Struct { field: (), diff --git a/src/test/ui/consts/offset_from_ub.rs b/src/test/ui/consts/offset_from_ub.rs index a7902f20467..b73191d56a6 100644 --- a/src/test/ui/consts/offset_from_ub.rs +++ b/src/test/ui/consts/offset_from_ub.rs @@ -1,6 +1,5 @@ #![feature(const_raw_ptr_deref)] #![feature(const_ptr_offset_from)] -#![feature(ptr_offset_from)] #[repr(C)] struct Struct { diff --git a/src/test/ui/consts/offset_from_ub.stderr b/src/test/ui/consts/offset_from_ub.stderr index bd57e68e137..a89dcefd839 100644 --- a/src/test/ui/consts/offset_from_ub.stderr +++ b/src/test/ui/consts/offset_from_ub.stderr @@ -6,9 +6,9 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) } | | | ptr_offset_from cannot compute offset of pointers into different allocations. | inside `std::ptr::const_ptr::::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | inside `DIFFERENT_ALLOC` at $DIR/offset_from_ub.rs:17:27 + | inside `DIFFERENT_ALLOC` at $DIR/offset_from_ub.rs:16:27 | - ::: $DIR/offset_from_ub.rs:11:1 + ::: $DIR/offset_from_ub.rs:10:1 | LL | / pub const DIFFERENT_ALLOC: usize = { LL | | @@ -29,9 +29,9 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) } | | | unable to turn bytes into a pointer | inside `std::ptr::const_ptr::::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | inside `NOT_PTR` at $DIR/offset_from_ub.rs:23:14 + | inside `NOT_PTR` at $DIR/offset_from_ub.rs:22:14 | - ::: $DIR/offset_from_ub.rs:21:1 + ::: $DIR/offset_from_ub.rs:20:1 | LL | / pub const NOT_PTR: usize = { LL | | @@ -47,9 +47,9 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) } | | | exact_div: 1_isize cannot be divided by 2_isize without remainder | inside `std::ptr::const_ptr::::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | inside `NOT_MULTIPLE_OF_SIZE` at $DIR/offset_from_ub.rs:31:14 + | inside `NOT_MULTIPLE_OF_SIZE` at $DIR/offset_from_ub.rs:30:14 | - ::: $DIR/offset_from_ub.rs:26:1 + ::: $DIR/offset_from_ub.rs:25:1 | LL | / pub const NOT_MULTIPLE_OF_SIZE: isize = { LL | | @@ -68,9 +68,9 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) } | | | inbounds test failed: 0x0 is not a valid pointer | inside `std::ptr::const_ptr::::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | inside `OFFSET_FROM_NULL` at $DIR/offset_from_ub.rs:37:14 + | inside `OFFSET_FROM_NULL` at $DIR/offset_from_ub.rs:36:14 | - ::: $DIR/offset_from_ub.rs:34:1 + ::: $DIR/offset_from_ub.rs:33:1 | LL | / pub const OFFSET_FROM_NULL: isize = { LL | | @@ -87,9 +87,9 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) } | | | unable to turn bytes into a pointer | inside `std::ptr::const_ptr::::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | inside `DIFFERENT_INT` at $DIR/offset_from_ub.rs:44:14 + | inside `DIFFERENT_INT` at $DIR/offset_from_ub.rs:43:14 | - ::: $DIR/offset_from_ub.rs:40:1 + ::: $DIR/offset_from_ub.rs:39:1 | LL | / pub const DIFFERENT_INT: isize = { // offset_from with two different integers: like DIFFERENT_ALLOC LL | | diff --git a/src/test/ui/offset_from.rs b/src/test/ui/offset_from.rs index cbbb2adf15f..aa59c119706 100644 --- a/src/test/ui/offset_from.rs +++ b/src/test/ui/offset_from.rs @@ -1,7 +1,5 @@ // run-pass -#![feature(ptr_offset_from)] - fn main() { let mut a = [0; 5]; let ptr1: *mut i32 = &mut a[1];