]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-54597-reject-move-out-of-borrow-via-pat.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / issue-54597-reject-move-out-of-borrow-via-pat.rs
1 #![allow(dead_code)]
2
3 #[derive(Debug)]
4 struct Value;
5 impl Value {
6     fn as_array(&self) -> Option<&Vec<Value>> {
7         None
8     }
9 }
10
11 fn foo(val: Value) {
12     let _reviewers_original: Vec<Value> = match val.as_array() {
13         Some(array) => {
14             *array //~ ERROR cannot move out of `*array`
15         }
16         None => vec![]
17     };
18 }
19
20 fn main() { }