| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:10:46 |
| | |
| LL | static mut TEST1: &mut [i32] = identity(&mut [1, 2, 3]); |
| | --------------^^^^^^^^^- |
| | | | | |
| | | | temporary value is freed at the end of this statement |
| | | creates a temporary value which is freed while still in use |
| | using this value as a static requires that borrow lasts for `'static` |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:13:18 |
| | |
| LL | let x = &mut [1,2,3]; |
| | ^^^^^^^ creates a temporary value which is freed while still in use |
| LL | x |
| | - using this value as a static requires that borrow lasts for `'static` |
| LL | }; |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:35:29 |
| | |
| LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x }; |
| | ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| LL | }; |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:41:29 |
| | |
| LL | let _val: &'static _ = &(Cell::new(1), 2).1; |
| | ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| LL | }; |
| | - temporary value is freed at the end of this statement |
| |
| error[E0493]: destructor of `String` cannot be evaluated at compile-time |
| --> $DIR/promote-not.rs:48:14 |
| | |
| LL | let x = &String::new(); |
| | ^^^^^^^^^^^^^ the destructor for this type cannot be evaluated in constants |
| ... |
| LL | }; |
| | - value is dropped here |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:60:33 |
| | |
| LL | let _x: &'static u32 = &mk_panic(); |
| | ------------ ^^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:22:32 |
| | |
| LL | let _x: &'static () = &foo(); |
| | ----------- ^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:30:29 |
| | |
| LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x }; |
| | ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:66:29 |
| | |
| LL | let _val: &'static _ = &(Cell::new(1), 2).0; |
| | ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:67:29 |
| | |
| LL | let _val: &'static _ = &(Cell::new(1), 2).1; |
| | ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:70:29 |
| | |
| LL | let _val: &'static _ = &(1/0); |
| | ---------- ^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:71:29 |
| | |
| LL | let _val: &'static _ = &(1/(1-1)); |
| | ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:72:29 |
| | |
| LL | let _val: &'static _ = &((1+1)/(1-1)); |
| | ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:73:29 |
| | |
| LL | let _val: &'static _ = &(i32::MIN/-1); |
| | ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:74:29 |
| | |
| LL | let _val: &'static _ = &(i32::MIN/(0-1)); |
| | ---------- ^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:75:29 |
| | |
| LL | let _val: &'static _ = &(-128i8/-1); |
| | ---------- ^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:76:29 |
| | |
| LL | let _val: &'static _ = &(1%0); |
| | ---------- ^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:77:29 |
| | |
| LL | let _val: &'static _ = &(1%(1-1)); |
| | ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:78:29 |
| | |
| LL | let _val: &'static _ = &([1,2,3][4]+1); |
| | ---------- ^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:82:29 |
| | |
| LL | let _val: &'static _ = &TEST_DROP; |
| | ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:84:29 |
| | |
| LL | let _val: &'static _ = &&TEST_DROP; |
| | ---------- ^^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:84:30 |
| | |
| LL | let _val: &'static _ = &&TEST_DROP; |
| | ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:87:29 |
| | |
| LL | let _val: &'static _ = &(&TEST_DROP,); |
| | ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:87:31 |
| | |
| LL | let _val: &'static _ = &(&TEST_DROP,); |
| | ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:90:29 |
| | |
| LL | let _val: &'static _ = &[&TEST_DROP; 1]; |
| | ---------- ^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| ... |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:90:31 |
| | |
| LL | let _val: &'static _ = &[&TEST_DROP; 1]; |
| | ---------- ^^^^^^^^^ - temporary value is freed at the end of this statement |
| | | | |
| | | creates a temporary value which is freed while still in use |
| | type annotation requires that borrow lasts for `'static` |
| |
| error[E0716]: temporary value dropped while borrowed |
| --> $DIR/promote-not.rs:99:26 |
| | |
| LL | let x: &'static _ = &UnionWithCell { f1: 0 }; |
| | ---------- ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| | | |
| | type annotation requires that borrow lasts for `'static` |
| LL | |
| LL | } |
| | - temporary value is freed at the end of this statement |
| |
| error: aborting due to 27 previous errors |
| |
| Some errors have detailed explanations: E0493, E0716. |
| For more information about an error, try `rustc --explain E0493`. |