about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2024-08-18 23:41:46 -0500
committerGitHub <noreply@github.com>2024-08-18 23:41:46 -0500
commitf27a9b15d311e12319977bf9867042b677220c72 (patch)
treea76f2ef14a78dbc9e0b2bd7dd969acb6a46ca902 /tests
parent804be74e3c4ec3646b448dfdb7a0fc31237a5818 (diff)
parent35709be02d43b40e7f720408f8a88bf6e9d5501d (diff)
downloadrust-f27a9b15d311e12319977bf9867042b677220c72.tar.gz
rust-f27a9b15d311e12319977bf9867042b677220c72.zip
Rollup merge of #127679 - RalfJung:raw_ref_op, r=jieyouxu
Stabilize `raw_ref_op` (RFC 2582)

This stabilizes the syntax `&raw const $expr` and `&raw mut $expr`. It has existed unstably for ~4 years now, and has been exposed on stable via the `addr_of` and `addr_of_mut` macros since Rust 1.51 (released more than 3 years ago). I think it has become clear that these operations are here to stay. So it is about time we give them proper primitive syntax. This has two advantages over the macro:

- Being macros, `addr_of`/`addr_of_mut` could in theory do arbitrary magic with the expression on which they work. The only "magic" they actually do is using the argument as a place expression rather than as a value expression. Place expressions are already a subtle topic and poorly understood by many programmers; having this hidden behind a macro using unstable language features makes this even worse. Conversely, people do have an idea of what happens below `&`/`&mut`, so we can make the subtle topic a lot more approachable by connecting to existing intuition.
- The name `addr_of` is quite unfortunate from today's perspective, given that we have accepted provenance as a reality, which means that a pointer is *not* just an address. Strict provenance has a method, `addr`, which extracts the address of a pointer; using the term `addr` in two different ways is quite unfortunate. That's why this PR soft-deprecates `addr_of` -- we will wait a long time before actually showing any warning here, but we should start telling people that the "addr" part of this name is somewhat misleading, and `&raw` avoids that potential confusion.

In summary, this syntax improves developers' ability to conceptualize the operational semantics of Rust, while making a fundamental operation frequently used in unsafe code feel properly built in.

Possible questions to consider, based on the RFC and [this](https://github.com/rust-lang/rust/issues/64490#issuecomment-1163802912) great summary by `@CAD97:`

- Some questions are entirely about the semantics. The semantics are the same as with the macros so I don't think this should have any impact on this syntax PR. Still, for completeness' sake:
  - Should `&raw const *mut_ref` give a read-only pointer?
    - Tracked at: https://github.com/rust-lang/unsafe-code-guidelines/issues/257
    - I think ideally the answer is "no". Stacked Borrows says that pointer is read-only, but Tree Borrows says it is mutable.
  - What exactly does `&raw const (*ptr).field` require? Answered in [the reference](https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html): the arithmetic to compute the field offset follows the rules of `ptr::offset`, making it UB if it goes out-of-bounds. Making this a safe operation (using `wrapping_offset` rules) is considered too much of a loss for alias analysis.
- Choose a different syntax? I don't want to re-litigate the RFC. The only credible alternative that has been proposed is `&raw $place` instead of `&raw const $place`, which (IIUC) could be achieved by making `raw` a contextual keyword in a new edition. The type is named `*const T`, so the explicit `const` is consistent in that regard. `&raw expr` lacks the explicit indication of immutability. However, `&raw const expr` is quite a but longer than `addr_of!(expr)`.
- Shouldn't we have a completely new, better raw pointer type instead? Yes we all want to see that happen -- but I don't think we should block stabilization on that, given that such a nicer type is not on the horizon currently and given the issues with `addr_of!` mentioned above. (If we keep the `&raw $place` syntax free for this, we could use it in the future for that new type.)
- What about the lint the RFC talked about? It hasn't been implemented yet.  Given that the problematic code is UB with or without this stabilization, I don't think the lack of the lint should block stabilization.
  - I created an issue to track adding it: https://github.com/rust-lang/rust/issues/127724
- Other points from the "future possibilites of the RFC
  - "Syntactic sugar" extension: this has not been implemented. I'd argue this is too confusing, we should stick to what the RFC suggested and if we want to do anything about such expressions, add the lint.
  - Encouraging / requiring `&raw` in situations where references are often/definitely incorrect: this has been / is being implemented. On packed fields this already is a hard error, and for `static mut` a lint suggesting raw pointers is being rolled out.
  - Lowering of casts: this has been implemented. (It's also an invisible implementation detail.)
  - `offsetof` woes: we now have native `offset_of` so this is not relevant any more.

To be done before landing:

- [x] Suppress `unused_parens` lint around `&raw {const|mut}` expressions
  - See bottom of https://github.com/rust-lang/rust/pull/127679#issuecomment-2264073752 for rationale
  - Implementation: https://github.com/rust-lang/rust/pull/128782
- [ ] Update the Reference.
  - https://github.com/rust-lang/reference/pull/1567

Fixes https://github.com/rust-lang/rust/issues/64490

cc `@rust-lang/lang` `@rust-lang/opsem`

try-job: x86_64-msvc
try-job: test-various
try-job: dist-various-1
try-job: armhf-gnu
try-job: aarch64-apple
Diffstat (limited to 'tests')
-rw-r--r--tests/mir-opt/const_prop/indirect_mutation.rs1
-rw-r--r--tests/mir-opt/copy-prop/reborrow.rs2
-rw-r--r--tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff18
-rw-r--r--tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff18
-rw-r--r--tests/mir-opt/gvn.rs1
-rw-r--r--tests/mir-opt/instsimplify/ref_of_deref.rs1
-rw-r--r--tests/mir-opt/reference_prop.rs1
-rw-r--r--tests/pretty/raw-address-of.rs1
-rw-r--r--tests/ui/borrowck/borrow-raw-address-of-borrowed.rs2
-rw-r--r--tests/ui/borrowck/borrow-raw-address-of-borrowed.stderr6
-rw-r--r--tests/ui/borrowck/borrow-raw-address-of-deref-mutability-ok.rs2
-rw-r--r--tests/ui/borrowck/borrow-raw-address-of-deref-mutability.rs2
-rw-r--r--tests/ui/borrowck/borrow-raw-address-of-deref-mutability.stderr4
-rw-r--r--tests/ui/borrowck/borrow-raw-address-of-mutability-ok.rs2
-rw-r--r--tests/ui/borrowck/borrow-raw-address-of-mutability.rs2
-rw-r--r--tests/ui/borrowck/borrow-raw-address-of-mutability.stderr10
-rw-r--r--tests/ui/consts/const-address-of-interior-mut.rs2
-rw-r--r--tests/ui/consts/const-address-of-interior-mut.stderr8
-rw-r--r--tests/ui/consts/const-address-of-mut.rs2
-rw-r--r--tests/ui/consts/const-address-of-mut.stderr6
-rw-r--r--tests/ui/consts/const-address-of.rs2
-rw-r--r--tests/ui/consts/const-mut-refs/const_mut_address_of.rs1
-rw-r--r--tests/ui/consts/const-mut-refs/mut_ref_in_final.rs1
-rw-r--r--tests/ui/consts/const-mut-refs/mut_ref_in_final.stderr20
-rw-r--r--tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs1
-rw-r--r--tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr10
-rw-r--r--tests/ui/consts/min_const_fn/address_of.rs2
-rw-r--r--tests/ui/consts/min_const_fn/address_of.stderr4
-rw-r--r--tests/ui/consts/min_const_fn/address_of_const.rs2
-rw-r--r--tests/ui/consts/qualif-indirect-mutation-fail.rs1
-rw-r--r--tests/ui/consts/qualif-indirect-mutation-fail.stderr22
-rw-r--r--tests/ui/lint/lint-unnecessary-parens.fixed1
-rw-r--r--tests/ui/lint/lint-unnecessary-parens.rs1
-rw-r--r--tests/ui/lint/lint-unnecessary-parens.stderr66
-rw-r--r--tests/ui/lint/unused/lint-unused-mut-variables.rs2
-rw-r--r--tests/ui/macros/stringify.rs1
-rw-r--r--tests/ui/mir/mir_raw_fat_ptr.rs1
-rw-r--r--tests/ui/mir/mir_raw_fat_ptr.stderr2
-rw-r--r--tests/ui/packed/packed-struct-address-of-element.rs1
-rw-r--r--tests/ui/raw-ref-op/feature-raw-ref-op.rs21
-rw-r--r--tests/ui/raw-ref-op/feature-raw-ref-op.stderr63
-rw-r--r--tests/ui/raw-ref-op/raw-ref-op.rs2
-rw-r--r--tests/ui/raw-ref-op/raw-ref-temp-deref.rs2
-rw-r--r--tests/ui/raw-ref-op/raw-ref-temp.rs2
-rw-r--r--tests/ui/raw-ref-op/unusual_locations.rs2
-rw-r--r--tests/ui/sanitizer/thread.rs1
-rw-r--r--tests/ui/static/raw-ref-extern-static.rs1
-rw-r--r--tests/ui/static/raw-ref-static-mut.rs1
-rw-r--r--tests/ui/unpretty/expanded-exhaustive.rs1
-rw-r--r--tests/ui/unpretty/expanded-exhaustive.stdout1
50 files changed, 100 insertions, 229 deletions
diff --git a/tests/mir-opt/const_prop/indirect_mutation.rs b/tests/mir-opt/const_prop/indirect_mutation.rs
index 32ff8f142b1..f001b631acb 100644
--- a/tests/mir-opt/const_prop/indirect_mutation.rs
+++ b/tests/mir-opt/const_prop/indirect_mutation.rs
@@ -1,6 +1,5 @@
 //@ test-mir-pass: GVN
 // Check that we do not propagate past an indirect mutation.
-#![feature(raw_ref_op)]
 
 // EMIT_MIR indirect_mutation.foo.GVN.diff
 fn foo() {
diff --git a/tests/mir-opt/copy-prop/reborrow.rs b/tests/mir-opt/copy-prop/reborrow.rs
index 2f1720556cd..51a1f92cde2 100644
--- a/tests/mir-opt/copy-prop/reborrow.rs
+++ b/tests/mir-opt/copy-prop/reborrow.rs
@@ -3,8 +3,6 @@
 // Check that CopyProp considers reborrows as not mutating the pointer.
 //@ test-mir-pass: CopyProp
 
-#![feature(raw_ref_op)]
-
 #[inline(never)]
 fn opaque(_: impl Sized) {}
 
diff --git a/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff b/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff
index b5c0cee7846..0c49e706c9e 100644
--- a/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff
+++ b/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff
@@ -8,10 +8,10 @@
       let mut _3: fn(u8) -> u8;
       let _5: ();
       let mut _6: fn(u8) -> u8;
-      let mut _9: {closure@$DIR/gvn.rs:615:19: 615:21};
+      let mut _9: {closure@$DIR/gvn.rs:614:19: 614:21};
       let _10: ();
       let mut _11: fn();
-      let mut _13: {closure@$DIR/gvn.rs:615:19: 615:21};
+      let mut _13: {closure@$DIR/gvn.rs:614:19: 614:21};
       let _14: ();
       let mut _15: fn();
       scope 1 {
@@ -19,7 +19,7 @@
           let _4: fn(u8) -> u8;
           scope 2 {
               debug g => _4;
-              let _7: {closure@$DIR/gvn.rs:615:19: 615:21};
+              let _7: {closure@$DIR/gvn.rs:614:19: 614:21};
               scope 3 {
                   debug closure => _7;
                   let _8: fn();
@@ -62,16 +62,16 @@
           StorageDead(_6);
           StorageDead(_5);
 -         StorageLive(_7);
--         _7 = {closure@$DIR/gvn.rs:615:19: 615:21};
+-         _7 = {closure@$DIR/gvn.rs:614:19: 614:21};
 -         StorageLive(_8);
 +         nop;
-+         _7 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
++         _7 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21};
 +         nop;
           StorageLive(_9);
 -         _9 = _7;
 -         _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe)));
-+         _9 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
-+         _8 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe)));
++         _9 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21};
++         _8 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe)));
           StorageDead(_9);
           StorageLive(_10);
           StorageLive(_11);
@@ -88,8 +88,8 @@
           StorageLive(_13);
 -         _13 = _7;
 -         _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe)));
-+         _13 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
-+         _12 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe)));
++         _13 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21};
++         _12 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe)));
           StorageDead(_13);
           StorageLive(_14);
           StorageLive(_15);
diff --git a/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff b/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff
index 7bc6573c13d..e5f865b74b9 100644
--- a/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff
+++ b/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff
@@ -8,10 +8,10 @@
       let mut _3: fn(u8) -> u8;
       let _5: ();
       let mut _6: fn(u8) -> u8;
-      let mut _9: {closure@$DIR/gvn.rs:615:19: 615:21};
+      let mut _9: {closure@$DIR/gvn.rs:614:19: 614:21};
       let _10: ();
       let mut _11: fn();
-      let mut _13: {closure@$DIR/gvn.rs:615:19: 615:21};
+      let mut _13: {closure@$DIR/gvn.rs:614:19: 614:21};
       let _14: ();
       let mut _15: fn();
       scope 1 {
@@ -19,7 +19,7 @@
           let _4: fn(u8) -> u8;
           scope 2 {
               debug g => _4;
-              let _7: {closure@$DIR/gvn.rs:615:19: 615:21};
+              let _7: {closure@$DIR/gvn.rs:614:19: 614:21};
               scope 3 {
                   debug closure => _7;
                   let _8: fn();
@@ -62,16 +62,16 @@
           StorageDead(_6);
           StorageDead(_5);
 -         StorageLive(_7);
--         _7 = {closure@$DIR/gvn.rs:615:19: 615:21};
+-         _7 = {closure@$DIR/gvn.rs:614:19: 614:21};
 -         StorageLive(_8);
 +         nop;
-+         _7 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
++         _7 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21};
 +         nop;
           StorageLive(_9);
 -         _9 = _7;
 -         _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe)));
-+         _9 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
-+         _8 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe)));
++         _9 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21};
++         _8 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe)));
           StorageDead(_9);
           StorageLive(_10);
           StorageLive(_11);
@@ -88,8 +88,8 @@
           StorageLive(_13);
 -         _13 = _7;
 -         _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe)));
-+         _13 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21};
-+         _12 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe)));
++         _13 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21};
++         _12 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe)));
           StorageDead(_13);
           StorageLive(_14);
           StorageLive(_15);
diff --git a/tests/mir-opt/gvn.rs b/tests/mir-opt/gvn.rs
index 430f979fec7..4bbef9920ff 100644
--- a/tests/mir-opt/gvn.rs
+++ b/tests/mir-opt/gvn.rs
@@ -3,7 +3,6 @@
 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
 //@ only-64bit
 
-#![feature(raw_ref_op)]
 #![feature(rustc_attrs)]
 #![feature(custom_mir)]
 #![feature(core_intrinsics)]
diff --git a/tests/mir-opt/instsimplify/ref_of_deref.rs b/tests/mir-opt/instsimplify/ref_of_deref.rs
index dc0f5f8198b..72481f5579a 100644
--- a/tests/mir-opt/instsimplify/ref_of_deref.rs
+++ b/tests/mir-opt/instsimplify/ref_of_deref.rs
@@ -1,6 +1,5 @@
 //@ test-mir-pass: InstSimplify-after-simplifycfg
 #![crate_type = "lib"]
-#![feature(raw_ref_op)]
 
 // For each of these, only 2 of the 6 should simplify,
 // as the others have the wrong types.
diff --git a/tests/mir-opt/reference_prop.rs b/tests/mir-opt/reference_prop.rs
index 58d8b524ad6..7c5c02ee7ef 100644
--- a/tests/mir-opt/reference_prop.rs
+++ b/tests/mir-opt/reference_prop.rs
@@ -2,7 +2,6 @@
 //@ test-mir-pass: ReferencePropagation
 //@ needs-unwind
 
-#![feature(raw_ref_op)]
 #![feature(core_intrinsics, custom_mir)]
 
 #[inline(never)]
diff --git a/tests/pretty/raw-address-of.rs b/tests/pretty/raw-address-of.rs
index 6e97ab99407..c00a16e238a 100644
--- a/tests/pretty/raw-address-of.rs
+++ b/tests/pretty/raw-address-of.rs
@@ -1,5 +1,4 @@
 //@ pp-exact
-#![feature(raw_ref_op)]
 
 const C_PTR: () = { let a = 1; &raw const a; };
 static S_PTR: () = { let b = false; &raw const b; };
diff --git a/tests/ui/borrowck/borrow-raw-address-of-borrowed.rs b/tests/ui/borrowck/borrow-raw-address-of-borrowed.rs
index f25fd7f66b3..3ed42d07289 100644
--- a/tests/ui/borrowck/borrow-raw-address-of-borrowed.rs
+++ b/tests/ui/borrowck/borrow-raw-address-of-borrowed.rs
@@ -1,5 +1,3 @@
-#![feature(raw_ref_op)]
-
 fn address_of_shared() {
     let mut x = 0;
     let y = &x;
diff --git a/tests/ui/borrowck/borrow-raw-address-of-borrowed.stderr b/tests/ui/borrowck/borrow-raw-address-of-borrowed.stderr
index 6f7b7e08070..1a38f8c780e 100644
--- a/tests/ui/borrowck/borrow-raw-address-of-borrowed.stderr
+++ b/tests/ui/borrowck/borrow-raw-address-of-borrowed.stderr
@@ -1,5 +1,5 @@
 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
-  --> $DIR/borrow-raw-address-of-borrowed.rs:7:13
+  --> $DIR/borrow-raw-address-of-borrowed.rs:5:13
    |
 LL |     let y = &x;
    |             -- immutable borrow occurs here
@@ -11,7 +11,7 @@ LL |     drop(y);
    |          - immutable borrow later used here
 
 error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
-  --> $DIR/borrow-raw-address-of-borrowed.rs:16:13
+  --> $DIR/borrow-raw-address-of-borrowed.rs:14:13
    |
 LL |     let y = &mut x;
    |             ------ mutable borrow occurs here
@@ -23,7 +23,7 @@ LL |     drop(y);
    |          - mutable borrow later used here
 
 error[E0499]: cannot borrow `x` as mutable more than once at a time
-  --> $DIR/borrow-raw-address-of-borrowed.rs:17:13
+  --> $DIR/borrow-raw-address-of-borrowed.rs:15:13
    |
 LL |     let y = &mut x;
    |             ------ first mutable borrow occurs here
diff --git a/tests/ui/borrowck/borrow-raw-address-of-deref-mutability-ok.rs b/tests/ui/borrowck/borrow-raw-address-of-deref-mutability-ok.rs
index 0dfced34c7e..23409795227 100644
--- a/tests/ui/borrowck/borrow-raw-address-of-deref-mutability-ok.rs
+++ b/tests/ui/borrowck/borrow-raw-address-of-deref-mutability-ok.rs
@@ -1,7 +1,5 @@
 //@ check-pass
 
-#![feature(raw_ref_op)]
-
 fn raw_reborrow() {
     let x = &0;
     let y = &mut 0;
diff --git a/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.rs b/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.rs
index 712873528b5..5b3936ef5a3 100644
--- a/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.rs
+++ b/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.rs
@@ -1,7 +1,5 @@
 // Check that `&raw mut` cannot be used to turn a `&T` into a `*mut T`.
 
-#![feature(raw_ref_op)]
-
 fn raw_reborrow() {
     let x = &0;
 
diff --git a/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.stderr b/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.stderr
index cfc86ff0dc1..ac0241cf9a7 100644
--- a/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.stderr
+++ b/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.stderr
@@ -1,5 +1,5 @@
 error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
-  --> $DIR/borrow-raw-address-of-deref-mutability.rs:8:13
+  --> $DIR/borrow-raw-address-of-deref-mutability.rs:6:13
    |
 LL |     let q = &raw mut *x;
    |             ^^^^^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
@@ -10,7 +10,7 @@ LL |     let x = &mut 0;
    |              +++
 
 error[E0596]: cannot borrow `*x` as mutable, as it is behind a `*const` pointer
-  --> $DIR/borrow-raw-address-of-deref-mutability.rs:14:13
+  --> $DIR/borrow-raw-address-of-deref-mutability.rs:12:13
    |
 LL |     let q = &raw mut *x;
    |             ^^^^^^^^^^^ `x` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable
diff --git a/tests/ui/borrowck/borrow-raw-address-of-mutability-ok.rs b/tests/ui/borrowck/borrow-raw-address-of-mutability-ok.rs
index 7b0232a9d45..ed8c5502a75 100644
--- a/tests/ui/borrowck/borrow-raw-address-of-mutability-ok.rs
+++ b/tests/ui/borrowck/borrow-raw-address-of-mutability-ok.rs
@@ -1,7 +1,5 @@
 //@ check-pass
 
-#![feature(raw_ref_op)]
-
 fn mutable_address_of() {
     let mut x = 0;
     let y = &raw mut x;
diff --git a/tests/ui/borrowck/borrow-raw-address-of-mutability.rs b/tests/ui/borrowck/borrow-raw-address-of-mutability.rs
index 320c54b806a..2c5d636d096 100644
--- a/tests/ui/borrowck/borrow-raw-address-of-mutability.rs
+++ b/tests/ui/borrowck/borrow-raw-address-of-mutability.rs
@@ -1,5 +1,3 @@
-#![feature(raw_ref_op)]
-
 fn mutable_address_of() {
     let x = 0;
     let y = &raw mut x;                 //~ ERROR cannot borrow
diff --git a/tests/ui/borrowck/borrow-raw-address-of-mutability.stderr b/tests/ui/borrowck/borrow-raw-address-of-mutability.stderr
index 4b5b368287e..f81a8c99376 100644
--- a/tests/ui/borrowck/borrow-raw-address-of-mutability.stderr
+++ b/tests/ui/borrowck/borrow-raw-address-of-mutability.stderr
@@ -1,5 +1,5 @@
 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
-  --> $DIR/borrow-raw-address-of-mutability.rs:5:13
+  --> $DIR/borrow-raw-address-of-mutability.rs:3:13
    |
 LL |     let y = &raw mut x;
    |             ^^^^^^^^^^ cannot borrow as mutable
@@ -10,7 +10,7 @@ LL |     let mut x = 0;
    |         +++
 
 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
-  --> $DIR/borrow-raw-address-of-mutability.rs:11:17
+  --> $DIR/borrow-raw-address-of-mutability.rs:9:17
    |
 LL |         let y = &raw mut x;
    |                 ^^^^^^^^^^ cannot borrow as mutable
@@ -21,7 +21,7 @@ LL |     let mut x = 0;
    |         +++
 
 error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable
-  --> $DIR/borrow-raw-address-of-mutability.rs:21:5
+  --> $DIR/borrow-raw-address-of-mutability.rs:19:5
    |
 LL |         let y = &raw mut x;
    |                          - calling `f` requires mutable binding due to mutable borrow of `x`
@@ -35,7 +35,7 @@ LL |     let mut f = || {
    |         +++
 
 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
-  --> $DIR/borrow-raw-address-of-mutability.rs:29:17
+  --> $DIR/borrow-raw-address-of-mutability.rs:27:17
    |
 LL | fn make_fn<F: Fn()>(f: F) -> F { f }
    |                        - change this to accept `FnMut` instead of `Fn`
@@ -48,7 +48,7 @@ LL |         let y = &raw mut x;
    |                 ^^^^^^^^^^ cannot borrow as mutable
 
 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
-  --> $DIR/borrow-raw-address-of-mutability.rs:37:17
+  --> $DIR/borrow-raw-address-of-mutability.rs:35:17
    |
 LL | fn make_fn<F: Fn()>(f: F) -> F { f }
    |                        - change this to accept `FnMut` instead of `Fn`
diff --git a/tests/ui/consts/const-address-of-interior-mut.rs b/tests/ui/consts/const-address-of-interior-mut.rs
index 60c7c31daca..930fa0c492f 100644
--- a/tests/ui/consts/const-address-of-interior-mut.rs
+++ b/tests/ui/consts/const-address-of-interior-mut.rs
@@ -1,5 +1,3 @@
-#![feature(raw_ref_op)]
-
 use std::cell::Cell;
 
 const A: () = { let x = Cell::new(2); &raw const x; };      //~ ERROR interior mutability
diff --git a/tests/ui/consts/const-address-of-interior-mut.stderr b/tests/ui/consts/const-address-of-interior-mut.stderr
index 12c8917d740..203745f0b01 100644
--- a/tests/ui/consts/const-address-of-interior-mut.stderr
+++ b/tests/ui/consts/const-address-of-interior-mut.stderr
@@ -1,5 +1,5 @@
 error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability
-  --> $DIR/const-address-of-interior-mut.rs:5:39
+  --> $DIR/const-address-of-interior-mut.rs:3:39
    |
 LL | const A: () = { let x = Cell::new(2); &raw const x; };
    |                                       ^^^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | const A: () = { let x = Cell::new(2); &raw const x; };
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability
-  --> $DIR/const-address-of-interior-mut.rs:7:40
+  --> $DIR/const-address-of-interior-mut.rs:5:40
    |
 LL | static B: () = { let x = Cell::new(2); &raw const x; };
    |                                        ^^^^^^^^^^^^
@@ -19,7 +19,7 @@ LL | static B: () = { let x = Cell::new(2); &raw const x; };
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability
-  --> $DIR/const-address-of-interior-mut.rs:9:44
+  --> $DIR/const-address-of-interior-mut.rs:7:44
    |
 LL | static mut C: () = { let x = Cell::new(2); &raw const x; };
    |                                            ^^^^^^^^^^^^
@@ -29,7 +29,7 @@ LL | static mut C: () = { let x = Cell::new(2); &raw const x; };
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability
-  --> $DIR/const-address-of-interior-mut.rs:13:13
+  --> $DIR/const-address-of-interior-mut.rs:11:13
    |
 LL |     let y = &raw const x;
    |             ^^^^^^^^^^^^
diff --git a/tests/ui/consts/const-address-of-mut.rs b/tests/ui/consts/const-address-of-mut.rs
index 0018bf18e41..c3f37843d3c 100644
--- a/tests/ui/consts/const-address-of-mut.rs
+++ b/tests/ui/consts/const-address-of-mut.rs
@@ -1,5 +1,3 @@
-#![feature(raw_ref_op)]
-
 const A: () = { let mut x = 2; &raw mut x; };           //~ mutable pointer
 
 static B: () = { let mut x = 2; &raw mut x; };          //~ mutable pointer
diff --git a/tests/ui/consts/const-address-of-mut.stderr b/tests/ui/consts/const-address-of-mut.stderr
index 95a91ff463f..d4243485de1 100644
--- a/tests/ui/consts/const-address-of-mut.stderr
+++ b/tests/ui/consts/const-address-of-mut.stderr
@@ -1,5 +1,5 @@
 error[E0658]: raw mutable pointers are not allowed in constants
-  --> $DIR/const-address-of-mut.rs:3:32
+  --> $DIR/const-address-of-mut.rs:1:32
    |
 LL | const A: () = { let mut x = 2; &raw mut x; };
    |                                ^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | const A: () = { let mut x = 2; &raw mut x; };
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: raw mutable pointers are not allowed in statics
-  --> $DIR/const-address-of-mut.rs:5:33
+  --> $DIR/const-address-of-mut.rs:3:33
    |
 LL | static B: () = { let mut x = 2; &raw mut x; };
    |                                 ^^^^^^^^^^
@@ -19,7 +19,7 @@ LL | static B: () = { let mut x = 2; &raw mut x; };
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: raw mutable pointers are not allowed in constant functions
-  --> $DIR/const-address-of-mut.rs:9:13
+  --> $DIR/const-address-of-mut.rs:7:13
    |
 LL |     let y = &raw mut x;
    |             ^^^^^^^^^^
diff --git a/tests/ui/consts/const-address-of.rs b/tests/ui/consts/const-address-of.rs
index 4eb3c3840ba..39ed430e17e 100644
--- a/tests/ui/consts/const-address-of.rs
+++ b/tests/ui/consts/const-address-of.rs
@@ -1,7 +1,5 @@
 //@ check-pass
 
-#![feature(raw_ref_op)]
-
 const A: *const i32 = &raw const *&2;
 static B: () = { &raw const *&2; };
 static mut C: *const i32 = &raw const *&2;
diff --git a/tests/ui/consts/const-mut-refs/const_mut_address_of.rs b/tests/ui/consts/const-mut-refs/const_mut_address_of.rs
index 66a4ec50c11..437bdc88722 100644
--- a/tests/ui/consts/const-mut-refs/const_mut_address_of.rs
+++ b/tests/ui/consts/const-mut-refs/const_mut_address_of.rs
@@ -1,6 +1,5 @@
 //@ check-pass
 #![feature(const_mut_refs)]
-#![feature(raw_ref_op)]
 
 struct Foo {
     x: usize
diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs b/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs
index 93197d5bce4..10339ee6798 100644
--- a/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs
+++ b/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs
@@ -1,5 +1,4 @@
 #![feature(const_mut_refs)]
-#![feature(raw_ref_op)]
 
 const NULL: *mut i32 = std::ptr::null_mut();
 const A: *const i32 = &4;
diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final.stderr b/tests/ui/consts/const-mut-refs/mut_ref_in_final.stderr
index 59e6aa4011c..00a8421076b 100644
--- a/tests/ui/consts/const-mut-refs/mut_ref_in_final.stderr
+++ b/tests/ui/consts/const-mut-refs/mut_ref_in_final.stderr
@@ -1,11 +1,11 @@
 error[E0764]: mutable references are not allowed in the final value of constants
-  --> $DIR/mut_ref_in_final.rs:10:21
+  --> $DIR/mut_ref_in_final.rs:9:21
    |
 LL | const B: *mut i32 = &mut 4;
    |                     ^^^^^^
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/mut_ref_in_final.rs:16:40
+  --> $DIR/mut_ref_in_final.rs:15:40
    |
 LL | const B3: Option<&mut i32> = Some(&mut 42);
    |                              ----------^^-
@@ -15,7 +15,7 @@ LL | const B3: Option<&mut i32> = Some(&mut 42);
    |                              using this value as a constant requires that borrow lasts for `'static`
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/mut_ref_in_final.rs:19:42
+  --> $DIR/mut_ref_in_final.rs:18:42
    |
 LL | const B4: Option<&mut i32> = helper(&mut 42);
    |                              ------------^^-
@@ -25,7 +25,7 @@ LL | const B4: Option<&mut i32> = helper(&mut 42);
    |                              using this value as a constant requires that borrow lasts for `'static`
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/mut_ref_in_final.rs:34:65
+  --> $DIR/mut_ref_in_final.rs:33:65
    |
 LL | const FOO: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
    |                                  -------------------------------^^--
@@ -35,7 +35,7 @@ LL | const FOO: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
    |                                  using this value as a constant requires that borrow lasts for `'static`
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/mut_ref_in_final.rs:37:67
+  --> $DIR/mut_ref_in_final.rs:36:67
    |
 LL | static FOO2: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
    |                                    -------------------------------^^--
@@ -45,7 +45,7 @@ LL | static FOO2: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
    |                                    using this value as a static requires that borrow lasts for `'static`
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/mut_ref_in_final.rs:40:71
+  --> $DIR/mut_ref_in_final.rs:39:71
    |
 LL | static mut FOO3: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
    |                                        -------------------------------^^--
@@ -55,25 +55,25 @@ LL | static mut FOO3: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
    |                                        using this value as a static requires that borrow lasts for `'static`
 
 error[E0764]: mutable references are not allowed in the final value of statics
-  --> $DIR/mut_ref_in_final.rs:53:53
+  --> $DIR/mut_ref_in_final.rs:52:53
    |
 LL | static RAW_MUT_CAST_S: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
    |                                                     ^^^^^^^
 
 error[E0764]: mutable references are not allowed in the final value of statics
-  --> $DIR/mut_ref_in_final.rs:55:54
+  --> $DIR/mut_ref_in_final.rs:54:54
    |
 LL | static RAW_MUT_COERCE_S: SyncPtr<i32> = SyncPtr { x: &mut 0 };
    |                                                      ^^^^^^
 
 error[E0764]: mutable references are not allowed in the final value of constants
-  --> $DIR/mut_ref_in_final.rs:57:52
+  --> $DIR/mut_ref_in_final.rs:56:52
    |
 LL | const RAW_MUT_CAST_C: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
    |                                                    ^^^^^^^
 
 error[E0764]: mutable references are not allowed in the final value of constants
-  --> $DIR/mut_ref_in_final.rs:59:53
+  --> $DIR/mut_ref_in_final.rs:58:53
    |
 LL | const RAW_MUT_COERCE_C: SyncPtr<i32> = SyncPtr { x: &mut 0 };
    |                                                     ^^^^^^
diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs
index c12c22447b5..e208845e747 100644
--- a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs
+++ b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs
@@ -2,7 +2,6 @@
 //@ normalize-stderr-test: "( 0x[0-9a-f][0-9a-f] │)? ([0-9a-f][0-9a-f] |__ |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> " HEX_DUMP"
 //@ normalize-stderr-test: "HEX_DUMP\s*\n\s*HEX_DUMP" -> "HEX_DUMP"
 #![feature(const_mut_refs, const_refs_to_static)]
-#![feature(raw_ref_op)]
 
 use std::sync::Mutex;
 
diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr
index ea9dccf0173..4ea6fa62475 100644
--- a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr
+++ b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mut_ref_in_final_dynamic_check.rs:20:1
+  --> $DIR/mut_ref_in_final_dynamic_check.rs:19:1
    |
 LL | const MUT: Option<&mut i32> = helper();
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered reference to mutable memory in `const`
@@ -10,7 +10,7 @@ LL | const MUT: Option<&mut i32> = helper();
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mut_ref_in_final_dynamic_check.rs:27:1
+  --> $DIR/mut_ref_in_final_dynamic_check.rs:26:1
    |
 LL | const INT2PTR: Option<&mut i32> = helper_int2ptr();
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (0x2a[noalloc] has no provenance)
@@ -21,7 +21,7 @@ LL | const INT2PTR: Option<&mut i32> = helper_int2ptr();
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mut_ref_in_final_dynamic_check.rs:29:1
+  --> $DIR/mut_ref_in_final_dynamic_check.rs:28:1
    |
 LL | static INT2PTR_STATIC: Option<&mut i32> = helper_int2ptr();
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (0x2a[noalloc] has no provenance)
@@ -32,7 +32,7 @@ LL | static INT2PTR_STATIC: Option<&mut i32> = helper_int2ptr();
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mut_ref_in_final_dynamic_check.rs:36:1
+  --> $DIR/mut_ref_in_final_dynamic_check.rs:35:1
    |
 LL | const DANGLING: Option<&mut i32> = helper_dangling();
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (use-after-free)
@@ -43,7 +43,7 @@ LL | const DANGLING: Option<&mut i32> = helper_dangling();
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mut_ref_in_final_dynamic_check.rs:37:1
+  --> $DIR/mut_ref_in_final_dynamic_check.rs:36:1
    |
 LL | static DANGLING_STATIC: Option<&mut i32> = helper_dangling();
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (use-after-free)
diff --git a/tests/ui/consts/min_const_fn/address_of.rs b/tests/ui/consts/min_const_fn/address_of.rs
index aa75423ca4d..dc481e17ba3 100644
--- a/tests/ui/consts/min_const_fn/address_of.rs
+++ b/tests/ui/consts/min_const_fn/address_of.rs
@@ -1,5 +1,3 @@
-#![feature(raw_ref_op)]
-
 const fn mutable_address_of_in_const() {
     let mut a = 0;
     let b = &raw mut a;         //~ ERROR mutable pointer
diff --git a/tests/ui/consts/min_const_fn/address_of.stderr b/tests/ui/consts/min_const_fn/address_of.stderr
index 143760c0943..dd6fe6486d4 100644
--- a/tests/ui/consts/min_const_fn/address_of.stderr
+++ b/tests/ui/consts/min_const_fn/address_of.stderr
@@ -1,5 +1,5 @@
 error[E0658]: raw mutable pointers are not allowed in constant functions
-  --> $DIR/address_of.rs:5:13
+  --> $DIR/address_of.rs:3:13
    |
 LL |     let b = &raw mut a;
    |             ^^^^^^^^^^
@@ -9,7 +9,7 @@ LL |     let b = &raw mut a;
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: raw mutable pointers are not allowed in constant functions
-  --> $DIR/address_of.rs:13:17
+  --> $DIR/address_of.rs:11:17
    |
 LL |         let b = &raw mut a;
    |                 ^^^^^^^^^^
diff --git a/tests/ui/consts/min_const_fn/address_of_const.rs b/tests/ui/consts/min_const_fn/address_of_const.rs
index 4280d0745c1..1520622679f 100644
--- a/tests/ui/consts/min_const_fn/address_of_const.rs
+++ b/tests/ui/consts/min_const_fn/address_of_const.rs
@@ -1,7 +1,5 @@
 //@ check-pass
 
-#![feature(raw_ref_op)]
-
 const fn const_address_of_in_const() {
     let mut a = 0;
     let b = &raw const a;
diff --git a/tests/ui/consts/qualif-indirect-mutation-fail.rs b/tests/ui/consts/qualif-indirect-mutation-fail.rs
index 420e32128a4..a99d0633ba1 100644
--- a/tests/ui/consts/qualif-indirect-mutation-fail.rs
+++ b/tests/ui/consts/qualif-indirect-mutation-fail.rs
@@ -2,7 +2,6 @@
 #![feature(const_mut_refs)]
 #![feature(const_precise_live_drops)]
 #![feature(const_swap)]
-#![feature(raw_ref_op)]
 
 // Mutable borrow of a field with drop impl.
 pub const fn f() {
diff --git a/tests/ui/consts/qualif-indirect-mutation-fail.stderr b/tests/ui/consts/qualif-indirect-mutation-fail.stderr
index 458dc2071c4..21c872ed13f 100644
--- a/tests/ui/consts/qualif-indirect-mutation-fail.stderr
+++ b/tests/ui/consts/qualif-indirect-mutation-fail.stderr
@@ -1,5 +1,5 @@
 error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time
-  --> $DIR/qualif-indirect-mutation-fail.rs:15:9
+  --> $DIR/qualif-indirect-mutation-fail.rs:14:9
    |
 LL |     let mut x = None;
    |         ^^^^^ the destructor for this type cannot be evaluated in constants
@@ -16,13 +16,13 @@ note: inside `std::ptr::drop_in_place::<String> - shim(Some(String))`
 note: inside `std::ptr::drop_in_place::<Option<String>> - shim(Some(Option<String>))`
   --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
 note: inside `A1`
-  --> $DIR/qualif-indirect-mutation-fail.rs:21:1
+  --> $DIR/qualif-indirect-mutation-fail.rs:20:1
    |
 LL | };
    | ^
 
 error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time
-  --> $DIR/qualif-indirect-mutation-fail.rs:31:9
+  --> $DIR/qualif-indirect-mutation-fail.rs:30:9
    |
 LL |     let _z = x;
    |         ^^ the destructor for this type cannot be evaluated in constants
@@ -39,49 +39,49 @@ note: inside `std::ptr::drop_in_place::<String> - shim(Some(String))`
 note: inside `std::ptr::drop_in_place::<Option<String>> - shim(Some(Option<String>))`
   --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
 note: inside `A2`
-  --> $DIR/qualif-indirect-mutation-fail.rs:32:1
+  --> $DIR/qualif-indirect-mutation-fail.rs:31:1
    |
 LL | };
    | ^
 
 error[E0493]: destructor of `(u32, Option<String>)` cannot be evaluated at compile-time
-  --> $DIR/qualif-indirect-mutation-fail.rs:9:9
+  --> $DIR/qualif-indirect-mutation-fail.rs:8:9
    |
 LL |     let mut a: (u32, Option<String>) = (0, None);
    |         ^^^^^ the destructor for this type cannot be evaluated in constant functions
 
 error[E0493]: destructor of `Option<T>` cannot be evaluated at compile-time
-  --> $DIR/qualif-indirect-mutation-fail.rs:36:9
+  --> $DIR/qualif-indirect-mutation-fail.rs:35:9
    |
 LL |     let x: Option<T> = None;
    |         ^ the destructor for this type cannot be evaluated in constant functions
 
 error[E0493]: destructor of `Option<T>` cannot be evaluated at compile-time
-  --> $DIR/qualif-indirect-mutation-fail.rs:44:9
+  --> $DIR/qualif-indirect-mutation-fail.rs:43:9
    |
 LL |     let _y = x;
    |         ^^ the destructor for this type cannot be evaluated in constant functions
 
 error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time
-  --> $DIR/qualif-indirect-mutation-fail.rs:52:9
+  --> $DIR/qualif-indirect-mutation-fail.rs:51:9
    |
 LL |     let mut y: Option<String> = None;
    |         ^^^^^ the destructor for this type cannot be evaluated in constant functions
 
 error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time
-  --> $DIR/qualif-indirect-mutation-fail.rs:49:9
+  --> $DIR/qualif-indirect-mutation-fail.rs:48:9
    |
 LL |     let mut x: Option<String> = None;
    |         ^^^^^ the destructor for this type cannot be evaluated in constant functions
 
 error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time
-  --> $DIR/qualif-indirect-mutation-fail.rs:62:9
+  --> $DIR/qualif-indirect-mutation-fail.rs:61:9
    |
 LL |     let y: Option<String> = None;
    |         ^ the destructor for this type cannot be evaluated in constant functions
 
 error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time
-  --> $DIR/qualif-indirect-mutation-fail.rs:59:9
+  --> $DIR/qualif-indirect-mutation-fail.rs:58:9
    |
 LL |     let x: Option<String> = None;
    |         ^ the destructor for this type cannot be evaluated in constant functions
diff --git a/tests/ui/lint/lint-unnecessary-parens.fixed b/tests/ui/lint/lint-unnecessary-parens.fixed
index 089aa1b7ab7..a8c8dd1d512 100644
--- a/tests/ui/lint/lint-unnecessary-parens.fixed
+++ b/tests/ui/lint/lint-unnecessary-parens.fixed
@@ -1,7 +1,6 @@
 //@ run-rustfix
 
 #![deny(unused_parens)]
-#![feature(raw_ref_op)]
 #![allow(while_true)] // for rustfix
 
 #[derive(Eq, PartialEq)]
diff --git a/tests/ui/lint/lint-unnecessary-parens.rs b/tests/ui/lint/lint-unnecessary-parens.rs
index dc77ee00352..02aa78283c7 100644
--- a/tests/ui/lint/lint-unnecessary-parens.rs
+++ b/tests/ui/lint/lint-unnecessary-parens.rs
@@ -1,7 +1,6 @@
 //@ run-rustfix
 
 #![deny(unused_parens)]
-#![feature(raw_ref_op)]
 #![allow(while_true)] // for rustfix
 
 #[derive(Eq, PartialEq)]
diff --git a/tests/ui/lint/lint-unnecessary-parens.stderr b/tests/ui/lint/lint-unnecessary-parens.stderr
index c9422437a9f..f2e5debd6e0 100644
--- a/tests/ui/lint/lint-unnecessary-parens.stderr
+++ b/tests/ui/lint/lint-unnecessary-parens.stderr
@@ -1,5 +1,5 @@
 error: unnecessary parentheses around `return` value
-  --> $DIR/lint-unnecessary-parens.rs:14:12
+  --> $DIR/lint-unnecessary-parens.rs:13:12
    |
 LL |     return (1);
    |            ^ ^
@@ -16,7 +16,7 @@ LL +     return 1;
    |
 
 error: unnecessary parentheses around `return` value
-  --> $DIR/lint-unnecessary-parens.rs:17:12
+  --> $DIR/lint-unnecessary-parens.rs:16:12
    |
 LL |     return (X { y });
    |            ^       ^
@@ -28,7 +28,7 @@ LL +     return X { y };
    |
 
 error: unnecessary parentheses around type
-  --> $DIR/lint-unnecessary-parens.rs:20:46
+  --> $DIR/lint-unnecessary-parens.rs:19:46
    |
 LL | pub fn unused_parens_around_return_type() -> (u32) {
    |                                              ^   ^
@@ -40,7 +40,7 @@ LL + pub fn unused_parens_around_return_type() -> u32 {
    |
 
 error: unnecessary parentheses around block return value
-  --> $DIR/lint-unnecessary-parens.rs:26:9
+  --> $DIR/lint-unnecessary-parens.rs:25:9
    |
 LL |         (5)
    |         ^ ^
@@ -52,7 +52,7 @@ LL +         5
    |
 
 error: unnecessary parentheses around block return value
-  --> $DIR/lint-unnecessary-parens.rs:28:5
+  --> $DIR/lint-unnecessary-parens.rs:27:5
    |
 LL |     (5)
    |     ^ ^
@@ -64,7 +64,7 @@ LL +     5
    |
 
 error: unnecessary parentheses around `if` condition
-  --> $DIR/lint-unnecessary-parens.rs:40:7
+  --> $DIR/lint-unnecessary-parens.rs:39:7
    |
 LL |     if(true) {}
    |       ^    ^
@@ -76,7 +76,7 @@ LL +     if true {}
    |
 
 error: unnecessary parentheses around `while` condition
-  --> $DIR/lint-unnecessary-parens.rs:41:10
+  --> $DIR/lint-unnecessary-parens.rs:40:10
    |
 LL |     while(true) {}
    |          ^    ^
@@ -88,7 +88,7 @@ LL +     while true {}
    |
 
 error: unnecessary parentheses around `for` iterator expression
-  --> $DIR/lint-unnecessary-parens.rs:42:13
+  --> $DIR/lint-unnecessary-parens.rs:41:13
    |
 LL |     for _ in(e) {}
    |             ^ ^
@@ -100,7 +100,7 @@ LL +     for _ in e {}
    |
 
 error: unnecessary parentheses around `match` scrutinee expression
-  --> $DIR/lint-unnecessary-parens.rs:43:10
+  --> $DIR/lint-unnecessary-parens.rs:42:10
    |
 LL |     match(1) { _ => ()}
    |          ^ ^
@@ -112,7 +112,7 @@ LL +     match 1 { _ => ()}
    |
 
 error: unnecessary parentheses around `return` value
-  --> $DIR/lint-unnecessary-parens.rs:44:11
+  --> $DIR/lint-unnecessary-parens.rs:43:11
    |
 LL |     return(1);
    |           ^ ^
@@ -124,7 +124,7 @@ LL +     return 1;
    |
 
 error: unnecessary parentheses around assigned value
-  --> $DIR/lint-unnecessary-parens.rs:75:31
+  --> $DIR/lint-unnecessary-parens.rs:74:31
    |
 LL | pub const CONST_ITEM: usize = (10);
    |                               ^  ^
@@ -136,7 +136,7 @@ LL + pub const CONST_ITEM: usize = 10;
    |
 
 error: unnecessary parentheses around assigned value
-  --> $DIR/lint-unnecessary-parens.rs:76:33
+  --> $DIR/lint-unnecessary-parens.rs:75:33
    |
 LL | pub static STATIC_ITEM: usize = (10);
    |                                 ^  ^
@@ -148,7 +148,7 @@ LL + pub static STATIC_ITEM: usize = 10;
    |
 
 error: unnecessary parentheses around function argument
-  --> $DIR/lint-unnecessary-parens.rs:80:9
+  --> $DIR/lint-unnecessary-parens.rs:79:9
    |
 LL |     bar((true));
    |         ^    ^
@@ -160,7 +160,7 @@ LL +     bar(true);
    |
 
 error: unnecessary parentheses around `if` condition
-  --> $DIR/lint-unnecessary-parens.rs:82:8
+  --> $DIR/lint-unnecessary-parens.rs:81:8
    |
 LL |     if (true) {}
    |        ^    ^
@@ -172,7 +172,7 @@ LL +     if true {}
    |
 
 error: unnecessary parentheses around `while` condition
-  --> $DIR/lint-unnecessary-parens.rs:83:11
+  --> $DIR/lint-unnecessary-parens.rs:82:11
    |
 LL |     while (true) {}
    |           ^    ^
@@ -184,7 +184,7 @@ LL +     while true {}
    |
 
 error: unnecessary parentheses around `match` scrutinee expression
-  --> $DIR/lint-unnecessary-parens.rs:84:11
+  --> $DIR/lint-unnecessary-parens.rs:83:11
    |
 LL |     match (true) {
    |           ^    ^
@@ -196,7 +196,7 @@ LL +     match true {
    |
 
 error: unnecessary parentheses around `let` scrutinee expression
-  --> $DIR/lint-unnecessary-parens.rs:87:16
+  --> $DIR/lint-unnecessary-parens.rs:86:16
    |
 LL |     if let 1 = (1) {}
    |                ^ ^
@@ -208,7 +208,7 @@ LL +     if let 1 = 1 {}
    |
 
 error: unnecessary parentheses around `let` scrutinee expression
-  --> $DIR/lint-unnecessary-parens.rs:88:19
+  --> $DIR/lint-unnecessary-parens.rs:87:19
    |
 LL |     while let 1 = (2) {}
    |                   ^ ^
@@ -220,7 +220,7 @@ LL +     while let 1 = 2 {}
    |
 
 error: unnecessary parentheses around method argument
-  --> $DIR/lint-unnecessary-parens.rs:104:24
+  --> $DIR/lint-unnecessary-parens.rs:103:24
    |
 LL |     X { y: false }.foo((true));
    |                        ^    ^
@@ -232,7 +232,7 @@ LL +     X { y: false }.foo(true);
    |
 
 error: unnecessary parentheses around assigned value
-  --> $DIR/lint-unnecessary-parens.rs:106:18
+  --> $DIR/lint-unnecessary-parens.rs:105:18
    |
 LL |     let mut _a = (0);
    |                  ^ ^
@@ -244,7 +244,7 @@ LL +     let mut _a = 0;
    |
 
 error: unnecessary parentheses around assigned value
-  --> $DIR/lint-unnecessary-parens.rs:107:10
+  --> $DIR/lint-unnecessary-parens.rs:106:10
    |
 LL |     _a = (0);
    |          ^ ^
@@ -256,7 +256,7 @@ LL +     _a = 0;
    |
 
 error: unnecessary parentheses around assigned value
-  --> $DIR/lint-unnecessary-parens.rs:108:11
+  --> $DIR/lint-unnecessary-parens.rs:107:11
    |
 LL |     _a += (1);
    |           ^ ^
@@ -268,7 +268,7 @@ LL +     _a += 1;
    |
 
 error: unnecessary parentheses around pattern
-  --> $DIR/lint-unnecessary-parens.rs:110:8
+  --> $DIR/lint-unnecessary-parens.rs:109:8
    |
 LL |     let(mut _a) = 3;
    |        ^      ^
@@ -280,7 +280,7 @@ LL +     let mut _a = 3;
    |
 
 error: unnecessary parentheses around pattern
-  --> $DIR/lint-unnecessary-parens.rs:111:9
+  --> $DIR/lint-unnecessary-parens.rs:110:9
    |
 LL |     let (mut _a) = 3;
    |         ^      ^
@@ -292,7 +292,7 @@ LL +     let mut _a = 3;
    |
 
 error: unnecessary parentheses around pattern
-  --> $DIR/lint-unnecessary-parens.rs:112:8
+  --> $DIR/lint-unnecessary-parens.rs:111:8
    |
 LL |     let( mut _a) = 3;
    |        ^^      ^
@@ -304,7 +304,7 @@ LL +     let mut _a = 3;
    |
 
 error: unnecessary parentheses around pattern
-  --> $DIR/lint-unnecessary-parens.rs:114:8
+  --> $DIR/lint-unnecessary-parens.rs:113:8
    |
 LL |     let(_a) = 3;
    |        ^  ^
@@ -316,7 +316,7 @@ LL +     let _a = 3;
    |
 
 error: unnecessary parentheses around pattern
-  --> $DIR/lint-unnecessary-parens.rs:115:9
+  --> $DIR/lint-unnecessary-parens.rs:114:9
    |
 LL |     let (_a) = 3;
    |         ^  ^
@@ -328,7 +328,7 @@ LL +     let _a = 3;
    |
 
 error: unnecessary parentheses around pattern
-  --> $DIR/lint-unnecessary-parens.rs:116:8
+  --> $DIR/lint-unnecessary-parens.rs:115:8
    |
 LL |     let( _a) = 3;
    |        ^^  ^
@@ -340,7 +340,7 @@ LL +     let _a = 3;
    |
 
 error: unnecessary parentheses around block return value
-  --> $DIR/lint-unnecessary-parens.rs:122:9
+  --> $DIR/lint-unnecessary-parens.rs:121:9
    |
 LL |         (unit!() - One)
    |         ^             ^
@@ -352,7 +352,7 @@ LL +         unit!() - One
    |
 
 error: unnecessary parentheses around block return value
-  --> $DIR/lint-unnecessary-parens.rs:124:9
+  --> $DIR/lint-unnecessary-parens.rs:123:9
    |
 LL |         (unit![] - One)
    |         ^             ^
@@ -364,7 +364,7 @@ LL +         unit![] - One
    |
 
 error: unnecessary parentheses around block return value
-  --> $DIR/lint-unnecessary-parens.rs:127:9
+  --> $DIR/lint-unnecessary-parens.rs:126:9
    |
 LL |         (unit! {} - One)
    |         ^              ^
@@ -376,7 +376,7 @@ LL +         unit! {} - One
    |
 
 error: unnecessary parentheses around assigned value
-  --> $DIR/lint-unnecessary-parens.rs:132:14
+  --> $DIR/lint-unnecessary-parens.rs:131:14
    |
 LL |     let _r = (&x);
    |              ^  ^
@@ -388,7 +388,7 @@ LL +     let _r = &x;
    |
 
 error: unnecessary parentheses around assigned value
-  --> $DIR/lint-unnecessary-parens.rs:133:14
+  --> $DIR/lint-unnecessary-parens.rs:132:14
    |
 LL |     let _r = (&mut x);
    |              ^      ^
diff --git a/tests/ui/lint/unused/lint-unused-mut-variables.rs b/tests/ui/lint/unused/lint-unused-mut-variables.rs
index f0c7dff666e..bc38af9867c 100644
--- a/tests/ui/lint/unused/lint-unused-mut-variables.rs
+++ b/tests/ui/lint/unused/lint-unused-mut-variables.rs
@@ -3,7 +3,7 @@
 // Exercise the unused_mut attribute in some positive and negative cases
 
 #![warn(unused_mut)]
-#![feature(async_closure, raw_ref_op)]
+#![feature(async_closure)]
 
 async fn baz_async(
     mut a: i32,
diff --git a/tests/ui/macros/stringify.rs b/tests/ui/macros/stringify.rs
index 37409dd066d..f405cd253de 100644
--- a/tests/ui/macros/stringify.rs
+++ b/tests/ui/macros/stringify.rs
@@ -14,7 +14,6 @@
 #![feature(let_chains)]
 #![feature(more_qualified_paths)]
 #![feature(never_patterns)]
-#![feature(raw_ref_op)]
 #![feature(trait_alias)]
 #![feature(try_blocks)]
 #![feature(type_ascription)]
diff --git a/tests/ui/mir/mir_raw_fat_ptr.rs b/tests/ui/mir/mir_raw_fat_ptr.rs
index a5a48587e3b..96c030b70e5 100644
--- a/tests/ui/mir/mir_raw_fat_ptr.rs
+++ b/tests/ui/mir/mir_raw_fat_ptr.rs
@@ -2,7 +2,6 @@
 // check raw fat pointer ops in mir
 // FIXME: please improve this when we get monomorphization support
 
-#![feature(raw_ref_op)]
 #![allow(ambiguous_wide_pointer_comparisons)]
 
 use std::mem;
diff --git a/tests/ui/mir/mir_raw_fat_ptr.stderr b/tests/ui/mir/mir_raw_fat_ptr.stderr
index a9e9dd66ebd..cd99d566654 100644
--- a/tests/ui/mir/mir_raw_fat_ptr.stderr
+++ b/tests/ui/mir/mir_raw_fat_ptr.stderr
@@ -1,5 +1,5 @@
 warning: method `foo` is never used
-  --> $DIR/mir_raw_fat_ptr.rs:101:16
+  --> $DIR/mir_raw_fat_ptr.rs:100:16
    |
 LL | trait Foo { fn foo(&self) -> usize; }
    |       ---      ^^^
diff --git a/tests/ui/packed/packed-struct-address-of-element.rs b/tests/ui/packed/packed-struct-address-of-element.rs
index 3fc27d4a96a..5d7c0b3d8b1 100644
--- a/tests/ui/packed/packed-struct-address-of-element.rs
+++ b/tests/ui/packed/packed-struct-address-of-element.rs
@@ -1,6 +1,5 @@
 //@ run-pass
 #![allow(dead_code)]
-#![feature(raw_ref_op)]
 //@ ignore-emscripten weird assertion?
 
 #[repr(packed)]
diff --git a/tests/ui/raw-ref-op/feature-raw-ref-op.rs b/tests/ui/raw-ref-op/feature-raw-ref-op.rs
deleted file mode 100644
index 0a44b1cde40..00000000000
--- a/tests/ui/raw-ref-op/feature-raw-ref-op.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-// gate-test-raw_ref_op
-
-macro_rules! is_expr {
-    ($e:expr) => {}
-}
-
-is_expr!(&raw const a);         //~ ERROR raw address of syntax is experimental
-is_expr!(&raw mut a);           //~ ERROR raw address of syntax is experimental
-
-#[cfg(FALSE)]
-fn cfgd_out() {
-    let mut a = 0;
-    &raw const a;               //~ ERROR raw address of syntax is experimental
-    &raw mut a;                 //~ ERROR raw address of syntax is experimental
-}
-
-fn main() {
-    let mut y = 123;
-    let x = &raw const y;       //~ ERROR raw address of syntax is experimental
-    let x = &raw mut y;         //~ ERROR raw address of syntax is experimental
-}
diff --git a/tests/ui/raw-ref-op/feature-raw-ref-op.stderr b/tests/ui/raw-ref-op/feature-raw-ref-op.stderr
deleted file mode 100644
index 4ffd0c90e48..00000000000
--- a/tests/ui/raw-ref-op/feature-raw-ref-op.stderr
+++ /dev/null
@@ -1,63 +0,0 @@
-error[E0658]: raw address of syntax is experimental
-  --> $DIR/feature-raw-ref-op.rs:13:5
-   |
-LL |     &raw const a;
-   |     ^^^^^^^^^^
-   |
-   = note: see issue #64490 <https://github.com/rust-lang/rust/issues/64490> for more information
-   = help: add `#![feature(raw_ref_op)]` to the crate attributes to enable
-   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
-
-error[E0658]: raw address of syntax is experimental
-  --> $DIR/feature-raw-ref-op.rs:14:5
-   |
-LL |     &raw mut a;
-   |     ^^^^^^^^
-   |
-   = note: see issue #64490 <https://github.com/rust-lang/rust/issues/64490> for more information
-   = help: add `#![feature(raw_ref_op)]` to the crate attributes to enable
-   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
-
-error[E0658]: raw address of syntax is experimental
-  --> $DIR/feature-raw-ref-op.rs:19:13
-   |
-LL |     let x = &raw const y;
-   |             ^^^^^^^^^^
-   |
-   = note: see issue #64490 <https://github.com/rust-lang/rust/issues/64490> for more information
-   = help: add `#![feature(raw_ref_op)]` to the crate attributes to enable
-   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
-
-error[E0658]: raw address of syntax is experimental
-  --> $DIR/feature-raw-ref-op.rs:20:13
-   |
-LL |     let x = &raw mut y;
-   |             ^^^^^^^^
-   |
-   = note: see issue #64490 <https://github.com/rust-lang/rust/issues/64490> for more information
-   = help: add `#![feature(raw_ref_op)]` to the crate attributes to enable
-   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
-
-error[E0658]: raw address of syntax is experimental
-  --> $DIR/feature-raw-ref-op.rs:7:10
-   |
-LL | is_expr!(&raw const a);
-   |          ^^^^^^^^^^
-   |
-   = note: see issue #64490 <https://github.com/rust-lang/rust/issues/64490> for more information
-   = help: add `#![feature(raw_ref_op)]` to the crate attributes to enable
-   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
-
-error[E0658]: raw address of syntax is experimental
-  --> $DIR/feature-raw-ref-op.rs:8:10
-   |
-LL | is_expr!(&raw mut a);
-   |          ^^^^^^^^
-   |
-   = note: see issue #64490 <https://github.com/rust-lang/rust/issues/64490> for more information
-   = help: add `#![feature(raw_ref_op)]` to the crate attributes to enable
-   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
-
-error: aborting due to 6 previous errors
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/raw-ref-op/raw-ref-op.rs b/tests/ui/raw-ref-op/raw-ref-op.rs
index 70b7a5a4806..0989a6005dc 100644
--- a/tests/ui/raw-ref-op/raw-ref-op.rs
+++ b/tests/ui/raw-ref-op/raw-ref-op.rs
@@ -1,7 +1,5 @@
 //@ run-pass
 
-#![feature(raw_ref_op)]
-
 fn main() {
     let mut x = 123;
     let c_p = &raw const x;
diff --git a/tests/ui/raw-ref-op/raw-ref-temp-deref.rs b/tests/ui/raw-ref-op/raw-ref-temp-deref.rs
index 5270bdb7a2b..a0078bbc1cd 100644
--- a/tests/ui/raw-ref-op/raw-ref-temp-deref.rs
+++ b/tests/ui/raw-ref-op/raw-ref-temp-deref.rs
@@ -1,7 +1,7 @@
 //@ check-pass
 // Check that taking the address of a place that contains a dereference is
 // allowed.
-#![feature(raw_ref_op, type_ascription)]
+#![feature(type_ascription)]
 
 const PAIR_REF: &(i32, i64) = &(1, 2);
 
diff --git a/tests/ui/raw-ref-op/raw-ref-temp.rs b/tests/ui/raw-ref-op/raw-ref-temp.rs
index 10e47cb34c5..70f67602af2 100644
--- a/tests/ui/raw-ref-op/raw-ref-temp.rs
+++ b/tests/ui/raw-ref-op/raw-ref-temp.rs
@@ -1,5 +1,5 @@
 // Ensure that we don't allow taking the address of temporary values
-#![feature(raw_ref_op, type_ascription)]
+#![feature(type_ascription)]
 
 const FOUR: u64 = 4;
 
diff --git a/tests/ui/raw-ref-op/unusual_locations.rs b/tests/ui/raw-ref-op/unusual_locations.rs
index badf529cb45..eb40fa8a7ee 100644
--- a/tests/ui/raw-ref-op/unusual_locations.rs
+++ b/tests/ui/raw-ref-op/unusual_locations.rs
@@ -1,7 +1,5 @@
 //@ check-pass
 
-#![feature(raw_ref_op)]
-
 const USES_PTR: () = { let u = (); &raw const u; };
 static ALSO_USES_PTR: () = { let u = (); &raw const u; };
 
diff --git a/tests/ui/sanitizer/thread.rs b/tests/ui/sanitizer/thread.rs
index 9d9ad6ee518..566774d6b1d 100644
--- a/tests/ui/sanitizer/thread.rs
+++ b/tests/ui/sanitizer/thread.rs
@@ -20,7 +20,6 @@
 //@ error-pattern: Location is heap block of size 4
 //@ error-pattern: allocated by main thread
 
-#![feature(raw_ref_op)]
 #![feature(rustc_private)]
 extern crate libc;
 
diff --git a/tests/ui/static/raw-ref-extern-static.rs b/tests/ui/static/raw-ref-extern-static.rs
index 95a53a8640d..81bc5990efe 100644
--- a/tests/ui/static/raw-ref-extern-static.rs
+++ b/tests/ui/static/raw-ref-extern-static.rs
@@ -1,5 +1,4 @@
 //@ check-pass
-#![feature(raw_ref_op)]
 use std::ptr;
 
 // see https://github.com/rust-lang/rust/issues/125833
diff --git a/tests/ui/static/raw-ref-static-mut.rs b/tests/ui/static/raw-ref-static-mut.rs
index 6855cc7b050..d4159fc65ca 100644
--- a/tests/ui/static/raw-ref-static-mut.rs
+++ b/tests/ui/static/raw-ref-static-mut.rs
@@ -1,5 +1,4 @@
 //@ check-pass
-#![feature(raw_ref_op)]
 use std::ptr;
 
 // see https://github.com/rust-lang/rust/issues/125833
diff --git a/tests/ui/unpretty/expanded-exhaustive.rs b/tests/ui/unpretty/expanded-exhaustive.rs
index 29472df897a..279d723a26c 100644
--- a/tests/ui/unpretty/expanded-exhaustive.rs
+++ b/tests/ui/unpretty/expanded-exhaustive.rs
@@ -19,7 +19,6 @@
 #![feature(never_type)]
 #![feature(pattern_types)]
 #![feature(prelude_import)]
-#![feature(raw_ref_op)]
 #![feature(specialization)]
 #![feature(trace_macros)]
 #![feature(trait_alias)]
diff --git a/tests/ui/unpretty/expanded-exhaustive.stdout b/tests/ui/unpretty/expanded-exhaustive.stdout
index cf2f6f8cbaa..149659693ae 100644
--- a/tests/ui/unpretty/expanded-exhaustive.stdout
+++ b/tests/ui/unpretty/expanded-exhaustive.stdout
@@ -20,7 +20,6 @@
 #![feature(never_type)]
 #![feature(pattern_types)]
 #![feature(prelude_import)]
-#![feature(raw_ref_op)]
 #![feature(specialization)]
 #![feature(trace_macros)]
 #![feature(trait_alias)]