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