1 error[E0597]: `x` does not live long enough
2 --> $DIR/patterns.rs:6:9
4 LL | let y: &'static u32;
5 | ------------ type annotation requires that `x` is borrowed for `'static`
7 | ^^ borrowed value does not live long enough
9 | - `x` dropped here while still borrowed
11 error[E0597]: `x` does not live long enough
12 --> $DIR/patterns.rs:14:9
14 LL | let (y, z): (&'static u32, &'static u32);
15 | ---------------------------- type annotation requires that `x` is borrowed for `'static`
17 | ^^ borrowed value does not live long enough
19 | - `x` dropped here while still borrowed
21 error[E0597]: `x` does not live long enough
22 --> $DIR/patterns.rs:20:13
25 | ^^ borrowed value does not live long enough
26 LL | let ref z: &'static u32 = y;
27 | ------------ type annotation requires that `x` is borrowed for `'static`
30 | - `x` dropped here while still borrowed
32 error[E0597]: `x` does not live long enough
33 --> $DIR/patterns.rs:39:9
35 LL | let Single { value: y }: Single<&'static u32>;
36 | -------------------- type annotation requires that `x` is borrowed for `'static`
38 | ^^ borrowed value does not live long enough
40 | - `x` dropped here while still borrowed
42 error[E0597]: `x` does not live long enough
43 --> $DIR/patterns.rs:51:10
45 LL | let Single2 { value: mut _y }: Single2<StaticU32>;
46 | ------------------ type annotation requires that `x` is borrowed for `'static`
48 | ^^ borrowed value does not live long enough
50 | - `x` dropped here while still borrowed
52 error[E0597]: `x` does not live long enough
53 --> $DIR/patterns.rs:56:27
55 LL | let y: &'static u32 = &x;
56 | ------------ ^^ borrowed value does not live long enough
58 | type annotation requires that `x` is borrowed for `'static`
60 | - `x` dropped here while still borrowed
62 error[E0597]: `x` does not live long enough
63 --> $DIR/patterns.rs:61:27
65 LL | let _: &'static u32 = &x;
66 | ------------ ^^ borrowed value does not live long enough
68 | type annotation requires that `x` is borrowed for `'static`
71 | - `x` dropped here while still borrowed
73 error[E0716]: temporary value dropped while borrowed
74 --> $DIR/patterns.rs:63:41
76 LL | let _: Vec<&'static String> = vec![&String::new()];
77 | -------------------- ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
79 | | creates a temporary which is freed while still in use
80 | type annotation requires that borrow lasts for `'static`
82 error[E0716]: temporary value dropped while borrowed
83 --> $DIR/patterns.rs:66:52
85 LL | let (_, a): (Vec<&'static String>, _) = (vec![&String::new()], 44);
86 | ------------------------- ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
88 | | creates a temporary which is freed while still in use
89 | type annotation requires that borrow lasts for `'static`
91 error[E0716]: temporary value dropped while borrowed
92 --> $DIR/patterns.rs:69:53
94 LL | let (_a, b): (Vec<&'static String>, _) = (vec![&String::new()], 44);
95 | ------------------------- ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
97 | | creates a temporary which is freed while still in use
98 | type annotation requires that borrow lasts for `'static`
100 error[E0597]: `x` does not live long enough
101 --> $DIR/patterns.rs:75:40
103 LL | let (_, _): (&'static u32, u32) = (&x, 44);
104 | ------------------- ^^ borrowed value does not live long enough
106 | type annotation requires that `x` is borrowed for `'static`
108 | - `x` dropped here while still borrowed
110 error[E0597]: `x` does not live long enough
111 --> $DIR/patterns.rs:80:40
113 LL | let (y, _): (&'static u32, u32) = (&x, 44);
114 | ------------------- ^^ borrowed value does not live long enough
116 | type annotation requires that `x` is borrowed for `'static`
118 | - `x` dropped here while still borrowed
120 error[E0597]: `x` does not live long enough
121 --> $DIR/patterns.rs:85:69
123 LL | let Single { value: y }: Single<&'static u32> = Single { value: &x };
124 | -------------------- ^^ borrowed value does not live long enough
126 | type annotation requires that `x` is borrowed for `'static`
128 | - `x` dropped here while still borrowed
130 error[E0597]: `x` does not live long enough
131 --> $DIR/patterns.rs:90:69
133 LL | let Single { value: _ }: Single<&'static u32> = Single { value: &x };
134 | -------------------- ^^ borrowed value does not live long enough
136 | type annotation requires that `x` is borrowed for `'static`
138 | - `x` dropped here while still borrowed
140 error[E0597]: `x` does not live long enough
141 --> $DIR/patterns.rs:98:17
143 LL | let Double { value1: _, value2: _ }: Double<&'static u32> = Double {
144 | -------------------- type annotation requires that `x` is borrowed for `'static`
146 | ^^ borrowed value does not live long enough
149 | - `x` dropped here while still borrowed
151 error: lifetime may not live long enough
152 --> $DIR/patterns.rs:111:5
154 LL | fn static_to_a_to_static_through_variable<'a>(x: &'a u32) -> &'static u32 {
155 | -- lifetime `'a` defined here
158 | ^ returning this value requires that `'a` must outlive `'static`
160 error: lifetime may not live long enough
161 --> $DIR/patterns.rs:123:5
163 LL | fn static_to_a_to_static_through_tuple<'a>(x: &'a u32) -> &'static u32 {
164 | -- lifetime `'a` defined here
167 | ^ returning this value requires that `'a` must outlive `'static`
169 error: lifetime may not live long enough
170 --> $DIR/patterns.rs:128:5
172 LL | fn static_to_a_to_static_through_struct<'a>(_x: &'a u32) -> &'static u32 {
173 | -- lifetime `'a` defined here
174 LL | let Single { value: y }: Single<&'a u32> = Single { value: &22 };
176 | ^ returning this value requires that `'a` must outlive `'static`
178 error: lifetime may not live long enough
179 --> $DIR/patterns.rs:132:18
181 LL | fn a_to_static_then_static<'a>(x: &'a u32) -> &'static u32 {
182 | -- lifetime `'a` defined here
183 LL | let (y, _z): (&'static u32, u32) = (x, 44);
184 | ^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
186 error: aborting due to 19 previous errors
188 Some errors have detailed explanations: E0597, E0716.
189 For more information about an error, try `rustc --explain E0597`.