]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/user-annotations/patterns.stderr
Auto merge of #106711 - albertlarsan68:use-ci-llvm-when-lld, r=jyn514
[rust.git] / tests / ui / nll / user-annotations / patterns.stderr
1 error[E0597]: `x` does not live long enough
2   --> $DIR/patterns.rs:6:9
3    |
4 LL |     let y: &'static u32;
5    |            ------------ type annotation requires that `x` is borrowed for `'static`
6 LL |     y = &x;
7    |         ^^ borrowed value does not live long enough
8 LL | }
9    | - `x` dropped here while still borrowed
10
11 error[E0597]: `x` does not live long enough
12   --> $DIR/patterns.rs:14:9
13    |
14 LL |     let (y, z): (&'static u32, &'static u32);
15    |                 ---------------------------- type annotation requires that `x` is borrowed for `'static`
16 LL |     y = &x;
17    |         ^^ borrowed value does not live long enough
18 LL | }
19    | - `x` dropped here while still borrowed
20
21 error[E0597]: `x` does not live long enough
22   --> $DIR/patterns.rs:20:13
23    |
24 LL |     let y = &x;
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`
28 LL |     **z
29 LL | }
30    | - `x` dropped here while still borrowed
31
32 error[E0597]: `x` does not live long enough
33   --> $DIR/patterns.rs:39:9
34    |
35 LL |     let Single { value: y }: Single<&'static u32>;
36    |                              -------------------- type annotation requires that `x` is borrowed for `'static`
37 LL |     y = &x;
38    |         ^^ borrowed value does not live long enough
39 LL | }
40    | - `x` dropped here while still borrowed
41
42 error[E0597]: `x` does not live long enough
43   --> $DIR/patterns.rs:51:10
44    |
45 LL |     let Single2 { value: mut _y }: Single2<StaticU32>;
46    |                                    ------------------ type annotation requires that `x` is borrowed for `'static`
47 LL |     _y = &x;
48    |          ^^ borrowed value does not live long enough
49 LL | }
50    | - `x` dropped here while still borrowed
51
52 error[E0597]: `x` does not live long enough
53   --> $DIR/patterns.rs:56:27
54    |
55 LL |     let y: &'static u32 = &x;
56    |            ------------   ^^ borrowed value does not live long enough
57    |            |
58    |            type annotation requires that `x` is borrowed for `'static`
59 LL | }
60    | - `x` dropped here while still borrowed
61
62 error[E0597]: `x` does not live long enough
63   --> $DIR/patterns.rs:61:27
64    |
65 LL |     let _: &'static u32 = &x;
66    |            ------------   ^^ borrowed value does not live long enough
67    |            |
68    |            type annotation requires that `x` is borrowed for `'static`
69 ...
70 LL | }
71    | - `x` dropped here while still borrowed
72
73 error[E0716]: temporary value dropped while borrowed
74   --> $DIR/patterns.rs:63:41
75    |
76 LL |     let _: Vec<&'static String> = vec![&String::new()];
77    |            --------------------         ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
78    |            |                            |
79    |            |                            creates a temporary value which is freed while still in use
80    |            type annotation requires that borrow lasts for `'static`
81
82 error[E0716]: temporary value dropped while borrowed
83   --> $DIR/patterns.rs:66:52
84    |
85 LL |     let (_, a): (Vec<&'static String>, _) = (vec![&String::new()], 44);
86    |                 -------------------------          ^^^^^^^^^^^^^      - temporary value is freed at the end of this statement
87    |                 |                                  |
88    |                 |                                  creates a temporary value which is freed while still in use
89    |                 type annotation requires that borrow lasts for `'static`
90
91 error[E0716]: temporary value dropped while borrowed
92   --> $DIR/patterns.rs:69:53
93    |
94 LL |     let (_a, b): (Vec<&'static String>, _) = (vec![&String::new()], 44);
95    |                  -------------------------          ^^^^^^^^^^^^^      - temporary value is freed at the end of this statement
96    |                  |                                  |
97    |                  |                                  creates a temporary value which is freed while still in use
98    |                  type annotation requires that borrow lasts for `'static`
99
100 error[E0597]: `x` does not live long enough
101   --> $DIR/patterns.rs:75:40
102    |
103 LL |     let (_, _): (&'static u32, u32) = (&x, 44);
104    |                 -------------------    ^^ borrowed value does not live long enough
105    |                 |
106    |                 type annotation requires that `x` is borrowed for `'static`
107 LL | }
108    | - `x` dropped here while still borrowed
109
110 error[E0597]: `x` does not live long enough
111   --> $DIR/patterns.rs:80:40
112    |
113 LL |     let (y, _): (&'static u32, u32) = (&x, 44);
114    |                 -------------------    ^^ borrowed value does not live long enough
115    |                 |
116    |                 type annotation requires that `x` is borrowed for `'static`
117 LL | }
118    | - `x` dropped here while still borrowed
119
120 error[E0597]: `x` does not live long enough
121   --> $DIR/patterns.rs:85:69
122    |
123 LL |     let Single { value: y }: Single<&'static u32> = Single { value: &x };
124    |                              --------------------                   ^^ borrowed value does not live long enough
125    |                              |
126    |                              type annotation requires that `x` is borrowed for `'static`
127 LL | }
128    | - `x` dropped here while still borrowed
129
130 error[E0597]: `x` does not live long enough
131   --> $DIR/patterns.rs:90:69
132    |
133 LL |     let Single { value: _ }: Single<&'static u32> = Single { value: &x };
134    |                              --------------------                   ^^ borrowed value does not live long enough
135    |                              |
136    |                              type annotation requires that `x` is borrowed for `'static`
137 LL | }
138    | - `x` dropped here while still borrowed
139
140 error[E0597]: `x` does not live long enough
141   --> $DIR/patterns.rs:98:17
142    |
143 LL |     let Double { value1: _, value2: _ }: Double<&'static u32> = Double {
144    |                                          -------------------- type annotation requires that `x` is borrowed for `'static`
145 LL |         value1: &x,
146    |                 ^^ borrowed value does not live long enough
147 ...
148 LL | }
149    | - `x` dropped here while still borrowed
150
151 error: lifetime may not live long enough
152   --> $DIR/patterns.rs:111:5
153    |
154 LL | fn static_to_a_to_static_through_variable<'a>(x: &'a u32) -> &'static u32 {
155    |                                           -- lifetime `'a` defined here
156 ...
157 LL |     y
158    |     ^ returning this value requires that `'a` must outlive `'static`
159
160 error: lifetime may not live long enough
161   --> $DIR/patterns.rs:123:5
162    |
163 LL | fn static_to_a_to_static_through_tuple<'a>(x: &'a u32) -> &'static u32 {
164    |                                        -- lifetime `'a` defined here
165 ...
166 LL |     y
167    |     ^ returning this value requires that `'a` must outlive `'static`
168
169 error: lifetime may not live long enough
170   --> $DIR/patterns.rs:128:5
171    |
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 };
175 LL |     y
176    |     ^ returning this value requires that `'a` must outlive `'static`
177
178 error: lifetime may not live long enough
179   --> $DIR/patterns.rs:132:18
180    |
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`
185
186 error: aborting due to 19 previous errors
187
188 Some errors have detailed explanations: E0597, E0716.
189 For more information about an error, try `rustc --explain E0597`.