@@ -31,7 +31,7 @@ use rustc_hir::def_id::{DefId, LocalDefId};
3131use rustc_hir:: intravisit:: { self , InferKind , Visitor , VisitorExt , walk_generics} ;
3232use rustc_hir:: { self as hir, GenericParamKind , HirId , Node , PreciseCapturingArgKind } ;
3333use rustc_infer:: infer:: { InferCtxt , TyCtxtInferExt } ;
34- use rustc_infer:: traits:: ObligationCause ;
34+ use rustc_infer:: traits:: { DynCompatibilityViolation , ObligationCause } ;
3535use rustc_middle:: hir:: nested_filter;
3636use rustc_middle:: query:: Providers ;
3737use rustc_middle:: ty:: util:: { Discr , IntTypeExt } ;
@@ -40,7 +40,7 @@ use rustc_middle::{bug, span_bug};
4040use rustc_span:: { DUMMY_SP , Ident , Span , Symbol , kw, sym} ;
4141use rustc_trait_selection:: error_reporting:: traits:: suggestions:: NextTypeParamName ;
4242use rustc_trait_selection:: infer:: InferCtxtExt ;
43- use rustc_trait_selection:: traits:: ObligationCtxt ;
43+ use rustc_trait_selection:: traits:: { ObligationCtxt , hir_ty_lowering_dyn_compatibility_violations } ;
4444use tracing:: { debug, instrument} ;
4545
4646use crate :: errors;
@@ -625,6 +625,10 @@ impl<'tcx> HirTyLowerer<'tcx> for ItemCtxt<'tcx> {
625625
626626 ( input_tys, output_ty)
627627 }
628+
629+ fn dyn_compatibility_violations ( & self , trait_def_id : DefId ) -> Vec < DynCompatibilityViolation > {
630+ hir_ty_lowering_dyn_compatibility_violations ( self . tcx , trait_def_id)
631+ }
628632}
629633
630634/// Synthesize a new lifetime name that doesn't clash with any of the lifetimes already present.
0 commit comments