@@ -465,7 +465,7 @@ pub enum SubregionOrigin<'tcx> {
465465 trait_item_def_id : DefId ,
466466 } ,
467467
468- AscribeUserTypeProvePredicate ( Span ) ,
468+ AscribeUserTypeProvePredicate ( Span , DefId ) ,
469469
470470 // FIXME(-Zassumptions-on-binders): this is a temporary hack until we support
471471 // proper diagnostics for solver region constraints.
@@ -480,7 +480,9 @@ impl<'tcx> SubregionOrigin<'tcx> {
480480 pub fn to_constraint_category ( & self ) -> ConstraintCategory < ' tcx > {
481481 match self {
482482 Self :: Subtype ( type_trace) => type_trace. cause . to_constraint_category ( ) ,
483- Self :: AscribeUserTypeProvePredicate ( span) => ConstraintCategory :: Predicate ( * span) ,
483+ Self :: AscribeUserTypeProvePredicate ( span, def_id) => {
484+ ConstraintCategory :: Predicate ( * span, * def_id)
485+ }
484486 Self :: SolverRegionConstraint ( span) => ConstraintCategory :: SolverRegionConstraint ( * span) ,
485487 _ => ConstraintCategory :: BoringNoLocation ,
486488 }
@@ -1836,7 +1838,7 @@ impl<'tcx> SubregionOrigin<'tcx> {
18361838 SubregionOrigin :: Reborrow ( a) => a,
18371839 SubregionOrigin :: ReferenceOutlivesReferent ( _, a) => a,
18381840 SubregionOrigin :: CompareImplItemObligation { span, .. } => span,
1839- SubregionOrigin :: AscribeUserTypeProvePredicate ( span) => span,
1841+ SubregionOrigin :: AscribeUserTypeProvePredicate ( span, _ ) => span,
18401842 SubregionOrigin :: CheckAssociatedTypeBounds { ref parent, .. } => parent. span ( ) ,
18411843 SubregionOrigin :: SolverRegionConstraint ( a) => a,
18421844 }
@@ -1870,8 +1872,8 @@ impl<'tcx> SubregionOrigin<'tcx> {
18701872 parent : Box :: new ( default ( ) ) ,
18711873 } ,
18721874
1873- traits:: ObligationCauseCode :: AscribeUserTypeProvePredicate ( span) => {
1874- SubregionOrigin :: AscribeUserTypeProvePredicate ( span)
1875+ traits:: ObligationCauseCode :: AscribeUserTypeProvePredicate ( span, def_id ) => {
1876+ SubregionOrigin :: AscribeUserTypeProvePredicate ( span, def_id )
18751877 }
18761878
18771879 traits:: ObligationCauseCode :: ObjectTypeBound ( ty, _reg) => {
0 commit comments