diff options
| author | bors <bors@rust-lang.org> | 2018-11-26 08:17:36 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-11-26 08:17:36 +0000 |
| commit | b51632e3f0856ea444f5e59819538e85947673fc (patch) | |
| tree | 781797013c772397ae09f3fdbb1aa2d9ff07395e /src/test/ui/error-codes | |
| parent | 423291f14bbb820265b2bbf33d6fffb044035b86 (diff) | |
| parent | 6db8c6c6d9fd1f8226b3afd9e18c6fb3cd2f1176 (diff) | |
| download | rust-b51632e3f0856ea444f5e59819538e85947673fc.tar.gz rust-b51632e3f0856ea444f5e59819538e85947673fc.zip | |
Auto merge of #56070 - oli-obk:const_let, r=eddyb
Allow assignments in const contexts fixes https://github.com/rust-lang/rust/issues/54098 fixes https://github.com/rust-lang/rust/issues/51251 fixes https://github.com/rust-lang/rust/issues/52613
Diffstat (limited to 'src/test/ui/error-codes')
| -rw-r--r-- | src/test/ui/error-codes/E0017.nll.stderr | 10 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0017.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0017.stderr | 10 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0388.nll.stderr | 10 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0388.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0388.stderr | 10 |
6 files changed, 34 insertions, 8 deletions
diff --git a/src/test/ui/error-codes/E0017.nll.stderr b/src/test/ui/error-codes/E0017.nll.stderr index 08708d213d3..8f8d87739b8 100644 --- a/src/test/ui/error-codes/E0017.nll.stderr +++ b/src/test/ui/error-codes/E0017.nll.stderr @@ -4,6 +4,12 @@ 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:15: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:15:39 | @@ -17,12 +23,12 @@ LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017 | ^^^^^^ cannot borrow as mutable error[E0017]: references in statics may only refer to immutable values - --> $DIR/E0017.rs:17:38 + --> $DIR/E0017.rs:18:38 | LL | static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017 | ^^^^^^ statics require immutable values -error: aborting due to 4 previous errors +error: aborting due to 5 previous errors Some errors occurred: E0017, E0596. For more information about an error, try `rustc --explain E0017`. diff --git a/src/test/ui/error-codes/E0017.rs b/src/test/ui/error-codes/E0017.rs index c98c35a1442..bf400fde365 100644 --- a/src/test/ui/error-codes/E0017.rs +++ b/src/test/ui/error-codes/E0017.rs @@ -14,5 +14,6 @@ const C: i32 = 2; const CR: &'static mut i32 = &mut C; //~ ERROR E0017 static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017 //~| ERROR cannot borrow + //~| ERROR cannot mutate statics static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017 fn main() {} diff --git a/src/test/ui/error-codes/E0017.stderr b/src/test/ui/error-codes/E0017.stderr index 411b9f31397..94a90d92d3e 100644 --- a/src/test/ui/error-codes/E0017.stderr +++ b/src/test/ui/error-codes/E0017.stderr @@ -4,6 +4,12 @@ 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:15: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:15:39 | @@ -17,12 +23,12 @@ 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:17:38 + --> $DIR/E0017.rs:18:38 | LL | static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017 | ^^^^^^ statics require immutable values -error: aborting due to 4 previous errors +error: aborting due to 5 previous errors Some errors occurred: E0017, E0596. For more information about an error, try `rustc --explain E0017`. diff --git a/src/test/ui/error-codes/E0388.nll.stderr b/src/test/ui/error-codes/E0388.nll.stderr index a048374a497..7d25d41f18b 100644 --- a/src/test/ui/error-codes/E0388.nll.stderr +++ b/src/test/ui/error-codes/E0388.nll.stderr @@ -4,6 +4,12 @@ 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:15: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:15:39 | @@ -17,12 +23,12 @@ LL | static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017 | ^^^^^^ cannot borrow as mutable error[E0017]: references in statics may only refer to immutable values - --> $DIR/E0388.rs:17:38 + --> $DIR/E0388.rs:18:38 | LL | static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017 | ^^^^^^ statics require immutable values -error: aborting due to 4 previous errors +error: aborting due to 5 previous errors Some errors occurred: E0017, E0596. For more information about an error, try `rustc --explain E0017`. diff --git a/src/test/ui/error-codes/E0388.rs b/src/test/ui/error-codes/E0388.rs index c002badfef6..3203798c709 100644 --- a/src/test/ui/error-codes/E0388.rs +++ b/src/test/ui/error-codes/E0388.rs @@ -14,6 +14,7 @@ const C: i32 = 2; const CR: &'static mut i32 = &mut C; //~ ERROR E0017 static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017 //~| ERROR cannot borrow + //~| ERROR cannot mutate statics static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017 fn main() {} diff --git a/src/test/ui/error-codes/E0388.stderr b/src/test/ui/error-codes/E0388.stderr index d2263cd4034..46efda9147b 100644 --- a/src/test/ui/error-codes/E0388.stderr +++ b/src/test/ui/error-codes/E0388.stderr @@ -4,6 +4,12 @@ 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:15: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:15:39 | @@ -17,12 +23,12 @@ 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:17:38 + --> $DIR/E0388.rs:18:38 | LL | static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017 | ^^^^^^ statics require immutable values -error: aborting due to 4 previous errors +error: aborting due to 5 previous errors Some errors occurred: E0017, E0596. For more information about an error, try `rustc --explain E0017`. |
