@@ -13,14 +13,15 @@ LL | static a: RefCell<HashMap<i32, Vec<Vec<Foo<'static, 'static>>>>> = RefC
1313error[E0106]: missing lifetime specifiers
1414 --> $DIR/missing-lifetime-specifier.rs:18:44
1515 |
16- LL | static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new());
17- | ^^^ expected 2 lifetime parameters
18- |
19- = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
20- help: consider using the `'static` lifetime
21- |
22- LL | static a: RefCell<HashMap<i32, Vec<Vec<Foo<'static, 'static>>>>> = RefCell::new(HashMap::new());
23- | ~~~~~~~~~~~~~~~~~~~~~
16+ LL | / thread_local! {
17+ LL | | static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new());
18+ | | ^^^ expected 2 lifetime parameters
19+ LL | |
20+ LL | |
21+ LL | | }
22+ | |_-
23+ |
24+ = help: this function's return type contains a borrowed value, but the signature does not say which one of `init`'s 3 lifetimes it is borrowed from
2425
2526error[E0106]: missing lifetime specifier
2627 --> $DIR/missing-lifetime-specifier.rs:23:44
@@ -49,26 +50,32 @@ LL | static b: RefCell<HashMap<i32, Vec<Vec<&Bar<'static, 'static>>>>> = Ref
4950error[E0106]: missing lifetime specifier
5051 --> $DIR/missing-lifetime-specifier.rs:23:44
5152 |
52- LL | static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
53- | ^ expected named lifetime parameter
54- |
55- = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
56- help: consider using the `'static` lifetime
57- |
58- LL | static b: RefCell<HashMap<i32, Vec<Vec<&'static Bar>>>> = RefCell::new(HashMap::new());
59- | ~~~~~~~~
53+ LL | / thread_local! {
54+ LL | | static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
55+ | | ^ expected named lifetime parameter
56+ LL | |
57+ LL | |
58+ LL | |
59+ LL | |
60+ LL | | }
61+ | |_-
62+ |
63+ = help: this function's return type contains a borrowed value, but the signature does not say which one of `init`'s 4 lifetimes it is borrowed from
6064
6165error[E0106]: missing lifetime specifiers
6266 --> $DIR/missing-lifetime-specifier.rs:23:45
6367 |
64- LL | static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
65- | ^^^ expected 2 lifetime parameters
66- |
67- = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
68- help: consider using the `'static` lifetime
69- |
70- LL | static b: RefCell<HashMap<i32, Vec<Vec<&Bar<'static, 'static>>>>> = RefCell::new(HashMap::new());
71- | ~~~~~~~~~~~~~~~~~~~~~
68+ LL | / thread_local! {
69+ LL | | static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
70+ | | ^^^ expected 2 lifetime parameters
71+ LL | |
72+ LL | |
73+ LL | |
74+ LL | |
75+ LL | | }
76+ | |_-
77+ |
78+ = help: this function's return type contains a borrowed value, but the signature does not say which one of `init`'s 4 lifetimes it is borrowed from
7279
7380error[E0106]: missing lifetime specifiers
7481 --> $DIR/missing-lifetime-specifier.rs:30:48
@@ -85,14 +92,15 @@ LL | static c: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> =
8592error[E0106]: missing lifetime specifiers
8693 --> $DIR/missing-lifetime-specifier.rs:30:48
8794 |
88- LL | static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
89- | ^ expected 2 lifetime parameters
90- |
91- = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
92- help: consider using the `'static` lifetime
95+ LL | / thread_local! {
96+ LL | | static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
97+ | | ^ expected 2 lifetime parameters
98+ LL | |
99+ LL | |
100+ LL | | }
101+ | |_-
93102 |
94- LL | static c: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
95- | +++++++++++++++++
103+ = help: this function's return type contains a borrowed value, but the signature does not say which one of `init`'s 3 lifetimes it is borrowed from
96104
97105error[E0106]: missing lifetime specifier
98106 --> $DIR/missing-lifetime-specifier.rs:35:44
@@ -121,26 +129,50 @@ LL | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'static, i32>>>>>
121129error[E0106]: missing lifetime specifier
122130 --> $DIR/missing-lifetime-specifier.rs:35:44
123131 |
124- LL | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
125- | ^ expected named lifetime parameter
126- |
127- = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
128- help: consider using the `'static` lifetime
129- |
130- LL | static d: RefCell<HashMap<i32, Vec<Vec<&'static Tar<i32>>>>> = RefCell::new(HashMap::new());
131- | ~~~~~~~~
132+ LL | / thread_local! {
133+ LL | | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
134+ | | ^ expected named lifetime parameter
135+ LL | |
136+ LL | |
137+ LL | |
138+ LL | |
139+ LL | | }
140+ | |_-
141+ |
142+ = help: this function's return type contains a borrowed value, but the signature does not say which one of `init`'s 4 lifetimes it is borrowed from
132143
133144error[E0106]: missing lifetime specifiers
134145 --> $DIR/missing-lifetime-specifier.rs:35:49
135146 |
136- LL | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
137- | ^ expected 2 lifetime parameters
147+ LL | / thread_local! {
148+ LL | | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
149+ | | ^ expected 2 lifetime parameters
150+ LL | |
151+ LL | |
152+ LL | |
153+ LL | |
154+ LL | | }
155+ | |_-
156+ |
157+ = help: this function's return type contains a borrowed value, but the signature does not say which one of `init`'s 4 lifetimes it is borrowed from
158+
159+ error[E0107]: this union takes 2 lifetime arguments but 1 lifetime argument was supplied
160+ --> $DIR/missing-lifetime-specifier.rs:43:44
138161 |
139- = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
140- help: consider using the `'static` lifetime
162+ LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, i32>>>>> = RefCell::new(HashMap::new());
163+ | ^^^ ------- supplied 1 lifetime argument
164+ | |
165+ | expected 2 lifetime arguments
141166 |
142- LL | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
143- | +++++++++++++++++
167+ note: union defined here, with 2 lifetime parameters: `'t`, `'k`
168+ --> $DIR/missing-lifetime-specifier.rs:11:11
169+ |
170+ LL | pub union Qux<'t, 'k, I> {
171+ | ^^^ -- --
172+ help: add missing lifetime argument
173+ |
174+ LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, '_, i32>>>>> = RefCell::new(HashMap::new());
175+ | ++++
144176
145177error[E0107]: this union takes 2 lifetime arguments but 1 lifetime argument was supplied
146178 --> $DIR/missing-lifetime-specifier.rs:43:44
@@ -157,7 +189,7 @@ LL | pub union Qux<'t, 'k, I> {
157189 | ^^^ -- --
158190help: add missing lifetime argument
159191 |
160- LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, '_ , i32>>>>> = RefCell::new(HashMap::new());
192+ LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'k , i32>>>>> = RefCell::new(HashMap::new());
161193 | ++++
162194
163195error[E0107]: this union takes 2 lifetime arguments but 1 lifetime argument was supplied
@@ -215,7 +247,7 @@ LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, '_, i32>>>>> = RefC
215247 | ++++
216248
217249error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
218- --> $DIR/missing-lifetime-specifier.rs:50 :45
250+ --> $DIR/missing-lifetime-specifier.rs:51 :45
219251 |
220252LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
221253 | ^^^ ------- supplied 1 lifetime argument
@@ -233,7 +265,7 @@ LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, '_, i32>>>>> = Ref
233265 | ++++
234266
235267error[E0106]: missing lifetime specifier
236- --> $DIR/missing-lifetime-specifier.rs:50 :44
268+ --> $DIR/missing-lifetime-specifier.rs:51 :44
237269 |
238270LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
239271 | ^ expected named lifetime parameter
@@ -245,7 +277,7 @@ LL | static f: RefCell<HashMap<i32, Vec<Vec<&'static Tar<'static, i32>>>>> =
245277 | ~~~~~~~~
246278
247279error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
248- --> $DIR/missing-lifetime-specifier.rs:50 :45
280+ --> $DIR/missing-lifetime-specifier.rs:51 :45
249281 |
250282LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
251283 | ^^^ ------- supplied 1 lifetime argument
@@ -263,19 +295,40 @@ LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'k, i32>>>>> = Ref
263295 | ++++
264296
265297error[E0106]: missing lifetime specifier
266- --> $DIR/missing-lifetime-specifier.rs:50:44
298+ --> $DIR/missing-lifetime-specifier.rs:51:44
299+ |
300+ LL | / thread_local! {
301+ LL | | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
302+ | | ^ expected named lifetime parameter
303+ LL | |
304+ LL | |
305+ ... |
306+ LL | |
307+ LL | | }
308+ | |_-
309+ |
310+ = help: this function's return type contains a borrowed value, but the signature does not say which one of `init`'s 3 lifetimes it is borrowed from
311+
312+ error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
313+ --> $DIR/missing-lifetime-specifier.rs:51:45
267314 |
268315LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
269- | ^ expected named lifetime parameter
316+ | ^^^ ------- supplied 1 lifetime argument
317+ | |
318+ | expected 2 lifetime arguments
270319 |
271- = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
272- help: consider using the `'static` lifetime
320+ note: trait defined here, with 2 lifetime parameters: `'t`, `'k`
321+ --> $DIR/missing- lifetime-specifier.rs:15:7
273322 |
274- LL | static f: RefCell<HashMap<i32, Vec<Vec<&'static Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
275- | ~~~~~~~~
323+ LL | trait Tar<'t, 'k, I> {}
324+ | ^^^ -- --
325+ help: add missing lifetime argument
326+ |
327+ LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'k, i32>>>>> = RefCell::new(HashMap::new());
328+ | ++++
276329
277330error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
278- --> $DIR/missing-lifetime-specifier.rs:50 :45
331+ --> $DIR/missing-lifetime-specifier.rs:51 :45
279332 |
280333LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
281334 | ^^^ ------- supplied 1 lifetime argument
@@ -293,7 +346,7 @@ LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'k, i32>>>>> = Ref
293346 | ++++
294347
295348error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
296- --> $DIR/missing-lifetime-specifier.rs:50 :45
349+ --> $DIR/missing-lifetime-specifier.rs:51 :45
297350 |
298351LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
299352 | ^^^ ------- supplied 1 lifetime argument
@@ -310,7 +363,7 @@ help: add missing lifetime argument
310363LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, '_, i32>>>>> = RefCell::new(HashMap::new());
311364 | ++++
312365
313- error: aborting due to 22 previous errors
366+ error: aborting due to 24 previous errors
314367
315368Some errors have detailed explanations: E0106, E0107.
316369For more information about an error, try `rustc --explain E0106`.
0 commit comments