rust/tests/ui/rfcs/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs

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

17 lines
313 B
Rust
Raw Normal View History

2022-01-18 16:38:17 -06:00
// run-pass
#![feature(let_chains)]
#![allow(irrefutable_let_patterns)]
2022-01-18 16:38:17 -06:00
fn main() {
let first = Some(1);
let second = Some(2);
let mut n = 0;
if let x = first && let y = second && 1 == 1 {
assert_eq!(x, first);
assert_eq!(y, second);
n = 1;
}
assert_eq!(n, 1);
}