rust/tests/ui/nll/user-annotations/cast_static_lifetime.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

7 lines
135 B
Rust
Raw Normal View History

#![allow(warnings)]
fn main() {
let x = 22_u32;
2018-11-27 03:56:36 -06:00
let y: &u32 = (&x) as &'static u32; //~ ERROR `x` does not live long enough
}