]> git.proxmox.com Git - rustc.git/blob - src/test/ui/closures/2229_closure_analysis/run_pass/use_of_mutable_borrow_and_fake_reads.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / closures / 2229_closure_analysis / run_pass / use_of_mutable_borrow_and_fake_reads.rs
1 // edition:2021
2 //check-pass
3 #![feature(rustc_attrs)]
4
5 fn main() {
6 let mut x = 0;
7 let c = || {
8 &mut x; // mutable borrow of `x`
9 match x { _ => () } // fake read of `x`
10 };
11 }