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
4
9
//@ compile-flags: -Zdeduplicate-diagnostics=yes
5
10
6
11
#![ allow( bare_trait_objects) ]
@@ -20,31 +25,31 @@ pub union Qux<'t, 'k, I> {
20
25
trait Tar < ' t , ' k , I > { }
21
26
22
27
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
25
30
static a: RefCell <HashMap <i32 , Vec <Vec <Foo >>>> = RefCell :: new( HashMap :: new( ) ) ;
26
31
//~^ ERROR missing lifetime specifiers
27
32
//~| ERROR missing lifetime specifiers
28
33
}
29
34
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
33
38
static b: RefCell <HashMap <i32 , Vec <Vec <& Bar >>>> = RefCell :: new( HashMap :: new( ) ) ;
34
39
//~^ ERROR missing lifetime specifiers
35
40
//~| ERROR missing lifetime specifiers
36
41
}
37
42
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
40
45
static c: RefCell <HashMap <i32 , Vec <Vec <Qux <i32 >>>>> = RefCell :: new( HashMap :: new( ) ) ;
41
46
//~^ ERROR missing lifetime specifiers
42
47
//~| ERROR missing lifetime specifiers
43
48
}
44
49
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
48
53
static d: RefCell <HashMap <i32 , Vec <Vec <& Tar <i32 >>>>> = RefCell :: new( HashMap :: new( ) ) ;
49
54
//~^ ERROR missing lifetime specifiers
50
55
//~| ERROR missing lifetime specifiers
0 commit comments