@@ -2607,7 +2607,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
2607
2607
| ObligationCauseCode :: BinOp { .. }
2608
2608
| ObligationCauseCode :: AscribeUserTypeProvePredicate ( ..)
2609
2609
| ObligationCauseCode :: DropImpl
2610
- | ObligationCauseCode :: ConstParam ( _) => { }
2610
+ | ObligationCauseCode :: ConstParam ( _)
2611
+ | ObligationCauseCode :: ReferenceOutlivesReferent ( ..)
2612
+ | ObligationCauseCode :: ObjectTypeBound ( ..) => { }
2611
2613
ObligationCauseCode :: RustCall => {
2612
2614
if let Some ( pred) = predicate. to_opt_poly_trait_pred ( )
2613
2615
&& Some ( pred. def_id ( ) ) == self . tcx . lang_items ( ) . sized_trait ( )
@@ -2621,16 +2623,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
2621
2623
ObligationCauseCode :: TupleElem => {
2622
2624
err. note ( "only the last element of a tuple may have a dynamically sized type" ) ;
2623
2625
}
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
- }
2634
2626
ObligationCauseCode :: ItemObligation ( _)
2635
2627
| ObligationCauseCode :: ExprItemObligation ( ..) => {
2636
2628
// We hold the `DefId` of the item introducing the obligation, but displaying it
0 commit comments