about summary refs log tree commit diff
path: root/src/test/ui/const-generics/const_evaluatable_checked
diff options
context:
space:
mode:
authorBastian Kauschke <bastian_kauschke@hotmail.de>2020-09-21 21:50:00 +0200
committerBastian Kauschke <bastian_kauschke@hotmail.de>2020-09-21 21:50:00 +0200
commit7a02ebd828c8d9c68e8e972326ede8696fb3f6b7 (patch)
tree27afdbc406f21e7543a2a40d37b5c8eee3501d7c /src/test/ui/const-generics/const_evaluatable_checked
parent30cbc9729654c66b9f54779d18f023e47112cdf2 (diff)
downloadrust-7a02ebd828c8d9c68e8e972326ede8696fb3f6b7.tar.gz
rust-7a02ebd828c8d9c68e8e972326ede8696fb3f6b7.zip
bless tests
Diffstat (limited to 'src/test/ui/const-generics/const_evaluatable_checked')
-rw-r--r--src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs4
-rw-r--r--src/test/ui/const-generics/const_evaluatable_checked/let-bindings.stderr26
2 files changed, 20 insertions, 10 deletions
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs b/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs
index d96788f8cd1..a6bb39208a4 100644
--- a/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs
+++ b/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs
@@ -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()
 }
 
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.stderr b/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.stderr
index 95fb48bd434..95fcde52af8 100644
--- a/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.stderr
+++ b/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.stderr
@@ -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