]> git.lizzy.rs Git - rust.git/commitdiff
bless tests
authorBastian Kauschke <bastian_kauschke@hotmail.de>
Mon, 21 Sep 2020 19:50:00 +0000 (21:50 +0200)
committerBastian Kauschke <bastian_kauschke@hotmail.de>
Mon, 21 Sep 2020 19:50:00 +0000 (21:50 +0200)
src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs
src/test/ui/const-generics/const_evaluatable_checked/let-bindings.stderr

index d96788f8cd100510437c26612f9368f23313cfa6..a6bb39208a42d9d2b16a0c0ec4013d652ac18f20 100644 (file)
@@ -4,8 +4,8 @@
 // We do not yet want to support let-bindings in abstract consts,
 // so this test should keep failing for now.
 fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default {
-    //~^ ERROR constant expression depends
-    //~| ERROR constant expression depends
+    //~^ ERROR overly complex generic constant
+    //~| ERROR overly complex generic constant
     Default::default()
 }
 
index 95fb48bd434027c88245a0a1864b74f3f0233822..95fcde52af820e06c94e043b198ab85b170e8daa 100644 (file)
@@ -1,18 +1,28 @@
-error: constant expression depends on a generic parameter
-  --> $DIR/let-bindings.rs:6:91
+error: overly complex generic constant
+  --> $DIR/let-bindings.rs:6:68
    |
 LL | fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default {
-   |                                                                                           ^^^^^^^ required by this bound in `test::{{constant}}#0`
+   |                                                                    ^^^^^^^^^^^^^^^^^^^^
    |
-   = note: this may fail depending on what value the parameter takes
+note: unsupported statement
+  --> $DIR/let-bindings.rs:6:74
+   |
+LL | fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default {
+   |                                                                          ^
+   = help: consider moving this anonymous constant into a `const` function
 
-error: constant expression depends on a generic parameter
-  --> $DIR/let-bindings.rs:6:30
+error: overly complex generic constant
+  --> $DIR/let-bindings.rs:6:35
    |
 LL | fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default {
-   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                                   ^^^^^^^^^^^^^^^^^^^^
    |
-   = note: this may fail depending on what value the parameter takes
+note: unsupported statement
+  --> $DIR/let-bindings.rs:6:41
+   |
+LL | fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default {
+   |                                         ^
+   = help: consider moving this anonymous constant into a `const` function
 
 error: aborting due to 2 previous errors