Skip to content

Commit 72acd94

Browse files
committed
Add const-generics test.
1 parent be2641a commit 72acd94

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![allow(incomplete_features)]
2+
#![feature(generic_const_exprs)]
3+
#![feature(trait_alias)]
4+
5+
trait Bar<const N: usize> {}
6+
7+
trait BB = Bar<{ 2 + 1 }>;
8+
9+
fn foo(x: &dyn BB) {}
10+
//~^ ERROR the trait alias `BB` cannot be made into an object [E0038]
11+
12+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0038]: the trait alias `BB` cannot be made into an object
2+
--> $DIR/self-in-const-generics.rs:9:16
3+
|
4+
LL | fn foo(x: &dyn BB) {}
5+
| ^^
6+
|
7+
= note: it cannot use `Self` as a type parameter in a supertrait or `where`-clause
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0038`.

0 commit comments

Comments
 (0)