os-rust/src/test/ui/issues/issue-52049.rs

9 lines
162 B
Rust
Raw Normal View History

2018-07-07 15:51:50 +05:30
fn foo(_: &'static u32) {}
fn unpromotable<T>(t: T) -> T { t }
fn main() {
foo(&unpromotable(5u32));
}
//~^^ ERROR borrowed value does not live long enough