mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
a5b639dc01
Consider `tests/ui/const-generics/generic_const_exprs/issue-102768.stderr`, the error message where it gives additional notes about where the associated type is defined, and how the dead code lint doesn't have an article, like in `tests/ui/lint/dead-code/issue-85255.stderr`. They don't have articles, so it seems unnecessary to have one here.
58 lines
2.1 KiB
Rust
58 lines
2.1 KiB
Rust
#![allow(bare_trait_objects)]
|
|
use std::collections::HashMap;
|
|
use std::cell::RefCell;
|
|
|
|
pub union Foo<'t, 'k> {
|
|
i: &'t i64,
|
|
f: &'k f64,
|
|
}
|
|
trait Bar<'t, 'k> {}
|
|
|
|
pub union Qux<'t, 'k, I> {
|
|
i: &'t I,
|
|
f: &'k I,
|
|
}
|
|
trait Tar<'t, 'k, I> {}
|
|
|
|
thread_local! {
|
|
static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new());
|
|
//~^ ERROR missing lifetime specifiers
|
|
//~| ERROR missing lifetime specifiers
|
|
}
|
|
thread_local! {
|
|
static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
|
|
//~^ ERROR missing lifetime specifiers
|
|
//~| ERROR missing lifetime specifiers
|
|
}
|
|
thread_local! {
|
|
static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
|
|
//~^ ERROR missing lifetime specifiers
|
|
//~| ERROR missing lifetime specifiers
|
|
}
|
|
thread_local! {
|
|
static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
|
|
//~^ ERROR missing lifetime specifiers
|
|
//~| ERROR missing lifetime specifiers
|
|
}
|
|
|
|
thread_local! {
|
|
static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, i32>>>>> = RefCell::new(HashMap::new());
|
|
//~^ ERROR union takes 2 lifetime arguments but 1 lifetime argument
|
|
//~| ERROR union takes 2 lifetime arguments but 1 lifetime argument was supplied
|
|
//~| ERROR union takes 2 lifetime arguments but 1 lifetime argument was supplied
|
|
//~| ERROR union takes 2 lifetime arguments but 1 lifetime argument was supplied
|
|
//~| ERROR union takes 2 lifetime arguments but 1 lifetime argument was supplied
|
|
}
|
|
thread_local! {
|
|
static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
|
|
//~^ ERROR trait takes 2 lifetime arguments but 1 lifetime argument was supplied
|
|
//~| ERROR trait takes 2 lifetime arguments but 1 lifetime argument was supplied
|
|
//~| ERROR trait takes 2 lifetime arguments but 1 lifetime argument was supplied
|
|
//~| ERROR trait takes 2 lifetime arguments but 1 lifetime argument was supplied
|
|
//~| ERROR trait takes 2 lifetime arguments but 1 lifetime argument was supplied
|
|
//~| ERROR missing lifetime
|
|
//~| ERROR missing lifetime
|
|
}
|
|
|
|
fn main() {}
|