Skip to content

Commit a087a37

Browse files
committed
update UI test, make it run on more platforms
1 parent 7b69733 commit a087a37

File tree

2 files changed

+87
-82
lines changed

2 files changed

+87
-82
lines changed

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

+18-13
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)]
@@ -20,31 +25,31 @@ pub union Qux<'t, 'k, I> {
2025
trait Tar<'t, 'k, I> {}
2126

2227
thread_local! {
23-
//~^ ERROR lifetime may not live long enough
24-
//~| ERROR lifetime may not live long enough
28+
//~^ ERROR borrowed data escapes outside of function
29+
//~| ERROR borrowed data escapes outside of function
2530
static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new());
2631
//~^ ERROR missing lifetime specifiers
2732
//~| ERROR missing lifetime specifiers
2833
}
2934
thread_local! {
30-
//~^ ERROR lifetime may not live long enough
31-
//~| ERROR lifetime may not live long enough
32-
//~| ERROR lifetime may not live long enough
35+
//~^ ERROR borrowed data escapes outside of function
36+
//~| ERROR borrowed data escapes outside of function
37+
//~| ERROR borrowed data escapes outside of function
3338
static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
3439
//~^ ERROR missing lifetime specifiers
3540
//~| ERROR missing lifetime specifiers
3641
}
3742
thread_local! {
38-
//~^ ERROR lifetime may not live long enough
39-
//~| ERROR lifetime may not live long enough
43+
//~^ ERROR borrowed data escapes outside of function
44+
//~| ERROR borrowed data escapes outside of function
4045
static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
4146
//~^ ERROR missing lifetime specifiers
4247
//~| ERROR missing lifetime specifiers
4348
}
4449
thread_local! {
45-
//~^ ERROR lifetime may not live long enough
46-
//~| ERROR lifetime may not live long enough
47-
//~| ERROR lifetime may not live long enough
50+
//~^ ERROR borrowed data escapes outside of function
51+
//~| ERROR borrowed data escapes outside of function
52+
//~| ERROR borrowed data escapes outside of function
4853
static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
4954
//~^ ERROR missing lifetime specifiers
5055
//~| ERROR missing lifetime specifiers

0 commit comments

Comments
 (0)