Skip to content

Commit af8b197

Browse files
Remove some lifetime-only ObligationCauseCode notes
1 parent 18f4b9f commit af8b197

File tree

1 file changed

+3
-11
lines changed
  • compiler/rustc_trait_selection/src/traits/error_reporting

1 file changed

+3
-11
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2608,7 +2608,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
26082608
| ObligationCauseCode::BinOp { .. }
26092609
| ObligationCauseCode::AscribeUserTypeProvePredicate(..)
26102610
| ObligationCauseCode::DropImpl
2611-
| ObligationCauseCode::ConstParam(_) => {}
2611+
| ObligationCauseCode::ConstParam(_)
2612+
| ObligationCauseCode::ReferenceOutlivesReferent(..)
2613+
| ObligationCauseCode::ObjectTypeBound(..) => {}
26122614
ObligationCauseCode::RustCall => {
26132615
if let Some(pred) = predicate.to_opt_poly_trait_pred()
26142616
&& Some(pred.def_id()) == self.tcx.lang_items().sized_trait()
@@ -2622,16 +2624,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
26222624
ObligationCauseCode::TupleElem => {
26232625
err.note("only the last element of a tuple may have a dynamically sized type");
26242626
}
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-
}
26352627
ObligationCauseCode::ItemObligation(_)
26362628
| ObligationCauseCode::ExprItemObligation(..) => {
26372629
// We hold the `DefId` of the item introducing the obligation, but displaying it

0 commit comments

Comments
 (0)