]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/missing-lifetime-specifier.rs
skip if val has ecaping bound vars
[rust.git] / src / test / ui / suggestions / missing-lifetime-specifier.rs
1 #![allow(bare_trait_objects)]
2 use std::collections::HashMap;
3 use std::cell::RefCell;
4
5 pub union Foo<'t, 'k> {
6     i: &'t i64,
7     f: &'k f64,
8 }
9 trait Bar<'t, 'k> {}
10
11 pub union Qux<'t, 'k, I> {
12     i: &'t I,
13     f: &'k I,
14 }
15 trait Tar<'t, 'k, I> {}
16
17 thread_local! {
18     static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new());
19       //~^ ERROR missing lifetime specifiers
20       //~| ERROR missing lifetime specifiers
21 }
22 thread_local! {
23     static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
24       //~^ ERROR missing lifetime specifiers
25       //~| ERROR missing lifetime specifiers
26 }
27 thread_local! {
28     static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
29     //~^ ERROR missing lifetime specifiers
30     //~| ERROR missing lifetime specifiers
31 }
32 thread_local! {
33     static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
34     //~^ ERROR missing lifetime specifiers
35     //~| ERROR missing lifetime specifiers
36 }
37
38 thread_local! {
39     static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, i32>>>>> = RefCell::new(HashMap::new());
40     //~^ ERROR this union takes 2 lifetime arguments but 1 lifetime argument
41     //~| ERROR this union takes 2 lifetime arguments but 1 lifetime argument was supplied
42     //~| ERROR this union takes 2 lifetime arguments but 1 lifetime argument was supplied
43     //~| ERROR this union takes 2 lifetime arguments but 1 lifetime argument was supplied
44     //~| ERROR this union takes 2 lifetime arguments but 1 lifetime argument was supplied
45 }
46 thread_local! {
47     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
48     //~^ ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
49     //~| ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
50     //~| ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
51     //~| ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
52     //~| ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
53     //~| ERROR missing lifetime
54     //~| ERROR missing lifetime
55 }
56
57 fn main() {}