about summary refs log tree commit diff
path: root/src/test/compile-fail/repeat_count.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/compile-fail/repeat_count.rs')
-rw-r--r--src/test/compile-fail/repeat_count.rs35
1 files changed, 27 insertions, 8 deletions
diff --git a/src/test/compile-fail/repeat_count.rs b/src/test/compile-fail/repeat_count.rs
index e94bf19955b..df69e13bf1e 100644
--- a/src/test/compile-fail/repeat_count.rs
+++ b/src/test/compile-fail/repeat_count.rs
@@ -14,14 +14,33 @@ fn main() {
     let n = 1;
     let a = [0; n]; //~ ERROR expected constant integer for repeat count, found variable
     let b = [0; ()];
-//~^ ERROR expected constant integer for repeat count, found non-constant expression
-//~^^ ERROR: expected `usize`, found `()`
-    let c = [0; true]; //~ ERROR expected positive integer for repeat count, found boolean
-    //~^ ERROR: expected `usize`, found `bool`
-    let d = [0; 0.5]; //~ ERROR expected positive integer for repeat count, found float
-    //~^ ERROR: expected `usize`, found `_`
-    let e = [0; "foo"]; //~ ERROR expected positive integer for repeat count, found string
-    //~^ ERROR: expected `usize`, found `&'static str`
+//~^ ERROR mismatched types
+//~| expected `usize`
+//~| found `()`
+//~| expected usize
+//~| found ()
+//~| ERROR expected constant integer for repeat count, found non-constant expression
+    let c = [0; true];
+    //~^ ERROR mismatched types
+    //~| expected `usize`
+    //~| found `bool`
+    //~| expected usize
+    //~| found bool
+    //~| ERROR expected positive integer for repeat count, found boolean
+    let d = [0; 0.5];
+    //~^ ERROR mismatched types
+    //~| expected `usize`
+    //~| found `_`
+    //~| expected usize
+    //~| found floating-point variable
+    //~| ERROR expected positive integer for repeat count, found float
+    let e = [0; "foo"];
+    //~^ ERROR mismatched types
+    //~| expected `usize`
+    //~| found `&'static str`
+    //~| expected usize
+    //~| found &-ptr
+    //~| ERROR expected positive integer for repeat count, found string
     let f = [0; -4];
     //~^ ERROR expected positive integer for repeat count, found negative integer
     let f = [0us; -1];