]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-ref-mut-of-imm.rs
Auto merge of #101768 - sunfishcode:sunfishcode/wasi-stdio-lock-asfd, r=joshtriplett
[rust.git] / src / test / ui / borrowck / borrowck-ref-mut-of-imm.rs
1 fn destructure(x: Option<isize>) -> isize {
2     match x {
3       None => 0,
4       Some(ref mut v) => *v //~ ERROR cannot borrow
5     }
6 }
7
8 fn main() {
9     assert_eq!(destructure(Some(22)), 22);
10 }