]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/missing-lifetime-specifier.rs
Merge commit 'd0cf3481a84e3aa68c2f185c460e282af36ebc42' into clippyup
[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 specifier
25       //~| ERROR missing lifetime specifier
26       //~| ERROR missing lifetime specifier
27       //~| ERROR missing lifetime specifier
28 }
29 thread_local! {
30     static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
31     //~^ ERROR missing lifetime
32     //~| ERROR missing lifetime
33 }
34 thread_local! {
35     static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
36     //~^ ERROR missing lifetime
37     //~| ERROR missing lifetime
38     //~| ERROR missing lifetime
39     //~| ERROR missing lifetime
40 }
41
42 thread_local! {
43     static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, i32>>>>> = RefCell::new(HashMap::new());
44     //~^ ERROR this union takes 2 lifetime arguments but 1 lifetime argument
45     //~| ERROR this union takes 2 lifetime arguments but 1 lifetime argument was supplied
46     //~| ERROR this union takes 2 lifetime arguments but 1 lifetime argument was supplied
47     //~| ERROR this union takes 2 lifetime arguments but 1 lifetime argument was supplied
48     //~| ERROR this union takes 2 lifetime arguments but 1 lifetime argument was supplied
49 }
50 thread_local! {
51     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
52     //~^ ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
53     //~| ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
54     //~| ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
55     //~| ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
56     //~| ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
57     //~| ERROR missing lifetime
58     //~| ERROR missing lifetime
59 }
60
61 fn main() {}