Skip to content

Commit 6df8d0d

Browse files
committed
fix UI test
1 parent 1052d29 commit 6df8d0d

File tree

2 files changed

+21
-91
lines changed

2 files changed

+21
-91
lines changed

tests/ui/suggestions/missing-lifetime-specifier.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
// different number of duplicated diagnostics on different targets
2-
//@ only-x86_64
3-
//@ only-linux
1+
// The specific errors produced depend the thread-local implementation.
2+
// Run only on platforms with "fast" TLS.
3+
//@ ignore-windows FIXME(#84933)
4+
//@ ignore-wasm globals are used instead of thread locals
5+
//@ ignore-emscripten globals are used instead of thread locals
6+
//@ ignore-android does not use #[thread_local]
7+
//@ ignore-nto does not use #[thread_local]
8+
// Different number of duplicated diagnostics on different targets
49
//@ compile-flags: -Zdeduplicate-diagnostics=yes
510

611
#![allow(bare_trait_objects)]
@@ -21,23 +26,19 @@ trait Tar<'t, 'k, I> {}
2126

2227
thread_local! {
2328
static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new());
24-
//~^ ERROR missing lifetime specifiers
25-
//~| ERROR missing lifetime specifiers
29+
//~^ ERROR missing lifetime specifiers
2630
}
2731
thread_local! {
2832
static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
29-
//~^ ERROR missing lifetime specifiers
30-
//~| ERROR missing lifetime specifiers
33+
//~^ ERROR missing lifetime specifiers
3134
}
3235
thread_local! {
3336
static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
3437
//~^ ERROR missing lifetime specifiers
35-
//~| ERROR missing lifetime specifiers
3638
}
3739
thread_local! {
3840
static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
3941
//~^ ERROR missing lifetime specifiers
40-
//~| ERROR missing lifetime specifiers
4142
}
4243

4344
thread_local! {
@@ -47,8 +48,7 @@ thread_local! {
4748
thread_local! {
4849
static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
4950
//~^ ERROR trait takes 2 lifetime arguments but 1 lifetime argument was supplied
50-
//~| ERROR missing lifetime
51-
//~| ERROR missing lifetime
51+
//~| ERROR missing lifetime specifier
5252
}
5353

5454
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0106]: missing lifetime specifiers
2-
--> $DIR/missing-lifetime-specifier.rs:23:44
2+
--> $DIR/missing-lifetime-specifier.rs:28:44
33
|
44
LL | static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new());
55
| ^^^ expected 2 lifetime parameters
@@ -11,20 +11,7 @@ LL | static a: RefCell<HashMap<i32, Vec<Vec<Foo<'static, 'static>>>>> = RefC
1111
| ++++++++++++++++++
1212

1313
error[E0106]: missing lifetime specifiers
14-
--> $DIR/missing-lifetime-specifier.rs:23:44
15-
|
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
25-
26-
error[E0106]: missing lifetime specifiers
27-
--> $DIR/missing-lifetime-specifier.rs:28:44
14+
--> $DIR/missing-lifetime-specifier.rs:32:44
2815
|
2916
LL | static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
3017
| ^^^^ expected 2 lifetime parameters
@@ -38,22 +25,7 @@ LL | static b: RefCell<HashMap<i32, Vec<Vec<&'static Bar<'static, 'static>>>
3825
| +++++++ ++++++++++++++++++
3926

4027
error[E0106]: missing lifetime specifiers
41-
--> $DIR/missing-lifetime-specifier.rs:28:44
42-
|
43-
LL | / thread_local! {
44-
LL | | static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
45-
| | ^^^^ expected 2 lifetime parameters
46-
| | |
47-
| | expected named lifetime parameter
48-
LL | |
49-
LL | |
50-
LL | | }
51-
| |_-
52-
|
53-
= 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
54-
55-
error[E0106]: missing lifetime specifiers
56-
--> $DIR/missing-lifetime-specifier.rs:33:47
28+
--> $DIR/missing-lifetime-specifier.rs:36:47
5729
|
5830
LL | static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
5931
| ^ expected 2 lifetime parameters
@@ -65,20 +37,7 @@ LL | static c: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> =
6537
| +++++++++++++++++
6638

6739
error[E0106]: missing lifetime specifiers
68-
--> $DIR/missing-lifetime-specifier.rs:33:47
69-
|
70-
LL | / thread_local! {
71-
LL | | static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
72-
| | ^ expected 2 lifetime parameters
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 3 lifetimes it is borrowed from
79-
80-
error[E0106]: missing lifetime specifiers
81-
--> $DIR/missing-lifetime-specifier.rs:38:44
40+
--> $DIR/missing-lifetime-specifier.rs:40:44
8241
|
8342
LL | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
8443
| ^ ^ expected 2 lifetime parameters
@@ -91,23 +50,8 @@ help: consider using the `'static` lifetime, but this is uncommon unless you're
9150
LL | static d: RefCell<HashMap<i32, Vec<Vec<&'static Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
9251
| +++++++ +++++++++++++++++
9352

94-
error[E0106]: missing lifetime specifiers
95-
--> $DIR/missing-lifetime-specifier.rs:38:44
96-
|
97-
LL | / thread_local! {
98-
LL | | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
99-
| | ^ ^ expected 2 lifetime parameters
100-
| | |
101-
| | expected named lifetime parameter
102-
LL | |
103-
LL | |
104-
LL | | }
105-
| |_-
106-
|
107-
= 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
108-
10953
error[E0106]: missing lifetime specifier
110-
--> $DIR/missing-lifetime-specifier.rs:48:44
54+
--> $DIR/missing-lifetime-specifier.rs:49:44
11155
|
11256
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
11357
| ^ expected named lifetime parameter
@@ -118,30 +62,16 @@ help: consider using the `'static` lifetime, but this is uncommon unless you're
11862
LL | static f: RefCell<HashMap<i32, Vec<Vec<&'static Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
11963
| +++++++
12064

121-
error[E0106]: missing lifetime specifier
122-
--> $DIR/missing-lifetime-specifier.rs:48:44
123-
|
124-
LL | / thread_local! {
125-
LL | | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
126-
| | ^ expected named lifetime parameter
127-
LL | |
128-
LL | |
129-
LL | |
130-
LL | | }
131-
| |_-
132-
|
133-
= 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
134-
13565
error[E0107]: union takes 2 lifetime arguments but 1 lifetime argument was supplied
136-
--> $DIR/missing-lifetime-specifier.rs:44:44
66+
--> $DIR/missing-lifetime-specifier.rs:45:44
13767
|
13868
LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, i32>>>>> = RefCell::new(HashMap::new());
13969
| ^^^ ------- supplied 1 lifetime argument
14070
| |
14171
| expected 2 lifetime arguments
14272
|
14373
note: union defined here, with 2 lifetime parameters: `'t`, `'k`
144-
--> $DIR/missing-lifetime-specifier.rs:16:11
74+
--> $DIR/missing-lifetime-specifier.rs:21:11
14575
|
14676
LL | pub union Qux<'t, 'k, I> {
14777
| ^^^ -- --
@@ -151,15 +81,15 @@ LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> =
15181
| +++++++++
15282

15383
error[E0107]: trait takes 2 lifetime arguments but 1 lifetime argument was supplied
154-
--> $DIR/missing-lifetime-specifier.rs:48:45
84+
--> $DIR/missing-lifetime-specifier.rs:49:45
15585
|
15686
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
15787
| ^^^ ------- supplied 1 lifetime argument
15888
| |
15989
| expected 2 lifetime arguments
16090
|
16191
note: trait defined here, with 2 lifetime parameters: `'t`, `'k`
162-
--> $DIR/missing-lifetime-specifier.rs:20:7
92+
--> $DIR/missing-lifetime-specifier.rs:25:7
16393
|
16494
LL | trait Tar<'t, 'k, I> {}
16595
| ^^^ -- --
@@ -168,7 +98,7 @@ help: add missing lifetime argument
16898
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
16999
| +++++++++
170100

171-
error: aborting due to 12 previous errors
101+
error: aborting due to 7 previous errors
172102

173103
Some errors have detailed explanations: E0106, E0107.
174104
For more information about an error, try `rustc --explain E0106`.

0 commit comments

Comments
 (0)