]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/promoted_const_call2.stderr
Rollup merge of #106699 - eholk:await-chains-drop-tracking, r=wesleywiser
[rust.git] / tests / ui / consts / promoted_const_call2.stderr
1 error[E0716]: temporary value dropped while borrowed
2   --> $DIR/promoted_const_call2.rs:4:26
3    |
4 LL |     let _: &'static _ = &id(&String::new());
5    |            ----------    ^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
6    |            |
7    |            type annotation requires that borrow lasts for `'static`
8 ...
9 LL | };
10    | - temporary value is freed at the end of this statement
11
12 error[E0716]: temporary value dropped while borrowed
13   --> $DIR/promoted_const_call2.rs:4:30
14    |
15 LL |     let _: &'static _ = &id(&String::new());
16    |            ----------        ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
17    |            |                 |
18    |            |                 creates a temporary value which is freed while still in use
19    |            type annotation requires that borrow lasts for `'static`
20
21 error[E0716]: temporary value dropped while borrowed
22   --> $DIR/promoted_const_call2.rs:11:26
23    |
24 LL |     let _: &'static _ = &id(&String::new());
25    |            ----------    ^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
26    |            |
27    |            type annotation requires that borrow lasts for `'static`
28 ...
29 LL | }
30    | - temporary value is freed at the end of this statement
31
32 error[E0716]: temporary value dropped while borrowed
33   --> $DIR/promoted_const_call2.rs:11:30
34    |
35 LL |     let _: &'static _ = &id(&String::new());
36    |            ----------        ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
37    |            |                 |
38    |            |                 creates a temporary value which is freed while still in use
39    |            type annotation requires that borrow lasts for `'static`
40
41 error[E0493]: destructor of `String` cannot be evaluated at compile-time
42   --> $DIR/promoted_const_call2.rs:4:30
43    |
44 LL |     let _: &'static _ = &id(&String::new());
45    |                              ^^^^^^^^^^^^^ the destructor for this type cannot be evaluated in constants
46
47 error: aborting due to 5 previous errors
48
49 Some errors have detailed explanations: E0493, E0716.
50 For more information about an error, try `rustc --explain E0493`.