summaryrefslogtreecommitdiffstats
path: root/tests/ui/closures/2229_closure_analysis/run_pass/use_of_mutable_borrow_and_fake_reads.rs
blob: 0206927cc59e948a9de617ce884fcc1f28534c6a (plain)
1
2
3
4
5
6
7
8
9
10
11
// edition:2021
//check-pass
#![feature(rustc_attrs)]

fn main() {
    let mut x = 0;
    let c = || {
        &mut x; // mutable borrow of `x`
        match x { _ => () } // fake read of `x`
    };
}