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