Adjust wording of a diagnostic
This commit is contained in:
parent
3cd0b46bac
commit
00e62fabf1
@ -298,7 +298,7 @@ impl NonConstOp for MutBorrow {
|
||||
ccx.tcx.sess,
|
||||
span,
|
||||
E0764,
|
||||
"{}mutable references are not allowed in final value of {}s",
|
||||
"{}mutable references are not allowed in the final value of {}s",
|
||||
raw,
|
||||
ccx.const_kind(),
|
||||
);
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0764]: mutable references are not allowed in final value of statics
|
||||
error[E0764]: mutable references are not allowed in the final value of statics
|
||||
--> $DIR/check-static-immutable-mut-slices.rs:3:37
|
||||
|
|
||||
LL | static TEST: &'static mut [isize] = &mut [];
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0764]: mutable references are not allowed in final value of constants
|
||||
error[E0764]: mutable references are not allowed in the final value of constants
|
||||
--> $DIR/mut_ref_in_final.rs:10:21
|
||||
|
|
||||
LL | const B: *mut i32 = &mut 4;
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0764]: mutable references are not allowed in final value of constants
|
||||
error[E0764]: mutable references are not allowed in the final value of constants
|
||||
--> $DIR/issue-17718-const-bad-values.rs:1:34
|
||||
|
|
||||
LL | const C1: &'static mut [usize] = &mut [];
|
||||
|
@ -1,5 +1,5 @@
|
||||
error[E0658]: dereferencing raw pointers in constants is unstable
|
||||
--> $DIR/projection_qualif.rs:11:18
|
||||
--> $DIR/write_to_mut_ref_dest.rs:11:18
|
||||
|
|
||||
LL | unsafe { *b = 5; }
|
||||
| ^^^^^^
|
@ -1,5 +1,5 @@
|
||||
error[E0658]: mutable references are not allowed in constants
|
||||
--> $DIR/projection_qualif.rs:10:27
|
||||
--> $DIR/write_to_mut_ref_dest.rs:10:27
|
||||
|
|
||||
LL | let b: *mut u32 = &mut a;
|
||||
| ^^^^^^
|
||||
@ -8,7 +8,7 @@ LL | let b: *mut u32 = &mut a;
|
||||
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
||||
|
||||
error[E0658]: dereferencing raw pointers in constants is unstable
|
||||
--> $DIR/projection_qualif.rs:11:18
|
||||
--> $DIR/write_to_mut_ref_dest.rs:11:18
|
||||
|
|
||||
LL | unsafe { *b = 5; }
|
||||
| ^^^^^^
|
@ -1,11 +1,11 @@
|
||||
error[E0764]: mutable references are not allowed in final value of statics
|
||||
--> $DIR/read_from_static_mut_ref.rs:4:26
|
||||
error[E0764]: mutable references are not allowed in the final value of statics
|
||||
--> $DIR/write_to_static_via_mut_ref.rs:4:26
|
||||
|
|
||||
LL | static OH_NO: &mut i32 = &mut 42;
|
||||
| ^^^^^^^
|
||||
|
||||
error[E0594]: cannot assign to `*OH_NO`, as `OH_NO` is an immutable static item
|
||||
--> $DIR/read_from_static_mut_ref.rs:7:5
|
||||
--> $DIR/write_to_static_via_mut_ref.rs:7:5
|
||||
|
|
||||
LL | *OH_NO = 43;
|
||||
| ^^^^^^^^^^^ cannot assign
|
@ -13,7 +13,7 @@ note: `const` item defined here
|
||||
LL | const C: i32 = 2;
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0764]: mutable references are not allowed in final value of constants
|
||||
error[E0764]: mutable references are not allowed in the final value of constants
|
||||
--> $DIR/E0017.rs:5:30
|
||||
|
|
||||
LL | const CR: &'static mut i32 = &mut C;
|
||||
@ -28,7 +28,7 @@ LL | static STATIC_REF: &'static mut i32 = &mut X;
|
||||
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
|
||||
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
||||
|
||||
error[E0764]: mutable references are not allowed in final value of statics
|
||||
error[E0764]: mutable references are not allowed in the final value of statics
|
||||
--> $DIR/E0017.rs:7:39
|
||||
|
|
||||
LL | static STATIC_REF: &'static mut i32 = &mut X;
|
||||
@ -54,13 +54,13 @@ note: `const` item defined here
|
||||
LL | const C: i32 = 2;
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0764]: mutable references are not allowed in final value of statics
|
||||
error[E0764]: mutable references are not allowed in the final value of statics
|
||||
--> $DIR/E0017.rs:11:38
|
||||
|
|
||||
LL | static CONST_REF: &'static mut i32 = &mut C;
|
||||
| ^^^^^^
|
||||
|
||||
error[E0764]: mutable references are not allowed in final value of statics
|
||||
error[E0764]: mutable references are not allowed in the final value of statics
|
||||
--> $DIR/E0017.rs:13:52
|
||||
|
|
||||
LL | static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M };
|
||||
|
@ -13,7 +13,7 @@ note: `const` item defined here
|
||||
LL | const C: i32 = 2;
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0764]: mutable references are not allowed in final value of constants
|
||||
error[E0764]: mutable references are not allowed in the final value of constants
|
||||
--> $DIR/E0388.rs:4:30
|
||||
|
|
||||
LL | const CR: &'static mut i32 = &mut C;
|
||||
@ -28,7 +28,7 @@ LL | static STATIC_REF: &'static mut i32 = &mut X;
|
||||
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
|
||||
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
||||
|
||||
error[E0764]: mutable references are not allowed in final value of statics
|
||||
error[E0764]: mutable references are not allowed in the final value of statics
|
||||
--> $DIR/E0388.rs:6:39
|
||||
|
|
||||
LL | static STATIC_REF: &'static mut i32 = &mut X;
|
||||
@ -54,7 +54,7 @@ note: `const` item defined here
|
||||
LL | const C: i32 = 2;
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0764]: mutable references are not allowed in final value of statics
|
||||
error[E0764]: mutable references are not allowed in the final value of statics
|
||||
--> $DIR/E0388.rs:10:38
|
||||
|
|
||||
LL | static CONST_REF: &'static mut i32 = &mut C;
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0764]: mutable references are not allowed in final value of statics
|
||||
error[E0764]: mutable references are not allowed in the final value of statics
|
||||
--> $DIR/issue-46604.rs:1:25
|
||||
|
|
||||
LL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7];
|
||||
|
Loading…
Reference in New Issue
Block a user