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