1 error[E0716]: temporary value dropped while borrowed
2 --> $DIR/promoted_const_call2.rs:4:26
4 LL | let _: &'static _ = &id(&String::new());
5 | ---------- ^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
7 | type annotation requires that borrow lasts for `'static`
10 | - temporary value is freed at the end of this statement
12 error[E0716]: temporary value dropped while borrowed
13 --> $DIR/promoted_const_call2.rs:4:30
15 LL | let _: &'static _ = &id(&String::new());
16 | ---------- ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
18 | | creates a temporary value which is freed while still in use
19 | type annotation requires that borrow lasts for `'static`
21 error[E0716]: temporary value dropped while borrowed
22 --> $DIR/promoted_const_call2.rs:11:26
24 LL | let _: &'static _ = &id(&String::new());
25 | ---------- ^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
27 | type annotation requires that borrow lasts for `'static`
30 | - temporary value is freed at the end of this statement
32 error[E0716]: temporary value dropped while borrowed
33 --> $DIR/promoted_const_call2.rs:11:30
35 LL | let _: &'static _ = &id(&String::new());
36 | ---------- ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
38 | | creates a temporary value which is freed while still in use
39 | type annotation requires that borrow lasts for `'static`
41 error[E0493]: destructor of `String` cannot be evaluated at compile-time
42 --> $DIR/promoted_const_call2.rs:4:30
44 LL | let _: &'static _ = &id(&String::new());
45 | ^^^^^^^^^^^^^ the destructor for this type cannot be evaluated in constants
47 error: aborting due to 5 previous errors
49 Some errors have detailed explanations: E0493, E0716.
50 For more information about an error, try `rustc --explain E0493`.