]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/vec-matching.rs
librustc: Remove unique vector patterns from the language.
[rust.git] / src / test / run-pass / vec-matching.rs
index ced3baf3c3c7e812dd589ab872610bcbc77e6ea1..175f774bdfde01720577c9a17c2881ffe56a04ff 100644 (file)
@@ -9,28 +9,22 @@
 // except according to those terms.
 
 fn a() {
-    let x = ~[1];
+    let x = [1];
     match x {
-        [_, _, _, _, _, ..] => fail!(),
-        [.., _, _, _, _] => fail!(),
-        [_, .., _, _] => fail!(),
-        [_, _] => fail!(),
         [a] => {
             assert_eq!(a, 1);
         }
-        [] => fail!()
     }
 }
 
 fn b() {
-    let x = ~[1, 2, 3];
+    let x = [1, 2, 3];
     match x {
         [a, b, ..c] => {
             assert_eq!(a, 1);
             assert_eq!(b, 2);
             assert_eq!(c, &[3]);
         }
-        _ => fail!()
     }
     match x {
         [..a, b, c] => {
@@ -38,7 +32,6 @@ fn b() {
             assert_eq!(b, 2);
             assert_eq!(c, 3);
         }
-        _ => fail!()
     }
     match x {
         [a, ..b, c] => {
@@ -46,7 +39,6 @@ fn b() {
             assert_eq!(b, &[2]);
             assert_eq!(c, 3);
         }
-        _ => fail!()
     }
     match x {
         [a, b, c] => {
@@ -54,7 +46,6 @@ fn b() {
             assert_eq!(b, 2);
             assert_eq!(c, 3);
         }
-        _ => fail!()
     }
 }