]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/promote_const_let.nll.stderr
New upstream version 1.33.0+dfsg1
[rustc.git] / src / test / ui / consts / promote_const_let.nll.stderr
CommitLineData
a1dfa0c6 1error[E0597]: `y` does not live long enough
0731742a 2 --> $DIR/promote_const_let.rs:4:9
a1dfa0c6
XL
3 |
4LL | let x: &'static u32 = {
5 | ------------ type annotation requires that `y` is borrowed for `'static`
6LL | let y = 42;
7LL | &y //~ ERROR does not live long enough
8 | ^^ borrowed value does not live long enough
9LL | };
10 | - `y` dropped here while still borrowed
11
0731742a
XL
12error[E0716]: temporary value dropped while borrowed
13 --> $DIR/promote_const_let.rs:6:28
14 |
15LL | let x: &'static u32 = &{ //~ ERROR does not live long enough
16 | ____________------------____^
17 | | |
18 | | type annotation requires that borrow lasts for `'static`
19LL | | let y = 42;
20LL | | y
21LL | | };
22 | |_____^ creates a temporary which is freed while still in use
23LL | }
24 | - temporary value is freed at the end of this statement
25
26error: aborting due to 2 previous errors
a1dfa0c6 27
0731742a
XL
28Some errors occurred: E0597, E0716.
29For more information about an error, try `rustc --explain E0597`.