Skip to content

Commit 00e62fa

Browse files
committed
Adjust wording of a diagnostic
1 parent 3cd0b46 commit 00e62fa

10 files changed

+18
-18
lines changed

compiler/rustc_mir/src/transform/check_consts/ops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ impl NonConstOp for MutBorrow {
298298
ccx.tcx.sess,
299299
span,
300300
E0764,
301-
"{}mutable references are not allowed in final value of {}s",
301+
"{}mutable references are not allowed in the final value of {}s",
302302
raw,
303303
ccx.const_kind(),
304304
);

src/test/ui/check-static-immutable-mut-slices.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0764]: mutable references are not allowed in final value of statics
1+
error[E0764]: mutable references are not allowed in the final value of statics
22
--> $DIR/check-static-immutable-mut-slices.rs:3:37
33
|
44
LL | static TEST: &'static mut [isize] = &mut [];

src/test/ui/consts/const-mut-refs/mut_ref_in_final.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0764]: mutable references are not allowed in final value of constants
1+
error[E0764]: mutable references are not allowed in the final value of constants
22
--> $DIR/mut_ref_in_final.rs:10:21
33
|
44
LL | const B: *mut i32 = &mut 4;

src/test/ui/consts/issue-17718-const-bad-values.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0764]: mutable references are not allowed in final value of constants
1+
error[E0764]: mutable references are not allowed in the final value of constants
22
--> $DIR/issue-17718-const-bad-values.rs:1:34
33
|
44
LL | const C1: &'static mut [usize] = &mut [];

src/test/ui/consts/projection_qualif.mut_refs.stderr renamed to src/test/ui/consts/write_to_mut_ref_dest.mut_refs.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: dereferencing raw pointers in constants is unstable
2-
--> $DIR/projection_qualif.rs:11:18
2+
--> $DIR/write_to_mut_ref_dest.rs:11:18
33
|
44
LL | unsafe { *b = 5; }
55
| ^^^^^^

src/test/ui/consts/projection_qualif.stock.stderr renamed to src/test/ui/consts/write_to_mut_ref_dest.stock.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: mutable references are not allowed in constants
2-
--> $DIR/projection_qualif.rs:10:27
2+
--> $DIR/write_to_mut_ref_dest.rs:10:27
33
|
44
LL | let b: *mut u32 = &mut a;
55
| ^^^^^^
@@ -8,7 +8,7 @@ LL | let b: *mut u32 = &mut a;
88
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
99

1010
error[E0658]: dereferencing raw pointers in constants is unstable
11-
--> $DIR/projection_qualif.rs:11:18
11+
--> $DIR/write_to_mut_ref_dest.rs:11:18
1212
|
1313
LL | unsafe { *b = 5; }
1414
| ^^^^^^

src/test/ui/consts/read_from_static_mut_ref.stderr renamed to src/test/ui/consts/write_to_static_via_mut_ref.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
error[E0764]: mutable references are not allowed in final value of statics
2-
--> $DIR/read_from_static_mut_ref.rs:4:26
1+
error[E0764]: mutable references are not allowed in the final value of statics
2+
--> $DIR/write_to_static_via_mut_ref.rs:4:26
33
|
44
LL | static OH_NO: &mut i32 = &mut 42;
55
| ^^^^^^^
66

77
error[E0594]: cannot assign to `*OH_NO`, as `OH_NO` is an immutable static item
8-
--> $DIR/read_from_static_mut_ref.rs:7:5
8+
--> $DIR/write_to_static_via_mut_ref.rs:7:5
99
|
1010
LL | *OH_NO = 43;
1111
| ^^^^^^^^^^^ cannot assign

src/test/ui/error-codes/E0017.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ note: `const` item defined here
1313
LL | const C: i32 = 2;
1414
| ^^^^^^^^^^^^^^^^^
1515

16-
error[E0764]: mutable references are not allowed in final value of constants
16+
error[E0764]: mutable references are not allowed in the final value of constants
1717
--> $DIR/E0017.rs:5:30
1818
|
1919
LL | const CR: &'static mut i32 = &mut C;
@@ -28,7 +28,7 @@ LL | static STATIC_REF: &'static mut i32 = &mut X;
2828
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
2929
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
3030

31-
error[E0764]: mutable references are not allowed in final value of statics
31+
error[E0764]: mutable references are not allowed in the final value of statics
3232
--> $DIR/E0017.rs:7:39
3333
|
3434
LL | static STATIC_REF: &'static mut i32 = &mut X;
@@ -54,13 +54,13 @@ note: `const` item defined here
5454
LL | const C: i32 = 2;
5555
| ^^^^^^^^^^^^^^^^^
5656

57-
error[E0764]: mutable references are not allowed in final value of statics
57+
error[E0764]: mutable references are not allowed in the final value of statics
5858
--> $DIR/E0017.rs:11:38
5959
|
6060
LL | static CONST_REF: &'static mut i32 = &mut C;
6161
| ^^^^^^
6262

63-
error[E0764]: mutable references are not allowed in final value of statics
63+
error[E0764]: mutable references are not allowed in the final value of statics
6464
--> $DIR/E0017.rs:13:52
6565
|
6666
LL | static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M };

src/test/ui/error-codes/E0388.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ note: `const` item defined here
1313
LL | const C: i32 = 2;
1414
| ^^^^^^^^^^^^^^^^^
1515

16-
error[E0764]: mutable references are not allowed in final value of constants
16+
error[E0764]: mutable references are not allowed in the final value of constants
1717
--> $DIR/E0388.rs:4:30
1818
|
1919
LL | const CR: &'static mut i32 = &mut C;
@@ -28,7 +28,7 @@ LL | static STATIC_REF: &'static mut i32 = &mut X;
2828
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
2929
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
3030

31-
error[E0764]: mutable references are not allowed in final value of statics
31+
error[E0764]: mutable references are not allowed in the final value of statics
3232
--> $DIR/E0388.rs:6:39
3333
|
3434
LL | static STATIC_REF: &'static mut i32 = &mut X;
@@ -54,7 +54,7 @@ note: `const` item defined here
5454
LL | const C: i32 = 2;
5555
| ^^^^^^^^^^^^^^^^^
5656

57-
error[E0764]: mutable references are not allowed in final value of statics
57+
error[E0764]: mutable references are not allowed in the final value of statics
5858
--> $DIR/E0388.rs:10:38
5959
|
6060
LL | static CONST_REF: &'static mut i32 = &mut C;

src/test/ui/issues/issue-46604.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0764]: mutable references are not allowed in final value of statics
1+
error[E0764]: mutable references are not allowed in the final value of statics
22
--> $DIR/issue-46604.rs:1:25
33
|
44
LL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7];

0 commit comments

Comments
 (0)