]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-ref-mut-of-imm.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / 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 }