File tree 3 files changed +49
-0
lines changed
tests/ui/async-await/in-trait
3 files changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ error[E0053]: method `foo` has an incompatible generic parameter for trait `Foo`
2
+ --> $DIR/generics-mismatch.rs:13:18
3
+ |
4
+ LL | trait Foo {
5
+ | ---
6
+ LL | async fn foo<T>();
7
+ | - expected type parameter
8
+ ...
9
+ LL | impl Foo for () {
10
+ | ---------------
11
+ LL | async fn foo<const N: usize>() {}
12
+ | ^^^^^^^^^^^^^^ found const parameter of type `usize`
13
+
14
+ error: aborting due to previous error
15
+
16
+ For more information about this error, try `rustc --explain E0053`.
Original file line number Diff line number Diff line change
1
+ error[E0053]: method `foo` has an incompatible generic parameter for trait `Foo`
2
+ --> $DIR/generics-mismatch.rs:13:18
3
+ |
4
+ LL | trait Foo {
5
+ | ---
6
+ LL | async fn foo<T>();
7
+ | - expected type parameter
8
+ ...
9
+ LL | impl Foo for () {
10
+ | ---------------
11
+ LL | async fn foo<const N: usize>() {}
12
+ | ^^^^^^^^^^^^^^ found const parameter of type `usize`
13
+
14
+ error: aborting due to previous error
15
+
16
+ For more information about this error, try `rustc --explain E0053`.
Original file line number Diff line number Diff line change
1
+ // edition: 2021
2
+ // [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
3
+ // revisions: current next
4
+
5
+ #![ feature( async_fn_in_trait) ]
6
+ #![ allow( incomplete_features) ]
7
+
8
+ trait Foo {
9
+ async fn foo < T > ( ) ;
10
+ }
11
+
12
+ impl Foo for ( ) {
13
+ async fn foo < const N : usize > ( ) { }
14
+ //~^ ERROR: method `foo` has an incompatible generic parameter for trait `Foo` [E0053]
15
+ }
16
+
17
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments