]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-ref-mut-of-imm.rs
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[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 }