@@ -73,7 +73,6 @@ fn check_method_is_structurally_compatible<'tcx>(
73
73
compare_generic_param_kinds ( tcx, impl_m, trait_m, delay) ?;
74
74
compare_number_of_method_arguments ( tcx, impl_m, trait_m, delay) ?;
75
75
compare_synthetic_generics ( tcx, impl_m, trait_m, delay) ?;
76
- compare_asyncness ( tcx, impl_m, trait_m, delay) ?;
77
76
check_region_bounds_on_impl_item ( tcx, impl_m, trait_m, delay) ?;
78
77
Ok ( ( ) )
79
78
}
@@ -413,36 +412,6 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for RemapLateBound<'_, 'tcx> {
413
412
}
414
413
}
415
414
416
- fn compare_asyncness < ' tcx > (
417
- tcx : TyCtxt < ' tcx > ,
418
- impl_m : ty:: AssocItem ,
419
- trait_m : ty:: AssocItem ,
420
- delay : bool ,
421
- ) -> Result < ( ) , ErrorGuaranteed > {
422
- if tcx. asyncness ( trait_m. def_id ) . is_async ( ) {
423
- match tcx. fn_sig ( impl_m. def_id ) . skip_binder ( ) . skip_binder ( ) . output ( ) . kind ( ) {
424
- ty:: Alias ( ty:: Opaque , ..) => {
425
- // allow both `async fn foo()` and `fn foo() -> impl Future`
426
- }
427
- ty:: Error ( _) => {
428
- // We don't know if it's ok, but at least it's already an error.
429
- }
430
- _ => {
431
- return Err ( tcx
432
- . dcx ( )
433
- . create_err ( crate :: errors:: AsyncTraitImplShouldBeAsync {
434
- span : tcx. def_span ( impl_m. def_id ) ,
435
- method_name : trait_m. name ,
436
- trait_item_span : tcx. hir ( ) . span_if_local ( trait_m. def_id ) ,
437
- } )
438
- . emit_unless ( delay) ) ;
439
- }
440
- } ;
441
- }
442
-
443
- Ok ( ( ) )
444
- }
445
-
446
415
/// Given a method def-id in an impl, compare the method signature of the impl
447
416
/// against the trait that it's implementing. In doing so, infer the hidden types
448
417
/// that this method's signature provides to satisfy each return-position `impl Trait`
0 commit comments