Skip to content

Commit

Permalink
update UI test, make it run on more platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
joboet committed Mar 12, 2024
1 parent 7b69733 commit a087a37
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 82 deletions.
31 changes: 18 additions & 13 deletions tests/ui/suggestions/missing-lifetime-specifier.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand All @@ -20,31 +25,31 @@ pub union Qux<'t, 'k, I> {
trait Tar<'t, 'k, I> {}

thread_local! {
//~^ ERROR lifetime may not live long enough
//~| ERROR lifetime may not live long enough
//~^ ERROR borrowed data escapes outside of function
//~| ERROR borrowed data escapes outside of function
static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new());
//~^ ERROR missing lifetime specifiers
//~| ERROR missing lifetime specifiers
}
thread_local! {
//~^ ERROR lifetime may not live long enough
//~| ERROR lifetime may not live long enough
//~| ERROR lifetime may not live long enough
//~^ ERROR borrowed data escapes outside of function
//~| ERROR borrowed data escapes outside of function
//~| ERROR borrowed data escapes outside of function
static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
//~^ ERROR missing lifetime specifiers
//~| ERROR missing lifetime specifiers
}
thread_local! {
//~^ ERROR lifetime may not live long enough
//~| ERROR lifetime may not live long enough
//~^ ERROR borrowed data escapes outside of function
//~| ERROR borrowed data escapes outside of function
static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
//~^ ERROR missing lifetime specifiers
//~| ERROR missing lifetime specifiers
}
thread_local! {
//~^ ERROR lifetime may not live long enough
//~| ERROR lifetime may not live long enough
//~| ERROR lifetime may not live long enough
//~^ ERROR borrowed data escapes outside of function
//~| ERROR borrowed data escapes outside of function
//~| ERROR borrowed data escapes outside of function
static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
//~^ ERROR missing lifetime specifiers
//~| ERROR missing lifetime specifiers
Expand Down
Loading

0 comments on commit a087a37

Please sign in to comment.