1
Fork 0
rust/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.rs

28 lines
746 B
Rust
Raw Normal View History

2022-01-18 19:38:17 -03:00
// check-pass
#![feature(let_chains)]
use std::ops::Range;
fn main() {
let opt = Some(None..Some(1));
if let first = &opt && let Some(ref second) = first && let None = second.start {
}
if let Some(ref first) = opt && let second = first && let _third = second {
}
if let Some(ref first) = opt
&& let Range { start: local_start, end: _ } = first
&& let None = local_start {
}
while let first = &opt && let Some(ref second) = first && let None = second.start {
}
while let Some(ref first) = opt && let second = first && let _third = second {
}
while let Some(ref first) = opt
&& let Range { start: local_start, end: _ } = first
&& let None = local_start {
}
}