Closed
Description
Someone had this problem on discord, so creating an issue:
pub union Test<'t> {
i: &'t i64,
f: &'t f64,
}
thread_local! {
static vals: RefCell<HashMap<i32, Vec<Vec<Test>>>> = RefCell::new(HashMap::new());
}
Rust suggests you to:
error[E0106]: missing lifetime specifier
|
| static vals: RefCell<HashMap<i32, Vec<Vec<Test>>>> = RefCell::new(HashMap::new());
| ^^^^ help: consider giving it a 'static lifetime: `Test + 'static`
|
= help: this function's return type contains a borrowed value, but there is no value for it to be
borrowed from
instead it should suggest to use Test<'static>
and not <Test + 'static>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment