1 error[E0716]: temporary value dropped while borrowed
2 --> $DIR/promote-not.rs:8:50
4 LL | static mut TEST1: Option<&mut [i32]> = Some(&mut [1, 2, 3]);
7 | | | temporary value is freed at the end of this statement
8 | | creates a temporary which is freed while still in use
9 | using this value as a static requires that borrow lasts for `'static`
11 error[E0716]: temporary value dropped while borrowed
12 --> $DIR/promote-not.rs:11:18
14 LL | let x = &mut [1,2,3];
15 | ^^^^^^^ creates a temporary which is freed while still in use
17 | - using this value as a static requires that borrow lasts for `'static`
19 | - temporary value is freed at the end of this statement
21 error[E0716]: temporary value dropped while borrowed
22 --> $DIR/promote-not.rs:20:32
24 LL | let _x: &'static () = &foo();
25 | ----------- ^^^^^ creates a temporary which is freed while still in use
27 | type annotation requires that borrow lasts for `'static`
29 | - temporary value is freed at the end of this statement
31 error[E0716]: temporary value dropped while borrowed
32 --> $DIR/promote-not.rs:28:29
34 LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
35 | ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
37 | type annotation requires that borrow lasts for `'static`
39 | - temporary value is freed at the end of this statement
41 error[E0716]: temporary value dropped while borrowed
42 --> $DIR/promote-not.rs:33:29
44 LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
45 | ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
47 | type annotation requires that borrow lasts for `'static`
49 | - temporary value is freed at the end of this statement
51 error[E0716]: temporary value dropped while borrowed
52 --> $DIR/promote-not.rs:39:29
54 LL | let _val: &'static _ = &(Cell::new(1), 2).1;
55 | ---------- ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
57 | type annotation requires that borrow lasts for `'static`
59 | - temporary value is freed at the end of this statement
61 error[E0716]: temporary value dropped while borrowed
62 --> $DIR/promote-not.rs:46:29
64 LL | let _val: &'static _ = &(Cell::new(1), 2).0;
65 | ---------- ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
67 | type annotation requires that borrow lasts for `'static`
70 | - temporary value is freed at the end of this statement
72 error[E0716]: temporary value dropped while borrowed
73 --> $DIR/promote-not.rs:47:29
75 LL | let _val: &'static _ = &(Cell::new(1), 2).1;
76 | ---------- ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
78 | type annotation requires that borrow lasts for `'static`
81 | - temporary value is freed at the end of this statement
83 error[E0716]: temporary value dropped while borrowed
84 --> $DIR/promote-not.rs:50:29
86 LL | let _val: &'static _ = &(1/0);
87 | ---------- ^^^^^ creates a temporary which is freed while still in use
89 | type annotation requires that borrow lasts for `'static`
92 | - temporary value is freed at the end of this statement
94 error[E0716]: temporary value dropped while borrowed
95 --> $DIR/promote-not.rs:51:29
97 LL | let _val: &'static _ = &(1/(1-1));
98 | ---------- ^^^^^^^^^ creates a temporary which is freed while still in use
100 | type annotation requires that borrow lasts for `'static`
103 | - temporary value is freed at the end of this statement
105 error[E0716]: temporary value dropped while borrowed
106 --> $DIR/promote-not.rs:52:29
108 LL | let _val: &'static _ = &(1%0);
109 | ---------- ^^^^^ creates a temporary which is freed while still in use
111 | type annotation requires that borrow lasts for `'static`
114 | - temporary value is freed at the end of this statement
116 error[E0716]: temporary value dropped while borrowed
117 --> $DIR/promote-not.rs:53:29
119 LL | let _val: &'static _ = &(1%(1-1));
120 | ---------- ^^^^^^^^^ creates a temporary which is freed while still in use
122 | type annotation requires that borrow lasts for `'static`
125 | - temporary value is freed at the end of this statement
127 error[E0716]: temporary value dropped while borrowed
128 --> $DIR/promote-not.rs:54:29
130 LL | let _val: &'static _ = &([1,2,3][4]+1);
131 | ---------- ^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
133 | type annotation requires that borrow lasts for `'static`
136 | - temporary value is freed at the end of this statement
138 error[E0716]: temporary value dropped while borrowed
139 --> $DIR/promote-not.rs:57:29
141 LL | let _val: &'static _ = &TEST_DROP;
142 | ---------- ^^^^^^^^^ creates a temporary which is freed while still in use
144 | type annotation requires that borrow lasts for `'static`
147 | - temporary value is freed at the end of this statement
149 error[E0716]: temporary value dropped while borrowed
150 --> $DIR/promote-not.rs:59:29
152 LL | let _val: &'static _ = &&TEST_DROP;
153 | ---------- ^^^^^^^^^^ creates a temporary which is freed while still in use
155 | type annotation requires that borrow lasts for `'static`
158 | - temporary value is freed at the end of this statement
160 error[E0716]: temporary value dropped while borrowed
161 --> $DIR/promote-not.rs:59:30
163 LL | let _val: &'static _ = &&TEST_DROP;
164 | ---------- ^^^^^^^^^ creates a temporary which is freed while still in use
166 | type annotation requires that borrow lasts for `'static`
169 | - temporary value is freed at the end of this statement
171 error[E0716]: temporary value dropped while borrowed
172 --> $DIR/promote-not.rs:62:29
174 LL | let _val: &'static _ = &(&TEST_DROP,);
175 | ---------- ^^^^^^^^^^^^^ creates a temporary which is freed while still in use
177 | type annotation requires that borrow lasts for `'static`
180 | - temporary value is freed at the end of this statement
182 error[E0716]: temporary value dropped while borrowed
183 --> $DIR/promote-not.rs:62:31
185 LL | let _val: &'static _ = &(&TEST_DROP,);
186 | ---------- ^^^^^^^^^ creates a temporary which is freed while still in use
188 | type annotation requires that borrow lasts for `'static`
191 | - temporary value is freed at the end of this statement
193 error[E0716]: temporary value dropped while borrowed
194 --> $DIR/promote-not.rs:65:29
196 LL | let _val: &'static _ = &[&TEST_DROP; 1];
197 | ---------- ^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
199 | type annotation requires that borrow lasts for `'static`
202 | - temporary value is freed at the end of this statement
204 error[E0716]: temporary value dropped while borrowed
205 --> $DIR/promote-not.rs:65:31
207 LL | let _val: &'static _ = &[&TEST_DROP; 1];
208 | ---------- ^^^^^^^^^ - temporary value is freed at the end of this statement
210 | | creates a temporary which is freed while still in use
211 | type annotation requires that borrow lasts for `'static`
213 error: aborting due to 20 previous errors
215 For more information about this error, try `rustc --explain E0716`.