about summary refs log tree commit diff
path: root/src/test/ui/associated-consts
diff options
context:
space:
mode:
authorBastian Kauschke <bastian_kauschke@hotmail.de>2020-11-17 11:44:21 +0100
committerBastian Kauschke <bastian_kauschke@hotmail.de>2020-12-26 18:24:10 +0100
commitc4ba60a191bccd2f2568572efb76e0e37e88dd21 (patch)
tree78fd9e211d1d9143b0d306ad2339a0c30d5e7c63 /src/test/ui/associated-consts
parent18fa7789cdeced758cb4e4db22061c31b4dbad80 (diff)
update tests
Diffstat (limited to 'src/test/ui/associated-consts')
-rw-r--r--src/test/ui/associated-consts/associated-const-type-parameter-arrays.rs5
-rw-r--r--src/test/ui/associated-consts/associated-const-type-parameter-arrays.stderr16
2 files changed, 7 insertions, 14 deletions
diff --git a/src/test/ui/associated-consts/associated-const-type-parameter-arrays.rs b/src/test/ui/associated-consts/associated-const-type-parameter-arrays.rs
index d51821059fc..5152d784047 100644
--- a/src/test/ui/associated-consts/associated-const-type-parameter-arrays.rs
+++ b/src/test/ui/associated-consts/associated-const-type-parameter-arrays.rs
@@ -14,8 +14,7 @@ impl Foo for Def {
 
 pub fn test<A: Foo, B: Foo>() {
     let _array: [u32; <A as Foo>::Y];
-    //~^ ERROR the trait bound `A: Foo` is not satisfied [E0277]
+    //~^ ERROR generic parameters may not be used
 }
 
-fn main() {
-}
+fn main() {}
diff --git a/src/test/ui/associated-consts/associated-const-type-parameter-arrays.stderr b/src/test/ui/associated-consts/associated-const-type-parameter-arrays.stderr
index ac40e390cfb..d3a1cd30e2b 100644
--- a/src/test/ui/associated-consts/associated-const-type-parameter-arrays.stderr
+++ b/src/test/ui/associated-consts/associated-const-type-parameter-arrays.stderr
@@ -1,17 +1,11 @@
-error[E0277]: the trait bound `A: Foo` is not satisfied
-  --> $DIR/associated-const-type-parameter-arrays.rs:16:23
+error: generic parameters may not be used in const operations
+  --> $DIR/associated-const-type-parameter-arrays.rs:16:24
    |
-LL |     const Y: usize;
-   |     --------------- required by `Foo::Y`
-...
 LL |     let _array: [u32; <A as Foo>::Y];
-   |                       ^^^^^^^^^^^^^ the trait `Foo` is not implemented for `A`
+   |                        ^ cannot perform const operation using `A`
    |
-help: consider further restricting this bound
-   |
-LL | pub fn test<A: Foo + Foo, B: Foo>() {
-   |                    ^^^^^
+   = note: type parameters may not be used in const expressions
+   = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0277`.