Fix the fallout

This commit is contained in:
Vadim Petrochenkov 2015-10-26 21:10:41 +03:00
parent 0f8519c341
commit 35749923ee
19 changed files with 40 additions and 50 deletions

View file

@ -32,7 +32,7 @@ pub fn test_match_partial(p: Lonely<D, D>) {
//~^ ERROR parent_of_fragments: `$(local p)`
//~| ERROR assigned_leaf_path: `($(local p) as Lonely::Zero)`
match p {
Zero(..) => {}
Zero => {}
_ => {}
}
}
@ -44,7 +44,7 @@ pub fn test_match_full(p: Lonely<D, D>) {
//~| ERROR assigned_leaf_path: `($(local p) as Lonely::One)`
//~| ERROR assigned_leaf_path: `($(local p) as Lonely::Two)`
match p {
Zero(..) => {}
Zero => {}
One(..) => {}
Two(..) => {}
}
@ -59,7 +59,7 @@ pub fn test_match_bind_one(p: Lonely<D, D>) {
//~| ERROR assigned_leaf_path: `($(local p) as Lonely::Two)`
//~| ERROR assigned_leaf_path: `$(local data)`
match p {
Zero(..) => {}
Zero => {}
One(data) => {}
Two(..) => {}
}
@ -78,7 +78,7 @@ pub fn test_match_bind_many(p: Lonely<D, D>) {
//~| ERROR assigned_leaf_path: `$(local left)`
//~| ERROR assigned_leaf_path: `$(local right)`
match p {
Zero(..) => {}
Zero => {}
One(data) => {}
Two(left, right) => {}
}

View file

@ -38,7 +38,7 @@ pub fn test_match_bind_and_underscore(p: Lonely<D, D>) {
//~| ERROR assigned_leaf_path: `$(local left)`
match p {
Zero(..) => {}
Zero => {}
One(_) => {} // <-- does not fragment `($(local p) as One)` ...

View file

@ -10,7 +10,6 @@
struct A(isize);
struct B;
fn main() {
let x = match A(3) {
@ -22,12 +21,4 @@ fn main() {
A(..) => 2
};
assert_eq!(x, 2);
// This next test uses a (..) wildcard match on a nullary struct.
// There's no particularly good reason to support this, but it's currently allowed,
// and this makes sure it doesn't ICE or break LLVM.
let x = match B {
B(..) => 3
};
assert_eq!(x, 3);
}

View file

@ -20,7 +20,7 @@ fn noise(a: animal) -> Option<String> {
animal::cat(..) => { Some("meow".to_string()) }
animal::dog(..) => { Some("woof".to_string()) }
animal::rabbit(..) => { None }
animal::tiger(..) => { Some("roar".to_string()) }
animal::tiger => { Some("roar".to_string()) }
}
}