diff --git a/src/test/ui/check-static-values-constraints.nll.stderr b/src/test/ui/check-static-values-constraints.nll.stderr index d2f6c7510a91d..f1a2312490813 100644 --- a/src/test/ui/check-static-values-constraints.nll.stderr +++ b/src/test/ui/check-static-values-constraints.nll.stderr @@ -13,44 +13,80 @@ error[E0010]: allocations are not allowed in statics LL | static STATIC11: Box = 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 = 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 + --> $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:95:5 + --> $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:99:6 + --> $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 = box 3; x }; | ^ @@ -59,12 +95,18 @@ LL | let y = { static x: Box = 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 = 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 = box 3; x }; + | ^ + +error: aborting due to 17 previous errors -Some errors occurred: E0010, E0015, E0493, E0507. +Some errors occurred: E0010, E0015, E0019, E0493, E0507. For more information about an error, try `rustc --explain E0010`. diff --git a/src/test/ui/consts/min_const_fn/min_const_fn.nll.stderr b/src/test/ui/consts/min_const_fn/min_const_fn.nll.stderr index 551bc57e5ae7d..91b076097b018 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn.nll.stderr +++ b/src/test/ui/consts/min_const_fn/min_const_fn.nll.stderr @@ -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`. diff --git a/src/test/ui/consts/promote_const_let.nll.stderr b/src/test/ui/consts/promote_const_let.nll.stderr index d8749bb5fd90b..e6ee1523a3b28 100644 --- a/src/test/ui/consts/promote_const_let.nll.stderr +++ b/src/test/ui/consts/promote_const_let.nll.stderr @@ -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 + +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0597`. +Some errors occurred: E0597, E0716. +For more information about an error, try `rustc --explain E0597`. diff --git a/src/test/ui/issues/issue-18118.nll.stderr b/src/test/ui/issues/issue-18118.nll.stderr index d3084b0616776..1920e1637d149 100644 --- a/src/test/ui/issues/issue-18118.nll.stderr +++ b/src/test/ui/issues/issue-18118.nll.stderr @@ -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`.