add new error code
This commit is contained in:
parent
1f48465a01
commit
96031e22d2
21 changed files with 95 additions and 53 deletions
|
|
@ -1,4 +1,4 @@
|
|||
error[E0019]: mutable references are not allowed in statics
|
||||
error[E0764]: mutable references are not allowed in statics
|
||||
--> $DIR/check-static-immutable-mut-slices.rs:3:37
|
||||
|
|
||||
LL | static TEST: &'static mut [isize] = &mut [];
|
||||
|
|
@ -6,4 +6,4 @@ LL | static TEST: &'static mut [isize] = &mut [];
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0019`.
|
||||
For more information about this error, try `rustc --explain E0764`.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0019]: mutable references are not allowed in constants
|
||||
error[E0764]: mutable references are not allowed in constants
|
||||
--> $DIR/issue-65394.rs:8:13
|
||||
|
|
||||
LL | let r = &mut x;
|
||||
|
|
@ -12,5 +12,5 @@ LL | let mut x = Vec::<i32>::new();
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0019, E0493.
|
||||
For more information about an error, try `rustc --explain E0019`.
|
||||
Some errors have detailed explanations: E0493, E0764.
|
||||
For more information about an error, try `rustc --explain E0493`.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0019]: mutable references are not allowed in constants
|
||||
error[E0764]: mutable references are not allowed in constants
|
||||
--> $DIR/const-multi-ref.rs:6:13
|
||||
|
|
||||
LL | let p = &mut a;
|
||||
|
|
@ -12,5 +12,5 @@ LL | let p = &a;
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0019, E0492.
|
||||
For more information about an error, try `rustc --explain E0019`.
|
||||
Some errors have detailed explanations: E0492, E0764.
|
||||
For more information about an error, try `rustc --explain E0492`.
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
error[E0019]: mutable references are not allowed in constants
|
||||
error[E0764]: mutable references are not allowed in constants
|
||||
--> $DIR/const_mut_address_of.rs:24:5
|
||||
|
|
||||
LL | foo().bar();
|
||||
| ^^^^^ `&mut` is only allowed in `const fn`
|
||||
|
||||
error[E0019]: mutable references are not allowed in constants
|
||||
error[E0764]: mutable references are not allowed in constants
|
||||
--> $DIR/const_mut_address_of.rs:26:9
|
||||
|
|
||||
LL | baz(&mut foo());
|
||||
|
|
@ -12,4 +12,4 @@ LL | baz(&mut foo());
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0019`.
|
||||
For more information about this error, try `rustc --explain E0764`.
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
error[E0019]: mutable references are not allowed in constants
|
||||
error[E0764]: mutable references are not allowed in constants
|
||||
--> $DIR/const_mut_refs.rs:31:17
|
||||
|
|
||||
LL | let _: [(); foo().bar()] = [(); 1];
|
||||
| ^^^^^ `&mut` is only allowed in `const fn`
|
||||
|
||||
error[E0019]: mutable references are not allowed in constants
|
||||
error[E0764]: mutable references are not allowed in constants
|
||||
--> $DIR/const_mut_refs.rs:33:21
|
||||
|
|
||||
LL | let _: [(); baz(&mut foo())] = [(); 2];
|
||||
| ^^^^^^^^^^ `&mut` is only allowed in `const fn`
|
||||
|
||||
error[E0019]: mutable references are not allowed in constants
|
||||
error[E0764]: mutable references are not allowed in constants
|
||||
--> $DIR/const_mut_refs.rs:35:22
|
||||
|
|
||||
LL | let _: [(); bazz(&mut foo())] = [(); 3];
|
||||
|
|
@ -18,4 +18,4 @@ LL | let _: [(); bazz(&mut foo())] = [(); 3];
|
|||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0019`.
|
||||
For more information about this error, try `rustc --explain E0764`.
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ LL | self.state = x;
|
|||
|
|
||||
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
||||
|
||||
error[E0019]: mutable references are not allowed in constants
|
||||
error[E0764]: mutable references are not allowed in constants
|
||||
--> $DIR/const_let_assign3.rs:16:5
|
||||
|
|
||||
LL | s.foo(3);
|
||||
| ^ `&mut` is only allowed in `const fn`
|
||||
|
||||
error[E0019]: mutable references are not allowed in constants
|
||||
error[E0764]: mutable references are not allowed in constants
|
||||
--> $DIR/const_let_assign3.rs:22:13
|
||||
|
|
||||
LL | let y = &mut x;
|
||||
|
|
@ -28,4 +28,5 @@ LL | *y = 42;
|
|||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0019`.
|
||||
Some errors have detailed explanations: E0019, E0764.
|
||||
For more information about an error, try `rustc --explain E0019`.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0019]: mutable references are not allowed in constants
|
||||
error[E0764]: mutable references are not allowed in constants
|
||||
--> $DIR/projection_qualif.rs:10:27
|
||||
|
|
||||
LL | let b: *mut u32 = &mut a;
|
||||
|
|
@ -15,5 +15,5 @@ LL | unsafe { *b = 5; }
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0019, E0658.
|
||||
For more information about an error, try `rustc --explain E0019`.
|
||||
Some errors have detailed explanations: E0658, E0764.
|
||||
For more information about an error, try `rustc --explain E0658`.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0019]: mutable references are not allowed in constants
|
||||
error[E0764]: mutable references are not allowed in constants
|
||||
--> $DIR/projection_qualif.rs:10:27
|
||||
|
|
||||
LL | let b: *mut u32 = &mut a;
|
||||
|
|
@ -23,5 +23,5 @@ LL | unsafe { *b = 5; }
|
|||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0019, E0658.
|
||||
Some errors have detailed explanations: E0019, E0658, E0764.
|
||||
For more information about an error, try `rustc --explain E0019`.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0019]: mutable references are not allowed in statics
|
||||
error[E0764]: mutable references are not allowed in statics
|
||||
--> $DIR/read_from_static_mut_ref.rs:5:26
|
||||
|
|
||||
LL | static OH_NO: &mut i32 = &mut 42;
|
||||
|
|
@ -6,4 +6,4 @@ LL | static OH_NO: &mut i32 = &mut 42;
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0019`.
|
||||
For more information about this error, try `rustc --explain E0764`.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0019]: mutable references are not allowed in statics
|
||||
error[E0764]: mutable references are not allowed in statics
|
||||
--> $DIR/static_mut_containing_mut_ref2.rs:7:46
|
||||
|
|
||||
LL | pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 42; };
|
||||
|
|
@ -6,4 +6,4 @@ LL | pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 4
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0019`.
|
||||
For more information about this error, try `rustc --explain E0764`.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0019]: mutable references are not allowed in statics
|
||||
error[E0764]: mutable references are not allowed in statics
|
||||
--> $DIR/static_mut_containing_mut_ref2.rs:7:46
|
||||
|
|
||||
LL | pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 42; };
|
||||
|
|
@ -14,4 +14,5 @@ LL | pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 4
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0019`.
|
||||
Some errors have detailed explanations: E0019, E0764.
|
||||
For more information about an error, try `rustc --explain E0019`.
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ static X: i32 = 1;
|
|||
const C: i32 = 2;
|
||||
static mut M: i32 = 3;
|
||||
|
||||
const CR: &'static mut i32 = &mut C; //~ ERROR E0019
|
||||
static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0019
|
||||
const CR: &'static mut i32 = &mut C; //~ ERROR E0764
|
||||
static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0764
|
||||
//~| ERROR E0019
|
||||
//~| ERROR cannot borrow
|
||||
static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0019
|
||||
static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M }; //~ ERROR E0019
|
||||
static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0764
|
||||
static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M }; //~ ERROR E0764
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0019]: mutable references are not allowed in constants
|
||||
error[E0764]: mutable references are not allowed in constants
|
||||
--> $DIR/E0017.rs:5:30
|
||||
|
|
||||
LL | const CR: &'static mut i32 = &mut C;
|
||||
|
|
@ -12,7 +12,7 @@ LL | static STATIC_REF: &'static mut i32 = &mut X;
|
|||
|
|
||||
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
||||
|
||||
error[E0019]: mutable references are not allowed in statics
|
||||
error[E0764]: mutable references are not allowed in statics
|
||||
--> $DIR/E0017.rs:6:39
|
||||
|
|
||||
LL | static STATIC_REF: &'static mut i32 = &mut X;
|
||||
|
|
@ -24,13 +24,13 @@ error[E0596]: cannot borrow immutable static item `X` as mutable
|
|||
LL | static STATIC_REF: &'static mut i32 = &mut X;
|
||||
| ^^^^^^ cannot borrow as mutable
|
||||
|
||||
error[E0019]: mutable references are not allowed in statics
|
||||
error[E0764]: mutable references are not allowed in statics
|
||||
--> $DIR/E0017.rs:9:38
|
||||
|
|
||||
LL | static CONST_REF: &'static mut i32 = &mut C;
|
||||
| ^^^^^^ `&mut` is only allowed in `const fn`
|
||||
|
||||
error[E0019]: mutable references are not allowed in statics
|
||||
error[E0764]: mutable references are not allowed in statics
|
||||
--> $DIR/E0017.rs:10:52
|
||||
|
|
||||
LL | static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M };
|
||||
|
|
@ -38,5 +38,5 @@ LL | static STATIC_MUT_REF: &'static mut i32 = unsafe { &mut M };
|
|||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0019, E0596.
|
||||
Some errors have detailed explanations: E0019, E0596, E0764.
|
||||
For more information about an error, try `rustc --explain E0019`.
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
static X: i32 = 1;
|
||||
const C: i32 = 2;
|
||||
|
||||
const CR: &'static mut i32 = &mut C; //~ ERROR E0019
|
||||
const CR: &'static mut i32 = &mut C; //~ ERROR E0764
|
||||
static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0019
|
||||
//~| ERROR cannot borrow
|
||||
//~| ERROR E0019
|
||||
static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0019
|
||||
//~| ERROR E0764
|
||||
static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0764
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0019]: mutable references are not allowed in constants
|
||||
error[E0764]: mutable references are not allowed in constants
|
||||
--> $DIR/E0388.rs:4:30
|
||||
|
|
||||
LL | const CR: &'static mut i32 = &mut C;
|
||||
|
|
@ -12,7 +12,7 @@ LL | static STATIC_REF: &'static mut i32 = &mut X;
|
|||
|
|
||||
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
|
||||
|
||||
error[E0019]: mutable references are not allowed in statics
|
||||
error[E0764]: mutable references are not allowed in statics
|
||||
--> $DIR/E0388.rs:5:39
|
||||
|
|
||||
LL | static STATIC_REF: &'static mut i32 = &mut X;
|
||||
|
|
@ -24,7 +24,7 @@ error[E0596]: cannot borrow immutable static item `X` as mutable
|
|||
LL | static STATIC_REF: &'static mut i32 = &mut X;
|
||||
| ^^^^^^ cannot borrow as mutable
|
||||
|
||||
error[E0019]: mutable references are not allowed in statics
|
||||
error[E0764]: mutable references are not allowed in statics
|
||||
--> $DIR/E0388.rs:8:38
|
||||
|
|
||||
LL | static CONST_REF: &'static mut i32 = &mut C;
|
||||
|
|
@ -32,5 +32,5 @@ LL | static CONST_REF: &'static mut i32 = &mut C;
|
|||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0019, E0596.
|
||||
Some errors have detailed explanations: E0019, E0596, E0764.
|
||||
For more information about an error, try `rustc --explain E0019`.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0019]: mutable references are not allowed in constants
|
||||
error[E0764]: mutable references are not allowed in constants
|
||||
--> $DIR/issue-17718-const-bad-values.rs:1:34
|
||||
|
|
||||
LL | const C1: &'static mut [usize] = &mut [];
|
||||
|
|
@ -20,7 +20,7 @@ LL | const C2: &'static mut usize = unsafe { &mut S };
|
|||
|
|
||||
= help: consider extracting the value of the `static` to a `const`, and referring to that
|
||||
|
||||
error[E0019]: mutable references are not allowed in constants
|
||||
error[E0764]: mutable references are not allowed in constants
|
||||
--> $DIR/issue-17718-const-bad-values.rs:5:41
|
||||
|
|
||||
LL | const C2: &'static mut usize = unsafe { &mut S };
|
||||
|
|
@ -28,5 +28,5 @@ LL | const C2: &'static mut usize = unsafe { &mut S };
|
|||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0013, E0019.
|
||||
Some errors have detailed explanations: E0013, E0764.
|
||||
For more information about an error, try `rustc --explain E0013`.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
static buf: &mut [u8] = &mut [1u8,2,3,4,5,7]; //~ ERROR E0019
|
||||
static buf: &mut [u8] = &mut [1u8,2,3,4,5,7]; //~ ERROR E0764
|
||||
fn write<T: AsRef<[u8]>>(buffer: T) { }
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0019]: mutable references are not allowed in statics
|
||||
error[E0764]: mutable references are not allowed in statics
|
||||
--> $DIR/issue-46604.rs:1:25
|
||||
|
|
||||
LL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7];
|
||||
|
|
@ -12,5 +12,5 @@ LL | buf[0]=2;
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0019, E0594.
|
||||
For more information about an error, try `rustc --explain E0019`.
|
||||
Some errors have detailed explanations: E0594, E0764.
|
||||
For more information about an error, try `rustc --explain E0594`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue