Skip to content

Commit 481ad0e

Browse files
committedOct 15, 2018
regression test for issue #54597
1 parent 0e07c42 commit 481ad0e

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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
17+
}
18+
None => vec![]
19+
};
20+
}
21+
22+
fn main() { }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0507]: cannot move out of borrowed content
2+
--> $DIR/issue-54597-reject-move-out-of-borrow-via-pat.rs:16:13
3+
|
4+
LL | *array
5+
| ^^^^^^
6+
| |
7+
| cannot move out of borrowed content
8+
| help: consider removing the `*`: `array`
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0507`.

0 commit comments

Comments
 (0)
Please sign in to comment.