const_let: --bless with --compare-mode=nll

This commit is contained in:
Mazdak Farrokhzad 2019-01-12 10:32:27 +01:00
parent 3dc08ed068
commit 6c623224dc
4 changed files with 78 additions and 81 deletions

View file

@ -13,44 +13,80 @@ error[E0010]: allocations are not allowed in statics
LL | static STATIC11: Box<MyOwned> = box MyOwned;
| ^^^^^^^^^^^ allocation not allowed in statics
error[E0019]: static contains unimplemented expression type
--> $DIR/check-static-values-constraints.rs:79:37
|
LL | static STATIC11: Box<MyOwned> = box MyOwned;
| ^^^^^^^
error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
--> $DIR/check-static-values-constraints.rs:89:32
--> $DIR/check-static-values-constraints.rs:90:32
|
LL | field2: SafeEnum::Variant4("str".to_string())
| ^^^^^^^^^^^^^^^^^
error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:94:5
|
LL | box MyOwned, //~ ERROR allocations are not allowed in statics
| ^^^^^^^^^^^ allocation not allowed in statics
error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:95:5
|
LL | box MyOwned, //~ ERROR allocations are not allowed in statics
| ^^^^^^^^^^^ allocation not allowed in statics
error[E0019]: static contains unimplemented expression type
--> $DIR/check-static-values-constraints.rs:95:9
|
LL | box MyOwned, //~ ERROR allocations are not allowed in statics
| ^^^^^^^
error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:99:6
--> $DIR/check-static-values-constraints.rs:97:5
|
LL | box MyOwned, //~ ERROR allocations are not allowed in statics
| ^^^^^^^^^^^ allocation not allowed in statics
error[E0019]: static contains unimplemented expression type
--> $DIR/check-static-values-constraints.rs:97:9
|
LL | box MyOwned, //~ ERROR allocations are not allowed in statics
| ^^^^^^^
error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:102:6
|
LL | &box MyOwned, //~ ERROR allocations are not allowed in statics
| ^^^^^^^^^^^ allocation not allowed in statics
error[E0019]: static contains unimplemented expression type
--> $DIR/check-static-values-constraints.rs:102:10
|
LL | &box MyOwned, //~ ERROR allocations are not allowed in statics
| ^^^^^^^
error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:100:6
--> $DIR/check-static-values-constraints.rs:104:6
|
LL | &box MyOwned, //~ ERROR allocations are not allowed in statics
| ^^^^^^^^^^^ allocation not allowed in statics
error[E0019]: static contains unimplemented expression type
--> $DIR/check-static-values-constraints.rs:104:10
|
LL | &box MyOwned, //~ ERROR allocations are not allowed in statics
| ^^^^^^^
error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:106:5
--> $DIR/check-static-values-constraints.rs:111:5
|
LL | box 3;
| ^^^^^ allocation not allowed in statics
error[E0019]: static contains unimplemented expression type
--> $DIR/check-static-values-constraints.rs:111:9
|
LL | box 3;
| ^
error[E0507]: cannot move out of static item
--> $DIR/check-static-values-constraints.rs:110:45
--> $DIR/check-static-values-constraints.rs:116:45
|
LL | let y = { static x: Box<isize> = box 3; x };
| ^
@ -59,12 +95,18 @@ LL | let y = { static x: Box<isize> = box 3; x };
| help: consider borrowing here: `&x`
error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:110:38
--> $DIR/check-static-values-constraints.rs:116:38
|
LL | let y = { static x: Box<isize> = box 3; x };
| ^^^^^ allocation not allowed in statics
error: aborting due to 10 previous errors
error[E0019]: static contains unimplemented expression type
--> $DIR/check-static-values-constraints.rs:116:42
|
LL | let y = { static x: Box<isize> = box 3; x };
| ^
Some errors occurred: E0010, E0015, E0493, E0507.
error: aborting due to 17 previous errors
Some errors occurred: E0010, E0015, E0019, E0493, E0507.
For more information about an error, try `rustc --explain E0010`.

View file

@ -112,12 +112,6 @@ error: `if`, `match`, `&&` and `||` are not stable in const fn
LL | const fn foo30_5(b: bool) { while b { } } //~ ERROR not stable in const fn
| ^^^^^^^^^^^
error: local variables in const fn are unstable
--> $DIR/min_const_fn.rs:99:34
|
LL | const fn foo30_6() -> bool { let x = true; x } //~ ERROR local variables in const fn
| ^
error: `if`, `match`, `&&` and `||` are not stable in const fn
--> $DIR/min_const_fn.rs:100:44
|
@ -220,7 +214,7 @@ error: function pointers in const fn are unstable
LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
| ^^^^
error: aborting due to 35 previous errors
error: aborting due to 34 previous errors
Some errors occurred: E0493, E0515.
For more information about an error, try `rustc --explain E0493`.

View file

@ -1,5 +1,5 @@
error[E0597]: `y` does not live long enough
--> $DIR/promote_const_let.rs:6:9
--> $DIR/promote_const_let.rs:4:9
|
LL | let x: &'static u32 = {
| ------------ type annotation requires that `y` is borrowed for `'static`
@ -9,6 +9,21 @@ LL | &y //~ ERROR does not live long enough
LL | };
| - `y` dropped here while still borrowed
error: aborting due to previous error
error[E0716]: temporary value dropped while borrowed
--> $DIR/promote_const_let.rs:6:28
|
LL | let x: &'static u32 = &{ //~ ERROR does not live long enough
| ____________------------____^
| | |
| | type annotation requires that borrow lasts for `'static`
LL | | let y = 42;
LL | | y
LL | | };
| |_____^ creates a temporary which is freed while still in use
LL | }
| - temporary value is freed at the end of this statement
For more information about this error, try `rustc --explain E0597`.
error: aborting due to 2 previous errors
Some errors occurred: E0597, E0716.
For more information about an error, try `rustc --explain E0597`.

View file

@ -1,68 +1,14 @@
error[E0658]: let bindings in constants are unstable (see issue #48821)
--> $DIR/issue-18118.rs:5:17
|
LL | let p = 3;
| ^
|
= help: add #![feature(const_let)] to the crate attributes to enable
error[E0658]: statements in constants are unstable (see issue #48821)
--> $DIR/issue-18118.rs:5:17
|
LL | let p = 3;
| ^
|
= help: add #![feature(const_let)] to the crate attributes to enable
error[E0658]: let bindings in constants are unstable (see issue #48821)
--> $DIR/issue-18118.rs:8:9
|
LL | &p //~ ERROR `p` does not live long enough
| ^^
|
= help: add #![feature(const_let)] to the crate attributes to enable
error[E0658]: let bindings in constants are unstable (see issue #48821)
--> $DIR/issue-18118.rs:2:5
|
LL | / const z: &'static isize = {
LL | | //~^ ERROR let bindings in constants are unstable
LL | | //~| ERROR statements in constants are unstable
LL | | let p = 3;
... |
LL | | //~^ ERROR let bindings in constants are unstable
LL | | };
| |______^
|
= help: add #![feature(const_let)] to the crate attributes to enable
error[E0658]: statements in constants are unstable (see issue #48821)
--> $DIR/issue-18118.rs:2:5
|
LL | / const z: &'static isize = {
LL | | //~^ ERROR let bindings in constants are unstable
LL | | //~| ERROR statements in constants are unstable
LL | | let p = 3;
... |
LL | | //~^ ERROR let bindings in constants are unstable
LL | | };
| |______^
|
= help: add #![feature(const_let)] to the crate attributes to enable
error[E0597]: `p` does not live long enough
--> $DIR/issue-18118.rs:8:9
--> $DIR/issue-18118.rs:4:9
|
LL | &p //~ ERROR `p` does not live long enough
| ^^
| |
| borrowed value does not live long enough
| using this value as a constant requires that `p` is borrowed for `'static`
LL | //~^ ERROR let bindings in constants are unstable
LL | };
| - `p` dropped here while still borrowed
error: aborting due to 6 previous errors
error: aborting due to previous error
Some errors occurred: E0597, E0658.
For more information about an error, try `rustc --explain E0597`.
For more information about this error, try `rustc --explain E0597`.