mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 17:53:56 +00:00
11 lines
208 B
Rust
11 lines
208 B
Rust
// Test that type annotations are checked in promoted constants correctly.
|
|
|
|
fn foo<'a>() {
|
|
let x = 0;
|
|
let f = &drop::<&'a i32>;
|
|
f(&x);
|
|
//~^ ERROR `x` does not live long enough
|
|
}
|
|
|
|
fn main() {}
|