about summary refs log tree commit diff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorDylan MacKenzie <ecstaticmorse@gmail.com>2019-11-06 12:29:30 -0800
committerDylan MacKenzie <ecstaticmorse@gmail.com>2019-11-13 10:44:14 -0800
commit3ce8ca45d63a65e0c0eaaa4a29f8ce3ccf5350b9 (patch)
tree4ac7348764714836fb5c03797498b6414b16e663 /src/test/compile-fail
parent67336bb399deac766faed5e13a032f017c3353b3 (diff)
Bless const tests with improved diagnostics
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/consts/const-fn-error.rs1
-rw-r--r--src/test/compile-fail/issue-52443.rs4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/test/compile-fail/consts/const-fn-error.rs b/src/test/compile-fail/consts/const-fn-error.rs
index 1de23f2a5e9..6f414dab88e 100644
--- a/src/test/compile-fail/consts/const-fn-error.rs
+++ b/src/test/compile-fail/consts/const-fn-error.rs
@@ -10,6 +10,7 @@ const fn f(x: usize) -> usize {
         //~| ERROR E0019
         //~| ERROR E0019
         //~| ERROR E0080
+        //~| ERROR E0744
         sum += i;
     }
     sum
diff --git a/src/test/compile-fail/issue-52443.rs b/src/test/compile-fail/issue-52443.rs
index 28d9937b5e8..90b9a1c265a 100644
--- a/src/test/compile-fail/issue-52443.rs
+++ b/src/test/compile-fail/issue-52443.rs
@@ -1,12 +1,16 @@
 fn main() {
     [(); & { loop { continue } } ]; //~ ERROR mismatched types
+    //~^ ERROR `loop` is not allowed in a `const`
     [(); loop { break }]; //~ ERROR mismatched types
+    //~^ ERROR `loop` is not allowed in a `const`
     [(); {while true {break}; 0}];
     //~^ ERROR constant contains unimplemented expression type
     //~| ERROR constant contains unimplemented expression type
+    //~| ERROR `while` is not allowed in a `const`
     //~| WARN denote infinite loops with
     [(); { for _ in 0usize.. {}; 0}];
     //~^ ERROR calls in constants are limited to constant functions
+    //~| ERROR `for` is not allowed in a `const`
     //~| ERROR references in constants may only refer to immutable values
     //~| ERROR constant contains unimplemented expression type
     //~| ERROR constant contains unimplemented expression type