rust/tests/ui/borrowck/borrow-checker-lifetime-error-46471.rs
2025-08-02 15:29:16 -04:00

10 lines
200 B
Rust

// 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);
}