]> git.proxmox.com Git - rustc.git/blame - src/test/run-pass/borrowck/borrowck-pat-reassign-no-binding.rs
New upstream version 1.37.0+dfsg1
[rustc.git] / src / test / run-pass / borrowck / borrowck-pat-reassign-no-binding.rs
CommitLineData
b7449926 1// run-pass
c34b1796 2
223e47cc
LB
3pub 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!
85aaf69f 9 x = Some(0);
223e47cc
LB
10 }
11 Some(_) => { }
12 }
1a4d82fc 13 assert_eq!(x, Some(0));
223e47cc 14}