]> git.lizzy.rs Git - rust.git/commitdiff
Update error_codes.rs with new subslice syntax.
authorMazdak Farrokhzad <twingoow@gmail.com>
Wed, 10 Jul 2019 16:53:39 +0000 (18:53 +0200)
committerMazdak Farrokhzad <twingoow@gmail.com>
Sun, 28 Jul 2019 04:53:39 +0000 (06:53 +0200)
src/librustc_typeck/error_codes.rs

index 19d5e8b3e84470eae62ca5a4bb878b4b6d99f237..b4c856921198eedcf9a912695ffbfba6efacb8cb 100644 (file)
@@ -3497,8 +3497,8 @@ fn fly(&self) {} // And now that's ok!
 
 let r = &[1, 2];
 match r {
-    &[a, b, c, rest..] => { // error: pattern requires at least 3
-                            //        elements but array has 2
+    &[a, b, c, rest @ ..] => { // error: pattern requires at least 3
+                               //        elements but array has 2
         println!("a={}, b={}, c={} rest={:?}", a, b, c, rest);
     }
 }
@@ -3512,7 +3512,7 @@ fn fly(&self) {} // And now that's ok!
 
 let r = &[1, 2, 3, 4, 5];
 match r {
-    &[a, b, c, rest..] => { // ok!
+    &[a, b, c, rest @ ..] => { // ok!
         // prints `a=1, b=2, c=3 rest=[4, 5]`
         println!("a={}, b={}, c={} rest={:?}", a, b, c, rest);
     }