rust/tests/ui/lint/unused-braces-while-let-with-mutable-value.rs

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

13 lines
221 B
Rust
Raw Normal View History

// check-pass
#![deny(unused_braces)]
fn main() {
let mut a = Some(3);
// Shouldn't warn below `a`.
while let Some(ref mut v) = {a} {
a.as_mut().map(|a| std::mem::swap(a, v));
break;
}
}