@@ -2607,7 +2607,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
26072607 | ObligationCauseCode :: BinOp { .. }
26082608 | ObligationCauseCode :: AscribeUserTypeProvePredicate ( ..)
26092609 | ObligationCauseCode :: DropImpl
2610- | ObligationCauseCode :: ConstParam ( _) => { }
2610+ | ObligationCauseCode :: ConstParam ( _)
2611+ | ObligationCauseCode :: ReferenceOutlivesReferent ( ..)
2612+ | ObligationCauseCode :: ObjectTypeBound ( ..) => { }
26112613 ObligationCauseCode :: RustCall => {
26122614 if let Some ( pred) = predicate. to_opt_poly_trait_pred ( )
26132615 && Some ( pred. def_id ( ) ) == self . tcx . lang_items ( ) . sized_trait ( )
@@ -2621,16 +2623,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
26212623 ObligationCauseCode :: TupleElem => {
26222624 err. note ( "only the last element of a tuple may have a dynamically sized type" ) ;
26232625 }
2624- ObligationCauseCode :: ReferenceOutlivesReferent ( ref_ty) => {
2625- err. note ( format ! (
2626- "required so that reference `{ref_ty}` does not outlive its referent"
2627- ) ) ;
2628- }
2629- ObligationCauseCode :: ObjectTypeBound ( object_ty, region) => {
2630- err. note ( format ! (
2631- "required so that the lifetime bound of `{region}` for `{object_ty}` is satisfied" ,
2632- ) ) ;
2633- }
26342626 ObligationCauseCode :: ItemObligation ( _)
26352627 | ObligationCauseCode :: ExprItemObligation ( ..) => {
26362628 // We hold the `DefId` of the item introducing the obligation, but displaying it
0 commit comments