diff options
| author | bors <bors@rust-lang.org> | 2013-11-28 20:31:39 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-11-28 20:31:39 -0800 |
| commit | bf6964ecb67f4ffce6be75130ab7a3be793960ff (patch) | |
| tree | ddf8aabea4d05b3ae0cb977cc1a466526f871b06 /src/test | |
| parent | 90d06ecf6b26e949921778f0d479ea1532077200 (diff) | |
| parent | ab387a68388974a432951e806851936898907fd0 (diff) | |
| download | rust-bf6964ecb67f4ffce6be75130ab7a3be793960ff.tar.gz rust-bf6964ecb67f4ffce6be75130ab7a3be793960ff.zip | |
auto merge of #10709 : alexcrichton/rust/snapshot, r=pcwalton
Diffstat (limited to 'src/test')
29 files changed, 64 insertions, 66 deletions
diff --git a/src/test/compile-fail/match-vec-mismatch.rs b/src/test/compile-fail/match-vec-mismatch.rs index 85ed8761ee9..5eca6546ea9 100644 --- a/src/test/compile-fail/match-vec-mismatch.rs +++ b/src/test/compile-fail/match-vec-mismatch.rs @@ -1,6 +1,6 @@ fn main() { match ~"foo" { - ['f', 'o', .._] => { } //~ ERROR mismatched types: expected `~str` but found a vector pattern + ['f', 'o', ..] => { } //~ ERROR mismatched types: expected `~str` but found a vector pattern _ => { } } } diff --git a/src/test/compile-fail/match-vec-unreachable.rs b/src/test/compile-fail/match-vec-unreachable.rs index b557242af44..54e25aea09b 100644 --- a/src/test/compile-fail/match-vec-unreachable.rs +++ b/src/test/compile-fail/match-vec-unreachable.rs @@ -7,7 +7,7 @@ fn main() { } match ~[~"foo", ~"bar", ~"baz"] { - [a, _, _, .._] => { println(a); } + [a, _, _, ..] => { println(a); } [~"foo", ~"bar", ~"baz", ~"foo", ~"bar"] => { } //~ ERROR unreachable pattern _ => { } } diff --git a/src/test/compile-fail/non-exhaustive-match.rs b/src/test/compile-fail/non-exhaustive-match.rs index 9719dd744b7..e728b9c2fd7 100644 --- a/src/test/compile-fail/non-exhaustive-match.rs +++ b/src/test/compile-fail/non-exhaustive-match.rs @@ -36,8 +36,8 @@ fn main() { (b, b) => {} } match ~[Some(42), None, Some(21)] { //~ ERROR non-exhaustive patterns: vectors of length 0 not covered - [Some(*), None, ..tail] => {} - [Some(*), Some(*), ..tail] => {} + [Some(..), None, ..tail] => {} + [Some(..), Some(..), ..tail] => {} [None] => {} } match ~[1] { @@ -51,10 +51,10 @@ fn main() { [] => () } match ~[Some(42), None, Some(21)] { - [Some(*), None, ..tail] => {} - [Some(*), Some(*), ..tail] => {} + [Some(..), None, ..tail] => {} + [Some(..), Some(..), ..tail] => {} [None, None, ..tail] => {} - [None, Some(*), ..tail] => {} + [None, Some(..), ..tail] => {} [Some(_)] => {} [None] => {} [] => {} diff --git a/src/test/compile-fail/pattern-error-continue.rs b/src/test/compile-fail/pattern-error-continue.rs index 09e4380f346..47d0a226a56 100644 --- a/src/test/compile-fail/pattern-error-continue.rs +++ b/src/test/compile-fail/pattern-error-continue.rs @@ -29,7 +29,7 @@ fn main() { _ => () } match 'c' { - S { _ } => (), //~ ERROR mismatched types: expected `char` but found a structure pattern + S { .. } => (), //~ ERROR mismatched types: expected `char` but found a structure pattern _ => () } diff --git a/src/test/debug-info/destructured-fn-argument.rs b/src/test/debug-info/destructured-fn-argument.rs index 73734860648..8af57468b19 100644 --- a/src/test/debug-info/destructured-fn-argument.rs +++ b/src/test/debug-info/destructured-fn-argument.rs @@ -221,7 +221,7 @@ fn ignored_tuple_element((m, _, n): (int, u16, i32)) { zzz(); } -fn ignored_struct_field(Struct { b: o, _ }: Struct) { +fn ignored_struct_field(Struct { b: o, .. }: Struct) { zzz(); } @@ -262,7 +262,7 @@ fn ref_binding_in_tuple((ref ff, gg): (int, (int, int))) { zzz(); } -fn ref_binding_in_struct(Struct { b: ref hh, _ }: Struct) { +fn ref_binding_in_struct(Struct { b: ref hh, .. }: Struct) { zzz(); } diff --git a/src/test/debug-info/destructured-local.rs b/src/test/debug-info/destructured-local.rs index d222ad8b914..cd17906623e 100644 --- a/src/test/debug-info/destructured-local.rs +++ b/src/test/debug-info/destructured-local.rs @@ -157,7 +157,7 @@ fn main() { let (m, _, n) = (14, 15, 16); // ignored struct field - let Struct { b: o, _ } = Struct { a: 17, b: 18 }; + let Struct { b: o, .. } = Struct { a: 17, b: 18 }; // one struct destructured, one not let (Struct { a: p, b: q }, r) = (Struct { a: 19, b: 20 }, Struct { a: 21, b: 22 }); @@ -188,7 +188,7 @@ fn main() { let (ref ff, gg) = (46, (47, 48)); // ref binding in struct - let Struct { b: ref hh, _ } = Struct { a: 49, b: 50 }; + let Struct { b: ref hh, .. } = Struct { a: 49, b: 50 }; // univariant enum let Unit(ii) = Unit(51); diff --git a/src/test/debug-info/lexical-scope-in-match.rs b/src/test/debug-info/lexical-scope-in-match.rs index e5b2f9d9fe5..7cb68e9890d 100644 --- a/src/test/debug-info/lexical-scope-in-match.rs +++ b/src/test/debug-info/lexical-scope-in-match.rs @@ -116,7 +116,7 @@ fn main() { match Struct { x: 239, y: 240 } { // ignored field - Struct { x: shadowed, _ } => { + Struct { x: shadowed, .. } => { zzz(); sentinel(); diff --git a/src/test/run-pass/const-enum-byref-self.rs b/src/test/run-pass/const-enum-byref-self.rs index 098a001cfcd..eaca18be93a 100644 --- a/src/test/run-pass/const-enum-byref-self.rs +++ b/src/test/run-pass/const-enum-byref-self.rs @@ -15,7 +15,7 @@ impl E { pub fn method(&self) { match *self { V => {} - VV(*) => fail!() + VV(..) => fail!() } } } diff --git a/src/test/run-pass/const-enum-byref.rs b/src/test/run-pass/const-enum-byref.rs index 83fafad4f99..ee7e3c7c663 100644 --- a/src/test/run-pass/const-enum-byref.rs +++ b/src/test/run-pass/const-enum-byref.rs @@ -14,7 +14,7 @@ static C: E = V; fn f(a: &E) { match *a { V => {} - VV(*) => fail!() + VV(..) => fail!() } } diff --git a/src/test/run-pass/const-enum-structlike.rs b/src/test/run-pass/const-enum-structlike.rs index 943597fa28f..8b5e98f6eba 100644 --- a/src/test/run-pass/const-enum-structlike.rs +++ b/src/test/run-pass/const-enum-structlike.rs @@ -19,7 +19,7 @@ static C: E = S1 { u: 23 }; pub fn main() { match C { - S0 { _ } => fail!(), + S0 { .. } => fail!(), S1 { u } => assert!(u == 23) } } diff --git a/src/test/run-pass/core-run-destroy.rs b/src/test/run-pass/core-run-destroy.rs index 07d9fb95dcb..37dc48ebda4 100644 --- a/src/test/run-pass/core-run-destroy.rs +++ b/src/test/run-pass/core-run-destroy.rs @@ -58,13 +58,13 @@ fn test_destroy_actually_kills(force: bool) { #[cfg(unix,not(target_os="android"))] fn process_exists(pid: libc::pid_t) -> bool { - let run::ProcessOutput {output, _} = run::process_output("ps", [~"-p", pid.to_str()]); + let run::ProcessOutput {output, ..} = run::process_output("ps", [~"-p", pid.to_str()]); str::from_utf8(output).contains(pid.to_str()) } #[cfg(unix,target_os="android")] fn process_exists(pid: libc::pid_t) -> bool { - let run::ProcessOutput {output, _} = run::process_output("/system/bin/ps", [pid.to_str()]); + let run::ProcessOutput {output, ..} = run::process_output("/system/bin/ps", [pid.to_str()]); str::from_utf8(output).contains(~"root") } diff --git a/src/test/run-pass/func-arg-incomplete-pattern.rs b/src/test/run-pass/func-arg-incomplete-pattern.rs index 93c9d6b50ec..cba12e9199b 100644 --- a/src/test/run-pass/func-arg-incomplete-pattern.rs +++ b/src/test/run-pass/func-arg-incomplete-pattern.rs @@ -6,7 +6,7 @@ struct Foo { y: ~uint, } -fn foo(Foo {x, _}: Foo) -> *uint { +fn foo(Foo {x, ..}: Foo) -> *uint { let addr: *uint = &*x; addr } diff --git a/src/test/run-pass/ignore-all-the-things.rs b/src/test/run-pass/ignore-all-the-things.rs index b3b93c768d1..b176254a878 100644 --- a/src/test/run-pass/ignore-all-the-things.rs +++ b/src/test/run-pass/ignore-all-the-things.rs @@ -13,16 +13,14 @@ struct Bar{a: int, b: int, c: int, d: int} pub fn main() { let Foo(..) = Foo(5, 5, 5, 5); - let Foo(*) = Foo(5, 5, 5, 5); + let Foo(..) = Foo(5, 5, 5, 5); let Bar{..} = Bar{a: 5, b: 5, c: 5, d: 5}; - let Bar{_} = Bar{a: 5, b: 5, c: 5, d: 5}; //let (..) = (5, 5, 5, 5); //let Foo(a, b, ..) = Foo(5, 5, 5, 5); //let Foo(.., d) = Foo(5, 5, 5, 5); //let (a, b, ..) = (5, 5, 5, 5); //let (.., c, d) = (5, 5, 5, 5); let Bar{b: b, ..} = Bar{a: 5, b: 5, c: 5, d: 5}; - let Bar{b: b, _} = Bar{a: 5, b: 5, c: 5, d: 5}; match [5, 5, 5, 5] { [..] => { } } @@ -36,15 +34,15 @@ pub fn main() { [a, .., b] => { } } match [5, 5, 5] { - [.._] => { } + [..] => { } } match [5, 5, 5] { - [a, .._] => { } + [a, ..] => { } } match [5, 5, 5] { - [.._, a] => { } + [.., a] => { } } match [5, 5, 5] { - [a, .._, b] => { } + [a, .., b] => { } } } diff --git a/src/test/run-pass/issue-1701.rs b/src/test/run-pass/issue-1701.rs index 4f3d0dbe133..d8e4d04dded 100644 --- a/src/test/run-pass/issue-1701.rs +++ b/src/test/run-pass/issue-1701.rs @@ -16,10 +16,10 @@ enum animal { cat(pattern), dog(breed), rabbit(name, ear_kind), tiger } fn noise(a: animal) -> Option<~str> { match a { - cat(*) => { Some(~"meow") } - dog(*) => { Some(~"woof") } - rabbit(*) => { None } - tiger(*) => { Some(~"roar") } + cat(..) => { Some(~"meow") } + dog(..) => { Some(~"woof") } + rabbit(..) => { None } + tiger(..) => { Some(~"roar") } } } diff --git a/src/test/run-pass/issue-4875.rs b/src/test/run-pass/issue-4875.rs index 81947791881..9c1e782ffce 100644 --- a/src/test/run-pass/issue-4875.rs +++ b/src/test/run-pass/issue-4875.rs @@ -14,7 +14,7 @@ pub struct Foo<T> { data: T, } -fn foo<T>(Foo{_}: Foo<T>) { +fn foo<T>(Foo{..}: Foo<T>) { } pub fn main() { diff --git a/src/test/run-pass/issue-8351-1.rs b/src/test/run-pass/issue-8351-1.rs index 9aaaa13c799..e82a8a7313e 100644 --- a/src/test/run-pass/issue-8351-1.rs +++ b/src/test/run-pass/issue-8351-1.rs @@ -19,7 +19,7 @@ pub fn main() { let e = Foo{f: 0}; match e { Foo{f: 1} => fail!(), - Foo{_} => (), + Foo{..} => (), _ => fail!(), } } diff --git a/src/test/run-pass/match-enum-struct-1.rs b/src/test/run-pass/match-enum-struct-1.rs index 5ee06e29cb8..a4d8296c872 100644 --- a/src/test/run-pass/match-enum-struct-1.rs +++ b/src/test/run-pass/match-enum-struct-1.rs @@ -18,7 +18,7 @@ enum E { pub fn main() { let e = Foo{f: 1}; match e { - Foo{_} => (), + Foo{..} => (), _ => fail!(), } match e { diff --git a/src/test/run-pass/match-struct-0.rs b/src/test/run-pass/match-struct-0.rs index 67e844c519e..769a5ab5460 100644 --- a/src/test/run-pass/match-struct-0.rs +++ b/src/test/run-pass/match-struct-0.rs @@ -16,7 +16,7 @@ pub fn main() { let f = Foo{f: 1}; match f { Foo{f: 0} => fail!(), - Foo{_} => (), + Foo{..} => (), } match f { Foo{f: 0} => fail!(), diff --git a/src/test/run-pass/nested-exhaustive-match.rs b/src/test/run-pass/nested-exhaustive-match.rs index e5ecd82be1d..fa4bec0271f 100644 --- a/src/test/run-pass/nested-exhaustive-match.rs +++ b/src/test/run-pass/nested-exhaustive-match.rs @@ -12,9 +12,9 @@ struct Foo { foo: bool, bar: Option<int>, baz: int } pub fn main() { match @Foo{foo: true, bar: Some(10), baz: 20} { - @Foo{foo: true, bar: Some(_), _} => {} - @Foo{foo: false, bar: None, _} => {} - @Foo{foo: true, bar: None, _} => {} - @Foo{foo: false, bar: Some(_), _} => {} + @Foo{foo: true, bar: Some(_), ..} => {} + @Foo{foo: false, bar: None, ..} => {} + @Foo{foo: true, bar: None, ..} => {} + @Foo{foo: false, bar: Some(_), ..} => {} } } diff --git a/src/test/run-pass/nested-patterns.rs b/src/test/run-pass/nested-patterns.rs index 95f97029089..ccb6ec59ed1 100644 --- a/src/test/run-pass/nested-patterns.rs +++ b/src/test/run-pass/nested-patterns.rs @@ -18,12 +18,12 @@ struct C { c: int } pub fn main() { match A {a: 10, b: @20} { x@A {a, b: @20} => { assert!(x.a == 10); assert!(a == 10); } - A {b: _b, _} => { fail!(); } + A {b: _b, ..} => { fail!(); } } - let mut x@B {b, _} = B {a: 10, b: C {c: 20}}; + let mut x@B {b, ..} = B {a: 10, b: C {c: 20}}; x.b.c = 30; assert_eq!(b.c, 20); - let mut y@D {d, _} = D {a: 10, d: C {c: 20}}; + let mut y@D {d, ..} = D {a: 10, d: C {c: 20}}; y.d.c = 30; assert_eq!(d.c, 20); } diff --git a/src/test/run-pass/nullable-pointer-iotareduction.rs b/src/test/run-pass/nullable-pointer-iotareduction.rs index 62bd54e4395..acb7fe12360 100644 --- a/src/test/run-pass/nullable-pointer-iotareduction.rs +++ b/src/test/run-pass/nullable-pointer-iotareduction.rs @@ -26,13 +26,13 @@ enum E<T> { Thing(int, T), Nothing((), ((), ()), [i8, ..0]) } impl<T> E<T> { fn is_none(&self) -> bool { match *self { - Thing(*) => false, - Nothing(*) => true + Thing(..) => false, + Nothing(..) => true } } fn get_ref<'r>(&'r self) -> (int, &'r T) { match *self { - Nothing(*) => fail!("E::get_ref(Nothing::<%s>)", stringify!($T)), + Nothing(..) => fail!("E::get_ref(Nothing::<%s>)", stringify!($T)), Thing(x, ref y) => (x, y) } } diff --git a/src/test/run-pass/record-pat.rs b/src/test/run-pass/record-pat.rs index d1b15b9bb7c..ff87cceba19 100644 --- a/src/test/run-pass/record-pat.rs +++ b/src/test/run-pass/record-pat.rs @@ -14,7 +14,7 @@ enum t3 { c(T2, uint), } fn m(input: t3) -> int { match input { - c(T2 {x: a(m), _}, _) => { return m; } + c(T2 {x: a(m), ..}, _) => { return m; } c(T2 {x: b(m), y: y}, z) => { return ((m + z) as int) + y; } } } diff --git a/src/test/run-pass/regions-dependent-addr-of.rs b/src/test/run-pass/regions-dependent-addr-of.rs index d8076f543ec..de619685ca4 100644 --- a/src/test/run-pass/regions-dependent-addr-of.rs +++ b/src/test/run-pass/regions-dependent-addr-of.rs @@ -63,21 +63,21 @@ fn get_v6_a<'v>(a: &'v A, _i: uint) -> &'v int { fn get_v6_b<'v>(a: &'v A, _i: uint) -> &'v int { match *a { - A { value: B { v6: Some(ref v), _ } } => &v.f, + A { value: B { v6: Some(ref v), .. } } => &v.f, _ => fail!() } } fn get_v6_c<'v>(a: &'v A, _i: uint) -> &'v int { match a { - &A { value: B { v6: Some(ref v), _ } } => &v.f, + &A { value: B { v6: Some(ref v), .. } } => &v.f, _ => fail!() } } fn get_v5_ref<'v>(a: &'v A, _i: uint) -> &'v int { match &a.value { - &B {v5: ~C {f: ref v}, _} => v + &B {v5: ~C {f: ref v}, ..} => v } } diff --git a/src/test/run-pass/rtio-processes.rs b/src/test/run-pass/rtio-processes.rs index 00f565324ec..69dc27f216d 100644 --- a/src/test/run-pass/rtio-processes.rs +++ b/src/test/run-pass/rtio-processes.rs @@ -59,8 +59,8 @@ fn smoke_failure() { io: io, }; match io::result(|| Process::new(args)) { - Ok(*) => fail!(), - Err(*) => {} + Ok(..) => fail!(), + Err(..) => {} } } diff --git a/src/test/run-pass/tag.rs b/src/test/run-pass/tag.rs index bb88e1b3f1e..989f911134b 100644 --- a/src/test/run-pass/tag.rs +++ b/src/test/run-pass/tag.rs @@ -22,7 +22,7 @@ impl Eq for colour { } green => { match (*other) { - red(*) => false, + red(..) => false, green => true } } diff --git a/src/test/run-pass/vec-matching-autoslice.rs b/src/test/run-pass/vec-matching-autoslice.rs index 2ad21aba6cd..acd1d63a6ed 100644 --- a/src/test/run-pass/vec-matching-autoslice.rs +++ b/src/test/run-pass/vec-matching-autoslice.rs @@ -1,7 +1,7 @@ pub fn main() { let x = @[1, 2, 3]; match x { - [2, .._] => fail!(), + [2, ..] => fail!(), [1, ..tail] => { assert_eq!(tail, [2, 3]); } diff --git a/src/test/run-pass/vec-matching-fixed.rs b/src/test/run-pass/vec-matching-fixed.rs index 3b45182fc3a..ed88dc3008a 100644 --- a/src/test/run-pass/vec-matching-fixed.rs +++ b/src/test/run-pass/vec-matching-fixed.rs @@ -2,17 +2,17 @@ fn a() { let x = [1, 2, 3]; match x { [1, 2, 4] => unreachable!(), - [0, 2, 3, .._] => unreachable!(), - [0, .._, 3] => unreachable!(), - [0, .._] => unreachable!(), + [0, 2, 3, ..] => unreachable!(), + [0, .., 3] => unreachable!(), + [0, ..] => unreachable!(), [1, 2, 3] => (), [_, _, _] => unreachable!(), } match x { - [.._] => (), + [..] => (), } match x { - [_, _, _, .._] => (), + [_, _, _, ..] => (), } match x { [a, b, c] => { diff --git a/src/test/run-pass/vec-matching.rs b/src/test/run-pass/vec-matching.rs index c09fb8d6bc7..16c68afa47b 100644 --- a/src/test/run-pass/vec-matching.rs +++ b/src/test/run-pass/vec-matching.rs @@ -1,9 +1,9 @@ fn a() { let x = ~[1]; match x { - [_, _, _, _, _, .._] => fail!(), - [.._, _, _, _, _] => fail!(), - [_, .._, _, _] => fail!(), + [_, _, _, _, _, ..] => fail!(), + [.., _, _, _, _] => fail!(), + [_, .., _, _] => fail!(), [_, _] => fail!(), [a] => { assert_eq!(a, 1); @@ -51,17 +51,17 @@ fn b() { fn c() { let x = [1]; match x { - [2, .. _] => fail!(), - [.. _] => () + [2, ..] => fail!(), + [..] => () } } fn d() { let x = [1, 2, 3]; let branch = match x { - [1, 1, .. _] => 0, - [1, 2, 3, .. _] => 1, - [1, 2, .. _] => 2, + [1, 1, ..] => 0, + [1, 2, 3, ..] => 1, + [1, 2, ..] => 2, _ => 3 }; assert_eq!(branch, 1); diff --git a/src/test/run-pass/vec-tail-matching.rs b/src/test/run-pass/vec-tail-matching.rs index dc2b3d23b9e..1ab9e17523d 100644 --- a/src/test/run-pass/vec-tail-matching.rs +++ b/src/test/run-pass/vec-tail-matching.rs @@ -16,7 +16,7 @@ pub fn main() { assert!(tail[1].string == ~"baz"); match tail { - [Foo { _ }, _, Foo { _ }, .. _tail] => { + [Foo { .. }, _, Foo { .. }, .. _tail] => { unreachable!(); } [Foo { string: ref a }, Foo { string: ref b }] => { |
