Skip to content

Commit 4f92f0d

Browse files
committed
remove feature gate from tests
1 parent 0e4f335 commit 4f92f0d

File tree

7 files changed

+10
-23
lines changed

7 files changed

+10
-23
lines changed

library/core/src/ptr/const_ptr.rs

-4
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,6 @@ impl<T: ?Sized> *const T {
339339
/// Basic usage:
340340
///
341341
/// ```
342-
/// #![feature(ptr_offset_from)]
343-
///
344342
/// let a = [0; 5];
345343
/// let ptr1: *const i32 = &a[1];
346344
/// let ptr2: *const i32 = &a[3];
@@ -355,8 +353,6 @@ impl<T: ?Sized> *const T {
355353
/// *Incorrect* usage:
356354
///
357355
/// ```rust,no_run
358-
/// #![feature(ptr_offset_from)]
359-
///
360356
/// let ptr1 = Box::into_raw(Box::new(0u8)) as *const u8;
361357
/// let ptr2 = Box::into_raw(Box::new(1u8)) as *const u8;
362358
/// let diff = (ptr2 as isize).wrapping_sub(ptr1 as isize);

library/core/src/ptr/mut_ptr.rs

-4
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,6 @@ impl<T: ?Sized> *mut T {
510510
/// Basic usage:
511511
///
512512
/// ```
513-
/// #![feature(ptr_offset_from)]
514-
///
515513
/// let mut a = [0; 5];
516514
/// let ptr1: *mut i32 = &mut a[1];
517515
/// let ptr2: *mut i32 = &mut a[3];
@@ -526,8 +524,6 @@ impl<T: ?Sized> *mut T {
526524
/// *Incorrect* usage:
527525
///
528526
/// ```rust,no_run
529-
/// #![feature(ptr_offset_from)]
530-
///
531527
/// let ptr1 = Box::into_raw(Box::new(0u8));
532528
/// let ptr2 = Box::into_raw(Box::new(1u8));
533529
/// let diff = (ptr2 as isize).wrapping_sub(ptr1 as isize);

src/test/ui/consts/offset.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22
#![feature(const_ptr_offset)]
33
#![feature(const_ptr_offset_from)]
4-
#![feature(ptr_offset_from)]
54
use std::ptr;
65

76
#[repr(C)]

src/test/ui/consts/offset_from.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#![feature(const_raw_ptr_deref)]
44
#![feature(const_ptr_offset_from)]
5-
#![feature(ptr_offset_from)]
65

76
struct Struct {
87
field: (),

src/test/ui/consts/offset_from_ub.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(const_raw_ptr_deref)]
22
#![feature(const_ptr_offset_from)]
3-
#![feature(ptr_offset_from)]
43

54
#[repr(C)]
65
struct Struct {

src/test/ui/consts/offset_from_ub.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
66
| |
77
| ptr_offset_from cannot compute offset of pointers into different allocations.
88
| inside `std::ptr::const_ptr::<impl *const Struct>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
9-
| inside `DIFFERENT_ALLOC` at $DIR/offset_from_ub.rs:17:27
9+
| inside `DIFFERENT_ALLOC` at $DIR/offset_from_ub.rs:16:27
1010
|
11-
::: $DIR/offset_from_ub.rs:11:1
11+
::: $DIR/offset_from_ub.rs:10:1
1212
|
1313
LL | / pub const DIFFERENT_ALLOC: usize = {
1414
LL | |
@@ -29,9 +29,9 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
2929
| |
3030
| unable to turn bytes into a pointer
3131
| inside `std::ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
32-
| inside `NOT_PTR` at $DIR/offset_from_ub.rs:23:14
32+
| inside `NOT_PTR` at $DIR/offset_from_ub.rs:22:14
3333
|
34-
::: $DIR/offset_from_ub.rs:21:1
34+
::: $DIR/offset_from_ub.rs:20:1
3535
|
3636
LL | / pub const NOT_PTR: usize = {
3737
LL | |
@@ -47,9 +47,9 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
4747
| |
4848
| exact_div: 1_isize cannot be divided by 2_isize without remainder
4949
| inside `std::ptr::const_ptr::<impl *const u16>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
50-
| inside `NOT_MULTIPLE_OF_SIZE` at $DIR/offset_from_ub.rs:31:14
50+
| inside `NOT_MULTIPLE_OF_SIZE` at $DIR/offset_from_ub.rs:30:14
5151
|
52-
::: $DIR/offset_from_ub.rs:26:1
52+
::: $DIR/offset_from_ub.rs:25:1
5353
|
5454
LL | / pub const NOT_MULTIPLE_OF_SIZE: isize = {
5555
LL | |
@@ -68,9 +68,9 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
6868
| |
6969
| inbounds test failed: 0x0 is not a valid pointer
7070
| inside `std::ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
71-
| inside `OFFSET_FROM_NULL` at $DIR/offset_from_ub.rs:37:14
71+
| inside `OFFSET_FROM_NULL` at $DIR/offset_from_ub.rs:36:14
7272
|
73-
::: $DIR/offset_from_ub.rs:34:1
73+
::: $DIR/offset_from_ub.rs:33:1
7474
|
7575
LL | / pub const OFFSET_FROM_NULL: isize = {
7676
LL | |
@@ -87,9 +87,9 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
8787
| |
8888
| unable to turn bytes into a pointer
8989
| inside `std::ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
90-
| inside `DIFFERENT_INT` at $DIR/offset_from_ub.rs:44:14
90+
| inside `DIFFERENT_INT` at $DIR/offset_from_ub.rs:43:14
9191
|
92-
::: $DIR/offset_from_ub.rs:40:1
92+
::: $DIR/offset_from_ub.rs:39:1
9393
|
9494
LL | / pub const DIFFERENT_INT: isize = { // offset_from with two different integers: like DIFFERENT_ALLOC
9595
LL | |

src/test/ui/offset_from.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// run-pass
22

3-
#![feature(ptr_offset_from)]
4-
53
fn main() {
64
let mut a = [0; 5];
75
let ptr1: *mut i32 = &mut a[1];

0 commit comments

Comments
 (0)