about summary refs log tree commit diff
path: root/tests/ui/borrowck/borrow-checker-lifetime-error-46471.rs
blob: 020b02aa34df73037b0c9edeb56ffa2af4b3601b (plain)
1
2
3
4
5
6
7
8
9
// https://github.com/rust-lang/rust/issues/46471
fn main() {
    let y = {
        let mut z = 0;
        &mut z
    };
    //~^^ ERROR `z` does not live long enough [E0597]
    println!("{}", y);
}