rustc_mir: split qualify_consts' checking and value qualification.

This commit is contained in:
Eduard-Mihai Burtescu 2019-02-05 10:37:28 +02:00
parent 732a2dc095
commit f6d1e9790c
6 changed files with 643 additions and 486 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4,18 +4,18 @@ error[E0017]: references in constants may only refer to immutable values
LL | const CR: &'static mut i32 = &mut C; //~ ERROR E0017
| ^^^^^^ constants require immutable values
error: cannot mutate statics in the initializer of another static
--> $DIR/E0017.rs:5:39
|
LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
| ^^^^^^
error[E0017]: references in statics may only refer to immutable values
--> $DIR/E0017.rs:5:39
|
LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
| ^^^^^^ statics require immutable values
error: cannot mutate statics in the initializer of another static
--> $DIR/E0017.rs:5:39
|
LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
| ^^^^^^
error[E0596]: cannot borrow immutable static item `X` as mutable
--> $DIR/E0017.rs:5:39
|

View File

@ -4,18 +4,18 @@ error[E0017]: references in constants may only refer to immutable values
LL | const CR: &'static mut i32 = &mut C; //~ ERROR E0017
| ^^^^^^ constants require immutable values
error: cannot mutate statics in the initializer of another static
--> $DIR/E0017.rs:5:39
|
LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
| ^^^^^^
error[E0017]: references in statics may only refer to immutable values
--> $DIR/E0017.rs:5:39
|
LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
| ^^^^^^ statics require immutable values
error: cannot mutate statics in the initializer of another static
--> $DIR/E0017.rs:5:39
|
LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
| ^^^^^^
error[E0596]: cannot borrow immutable static item as mutable
--> $DIR/E0017.rs:5:44
|

View File

@ -4,18 +4,18 @@ error[E0017]: references in constants may only refer to immutable values
LL | const CR: &'static mut i32 = &mut C; //~ ERROR E0017
| ^^^^^^ constants require immutable values
error: cannot mutate statics in the initializer of another static
--> $DIR/E0388.rs:5:39
|
LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
| ^^^^^^
error[E0017]: references in statics may only refer to immutable values
--> $DIR/E0388.rs:5:39
|
LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
| ^^^^^^ statics require immutable values
error: cannot mutate statics in the initializer of another static
--> $DIR/E0388.rs:5:39
|
LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
| ^^^^^^
error[E0596]: cannot borrow immutable static item `X` as mutable
--> $DIR/E0388.rs:5:39
|

View File

@ -4,18 +4,18 @@ error[E0017]: references in constants may only refer to immutable values
LL | const CR: &'static mut i32 = &mut C; //~ ERROR E0017
| ^^^^^^ constants require immutable values
error: cannot mutate statics in the initializer of another static
--> $DIR/E0388.rs:5:39
|
LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
| ^^^^^^
error[E0017]: references in statics may only refer to immutable values
--> $DIR/E0388.rs:5:39
|
LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
| ^^^^^^ statics require immutable values
error: cannot mutate statics in the initializer of another static
--> $DIR/E0388.rs:5:39
|
LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
| ^^^^^^
error[E0596]: cannot borrow immutable static item as mutable
--> $DIR/E0388.rs:5:44
|

View File

@ -4,18 +4,18 @@ error[E0017]: references in constants may only refer to immutable values
LL | const C1: &'static mut [usize] = &mut [];
| ^^^^^^^ constants require immutable values
error[E0013]: constants cannot refer to statics, use a constant instead
--> $DIR/issue-17718-const-bad-values.rs:5:41
|
LL | const C2: &'static mut usize = unsafe { &mut S };
| ^^^^^^
error[E0017]: references in constants may only refer to immutable values
--> $DIR/issue-17718-const-bad-values.rs:5:41
|
LL | const C2: &'static mut usize = unsafe { &mut S };
| ^^^^^^ constants require immutable values
error[E0013]: constants cannot refer to statics, use a constant instead
--> $DIR/issue-17718-const-bad-values.rs:5:41
|
LL | const C2: &'static mut usize = unsafe { &mut S };
| ^^^^^^
error: aborting due to 3 previous errors
Some errors occurred: E0013, E0017.