aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/while_let_expr.rs
blob: 113ad743cc2beff654e90469005216fc0c373589 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// { dg-options "-fsyntax-only" }

pub enum Option<T> {
    None,
    Some(T),
}

fn main() {
    let mut x = Option::Some(3);
    let a = while let Option::Some(1) = x {
        x = Option::None;
    };
}