diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 214a37bca03..5ab99fbac86 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -539,7 +539,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) { } } gate_all!(gen_blocks, "gen blocks are experimental"); - gate_all!(raw_ref_op, "raw address of syntax is experimental"); gate_all!(const_trait_impl, "const trait impls are experimental"); gate_all!( half_open_range_patterns_in_slices, diff --git a/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs b/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs index e603ac566f4..ccbd5a78485 100644 --- a/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs +++ b/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs @@ -6,8 +6,7 @@ extern_types, naked_functions, thread_local, - repr_simd, - raw_ref_op + repr_simd )] #![no_core] #![allow(dead_code, non_camel_case_types, internal_features)] diff --git a/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs b/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs index 9f096e90220..dcfa34cb729 100644 --- a/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs +++ b/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs @@ -2,7 +2,7 @@ #![feature( no_core, unboxed_closures, start, lang_items, never_type, linkage, - extern_types, thread_local, raw_ref_op + extern_types, thread_local )] #![no_core] #![allow(dead_code, internal_features, non_camel_case_types)] diff --git a/compiler/rustc_error_codes/src/error_codes/E0745.md b/compiler/rustc_error_codes/src/error_codes/E0745.md index 23ee7af30f4..32b28f3de94 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0745.md +++ b/compiler/rustc_error_codes/src/error_codes/E0745.md @@ -3,7 +3,6 @@ The address of temporary value was taken. Erroneous code example: ```compile_fail,E0745 -# #![feature(raw_ref_op)] fn temp_address() { let ptr = &raw const 2; // error! } @@ -15,7 +14,6 @@ In this example, `2` is destroyed right after the assignment, which means that To avoid this error, first bind the temporary to a named local variable: ``` -# #![feature(raw_ref_op)] fn temp_address() { let val = 2; let ptr = &raw const val; // ok! diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 3d5ecbaae32..7838abca9b8 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -321,6 +321,8 @@ declare_features! ( (accepted, raw_dylib, "1.71.0", Some(58713)), /// Allows keywords to be escaped for use as identifiers. (accepted, raw_identifiers, "1.30.0", Some(48589)), + /// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions. + (accepted, raw_ref_op, "CURRENT_RUSTC_VERSION", Some(64490)), /// Allows relaxing the coherence rules such that /// `impl ForeignTrait for ForeignType` is permitted. (accepted, re_rebalance_coherence, "1.41.0", Some(55437)), diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 459df9ea1b8..14e353f13ca 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -565,8 +565,6 @@ declare_features! ( (unstable, precise_capturing, "1.79.0", Some(123432)), /// Allows macro attributes on expressions, statements and non-inline modules. (unstable, proc_macro_hygiene, "1.30.0", Some(54727)), - /// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions. - (unstable, raw_ref_op, "1.41.0", Some(64490)), /// Makes `&` and `&mut` patterns eat only one layer of references in Rust 2024. (incomplete, ref_pat_eat_one_layer_2024, "1.79.0", Some(123076)), /// Makes `&` and `&mut` patterns eat only one layer of references in Rust 2024—structural variant diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index e0917ba43e4..422206ebbce 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -851,7 +851,7 @@ impl<'a> Parser<'a> { self.expect_and()?; let has_lifetime = self.token.is_lifetime() && self.look_ahead(1, |t| t != &token::Colon); let lifetime = has_lifetime.then(|| self.expect_lifetime()); // For recovery, see below. - let (borrow_kind, mutbl) = self.parse_borrow_modifiers(lo); + let (borrow_kind, mutbl) = self.parse_borrow_modifiers(); let attrs = self.parse_outer_attributes()?; let expr = if self.token.is_range_separator() { self.parse_expr_prefix_range(attrs) @@ -871,13 +871,12 @@ impl<'a> Parser<'a> { } /// Parse `mut?` or `raw [ const | mut ]`. - fn parse_borrow_modifiers(&mut self, lo: Span) -> (ast::BorrowKind, ast::Mutability) { + fn parse_borrow_modifiers(&mut self) -> (ast::BorrowKind, ast::Mutability) { if self.check_keyword(kw::Raw) && self.look_ahead(1, Token::is_mutability) { // `raw [ const | mut ]`. let found_raw = self.eat_keyword(kw::Raw); assert!(found_raw); let mutability = self.parse_const_or_mut().unwrap(); - self.psess.gated_spans.gate(sym::raw_ref_op, lo.to(self.prev_token.span)); (ast::BorrowKind::Raw, mutability) } else { // `mut?` diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs index 023bce1616b..3e20b8da622 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs +++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs @@ -1,4 +1,3 @@ -#![feature(raw_ref_op)] #![feature(strict_provenance)] use std::ptr; diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.rs b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.rs index c8e0782eff2..a6e0134bd17 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.rs +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.rs @@ -1,7 +1,6 @@ //@revisions: stack tree none //@[tree]compile-flags: -Zmiri-tree-borrows //@[none]compile-flags: -Zmiri-disable-stacked-borrows -#![feature(raw_ref_op)] #![feature(core_intrinsics)] #![feature(custom_mir)] diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.rs b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.rs index 8de0b12b8b0..6155e925c4b 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.rs +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.rs @@ -1,7 +1,6 @@ // This does need an aliasing model and protectors. //@revisions: stack tree //@[tree]compile-flags: -Zmiri-tree-borrows -#![feature(raw_ref_op)] #![feature(core_intrinsics)] #![feature(custom_mir)] diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs index facc323bbc5..37ee7ae1b0d 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs @@ -1,7 +1,6 @@ // This does need an aliasing model and protectors. //@revisions: stack tree //@[tree]compile-flags: -Zmiri-tree-borrows -#![feature(raw_ref_op)] #![feature(core_intrinsics)] #![feature(custom_mir)] #![feature(explicit_tail_calls)] diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.rs b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.rs index 244acd8f2be..698a893f897 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.rs +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.rs @@ -1,6 +1,5 @@ // Doesn't need an aliasing model. //@compile-flags: -Zmiri-disable-stacked-borrows -#![feature(raw_ref_op)] #![feature(core_intrinsics)] #![feature(custom_mir)] diff --git a/src/tools/miri/tests/pass/function_calls/return_place_on_heap.rs b/src/tools/miri/tests/pass/function_calls/return_place_on_heap.rs index a5cbe2a0d1d..04a55d7007c 100644 --- a/src/tools/miri/tests/pass/function_calls/return_place_on_heap.rs +++ b/src/tools/miri/tests/pass/function_calls/return_place_on_heap.rs @@ -1,4 +1,3 @@ -#![feature(raw_ref_op)] #![feature(core_intrinsics)] #![feature(custom_mir)] 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: 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: 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 = 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 = 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 = 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 = 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]+)?()?─*╼ )+ *│.*" -> " 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 ..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 ..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 ..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 ..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 ..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` 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:: - shim(Some(String))` note: inside `std::ptr::drop_in_place::> - shim(Some(Option))` --> $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` 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:: - shim(Some(String))` note: inside `std::ptr::drop_in_place::> - shim(Some(Option))` --> $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)` 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) = (0, None); | ^^^^^ the destructor for this type cannot be evaluated in constant functions error[E0493]: destructor of `Option` 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 = None; | ^ the destructor for this type cannot be evaluated in constant functions error[E0493]: destructor of `Option` 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` 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 = None; | ^^^^^ the destructor for this type cannot be evaluated in constant functions error[E0493]: destructor of `Option` 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 = None; | ^^^^^ the destructor for this type cannot be evaluated in constant functions error[E0493]: destructor of `Option` 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 = None; | ^ the destructor for this type cannot be evaluated in constant functions error[E0493]: destructor of `Option` 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 = 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 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 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 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 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 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 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)]