fix UI test

This commit is contained in:
joboet 2024-05-25 09:37:08 +02:00
parent 1052d2931c
commit 6df8d0dd4e
No known key found for this signature in database
GPG Key ID: 704E0149B0194B3C
2 changed files with 21 additions and 91 deletions

View File

@ -1,6 +1,11 @@
// different number of duplicated diagnostics on different targets
//@ only-x86_64
//@ only-linux
// The specific errors produced depend the thread-local implementation.
// Run only on platforms with "fast" TLS.
//@ ignore-windows FIXME(#84933)
//@ ignore-wasm globals are used instead of thread locals
//@ ignore-emscripten globals are used instead of thread locals
//@ ignore-android does not use #[thread_local]
//@ ignore-nto does not use #[thread_local]
// Different number of duplicated diagnostics on different targets
//@ compile-flags: -Zdeduplicate-diagnostics=yes
#![allow(bare_trait_objects)]
@ -22,22 +27,18 @@ trait Tar<'t, 'k, I> {}
thread_local! {
static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new());
//~^ ERROR missing lifetime specifiers
//~| ERROR missing lifetime specifiers
}
thread_local! {
static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
//~^ ERROR missing lifetime specifiers
//~| ERROR missing lifetime specifiers
}
thread_local! {
static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
//~^ ERROR missing lifetime specifiers
//~| ERROR missing lifetime specifiers
}
thread_local! {
static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
//~^ ERROR missing lifetime specifiers
//~| ERROR missing lifetime specifiers
}
thread_local! {
@ -47,8 +48,7 @@ trait Tar<'t, 'k, I> {}
thread_local! {
static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
//~^ ERROR trait takes 2 lifetime arguments but 1 lifetime argument was supplied
//~| ERROR missing lifetime
//~| ERROR missing lifetime
//~| ERROR missing lifetime specifier
}
fn main() {}

View File

@ -1,5 +1,5 @@
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:23:44
--> $DIR/missing-lifetime-specifier.rs:28:44
|
LL | static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new());
| ^^^ expected 2 lifetime parameters
@ -11,20 +11,7 @@ LL | static a: RefCell<HashMap<i32, Vec<Vec<Foo<'static, 'static>>>>> = RefC
| ++++++++++++++++++
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:23:44
|
LL | / thread_local! {
LL | | static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new());
| | ^^^ expected 2 lifetime parameters
LL | |
LL | |
LL | | }
| |_-
|
= 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
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:28:44
--> $DIR/missing-lifetime-specifier.rs:32:44
|
LL | static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
| ^^^^ expected 2 lifetime parameters
@ -38,22 +25,7 @@ LL | static b: RefCell<HashMap<i32, Vec<Vec<&'static Bar<'static, 'static>>>
| +++++++ ++++++++++++++++++
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:28:44
|
LL | / thread_local! {
LL | | static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
| | ^^^^ expected 2 lifetime parameters
| | |
| | expected named lifetime parameter
LL | |
LL | |
LL | | }
| |_-
|
= 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
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:33:47
--> $DIR/missing-lifetime-specifier.rs:36:47
|
LL | static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
| ^ expected 2 lifetime parameters
@ -65,20 +37,7 @@ LL | static c: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> =
| +++++++++++++++++
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:33:47
|
LL | / thread_local! {
LL | | static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
| | ^ expected 2 lifetime parameters
LL | |
LL | |
LL | | }
| |_-
|
= 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
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:38:44
--> $DIR/missing-lifetime-specifier.rs:40:44
|
LL | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
| ^ ^ expected 2 lifetime parameters
@ -91,23 +50,8 @@ help: consider using the `'static` lifetime, but this is uncommon unless you're
LL | static d: RefCell<HashMap<i32, Vec<Vec<&'static Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
| +++++++ +++++++++++++++++
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:38:44
|
LL | / thread_local! {
LL | | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
| | ^ ^ expected 2 lifetime parameters
| | |
| | expected named lifetime parameter
LL | |
LL | |
LL | | }
| |_-
|
= 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
error[E0106]: missing lifetime specifier
--> $DIR/missing-lifetime-specifier.rs:48:44
--> $DIR/missing-lifetime-specifier.rs:49:44
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
| ^ expected named lifetime parameter
@ -118,22 +62,8 @@ help: consider using the `'static` lifetime, but this is uncommon unless you're
LL | static f: RefCell<HashMap<i32, Vec<Vec<&'static Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
| +++++++
error[E0106]: missing lifetime specifier
--> $DIR/missing-lifetime-specifier.rs:48:44
|
LL | / thread_local! {
LL | | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
| | ^ expected named lifetime parameter
LL | |
LL | |
LL | |
LL | | }
| |_-
|
= 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
error[E0107]: union takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:44:44
--> $DIR/missing-lifetime-specifier.rs:45:44
|
LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, i32>>>>> = RefCell::new(HashMap::new());
| ^^^ ------- supplied 1 lifetime argument
@ -141,7 +71,7 @@ LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, i32>>>>> = RefCell:
| expected 2 lifetime arguments
|
note: union defined here, with 2 lifetime parameters: `'t`, `'k`
--> $DIR/missing-lifetime-specifier.rs:16:11
--> $DIR/missing-lifetime-specifier.rs:21:11
|
LL | pub union Qux<'t, 'k, I> {
| ^^^ -- --
@ -151,7 +81,7 @@ LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> =
| +++++++++
error[E0107]: trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:48:45
--> $DIR/missing-lifetime-specifier.rs:49:45
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
| ^^^ ------- supplied 1 lifetime argument
@ -159,7 +89,7 @@ LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell
| expected 2 lifetime arguments
|
note: trait defined here, with 2 lifetime parameters: `'t`, `'k`
--> $DIR/missing-lifetime-specifier.rs:20:7
--> $DIR/missing-lifetime-specifier.rs:25:7
|
LL | trait Tar<'t, 'k, I> {}
| ^^^ -- --
@ -168,7 +98,7 @@ help: add missing lifetime argument
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
| +++++++++
error: aborting due to 12 previous errors
error: aborting due to 7 previous errors
Some errors have detailed explanations: E0106, E0107.
For more information about an error, try `rustc --explain E0106`.