]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-pat-reassign-no-binding.rs
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
[rust.git] / tests / ui / borrowck / borrowck-pat-reassign-no-binding.rs
1 // run-pass
2
3 pub fn main() {
4     let mut x = None;
5     match x {
6       None => {
7         // It is ok to reassign x here, because there is in
8         // fact no outstanding loan of x!
9         x = Some(0);
10       }
11       Some(_) => { }
12     }
13     assert_eq!(x, Some(0));
14 }