rust/tests/ui/let-else/let-else-binding-explicit-mut-pass.rs
2023-01-11 09:32:08 +00:00

14 lines
232 B
Rust

// check-pass
fn main() {
let Some(n) = &mut &mut Some(5i32) else { return; };
*n += 1; // OK
let _ = n;
let Some(n): &mut Option<i32> = &mut &mut Some(5i32) else { return; };
*n += 1; // OK
let _ = n;
}