fix warnings in vec destructuring tests
This commit is contained in:
parent
23564574ac
commit
3fc74df7a4
2 changed files with 2 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
fn a() -> &int {
|
||||
let vec = [1, 2, 3, 4];
|
||||
let tail = match vec {
|
||||
[a, ..tail] => &tail[0], //~ ERROR illegal borrow
|
||||
[_a, ..tail] => &tail[0], //~ ERROR illegal borrow
|
||||
_ => fail ~"foo"
|
||||
};
|
||||
move tail
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
fn a() -> &[int] {
|
||||
let vec = [1, 2, 3, 4];
|
||||
let tail = match vec {
|
||||
[a, ..tail] => tail, //~ ERROR illegal borrow
|
||||
[_a, ..tail] => tail, //~ ERROR illegal borrow
|
||||
_ => fail ~"foo"
|
||||
};
|
||||
move tail
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue