]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-ref-mut-of-imm.rs
Merge commit '6ed6f1e6a1a8f414ba7e6d9b8222e7e5a1686e42' into clippyup
[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 }