mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Remove some lifetime-only ObligationCauseCode notes
This commit is contained in:
parent
54ee79b3b8
commit
0f9ab6371d
@ -2607,7 +2607,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||
| ObligationCauseCode::BinOp { .. }
|
||||
| ObligationCauseCode::AscribeUserTypeProvePredicate(..)
|
||||
| ObligationCauseCode::DropImpl
|
||||
| ObligationCauseCode::ConstParam(_) => {}
|
||||
| ObligationCauseCode::ConstParam(_)
|
||||
| ObligationCauseCode::ReferenceOutlivesReferent(..)
|
||||
| ObligationCauseCode::ObjectTypeBound(..) => {}
|
||||
ObligationCauseCode::RustCall => {
|
||||
if let Some(pred) = predicate.to_opt_poly_trait_pred()
|
||||
&& Some(pred.def_id()) == self.tcx.lang_items().sized_trait()
|
||||
@ -2621,16 +2623,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||
ObligationCauseCode::TupleElem => {
|
||||
err.note("only the last element of a tuple may have a dynamically sized type");
|
||||
}
|
||||
ObligationCauseCode::ReferenceOutlivesReferent(ref_ty) => {
|
||||
err.note(format!(
|
||||
"required so that reference `{ref_ty}` does not outlive its referent"
|
||||
));
|
||||
}
|
||||
ObligationCauseCode::ObjectTypeBound(object_ty, region) => {
|
||||
err.note(format!(
|
||||
"required so that the lifetime bound of `{region}` for `{object_ty}` is satisfied",
|
||||
));
|
||||
}
|
||||
ObligationCauseCode::ItemObligation(_)
|
||||
| ObligationCauseCode::ExprItemObligation(..) => {
|
||||
// We hold the `DefId` of the item introducing the obligation, but displaying it
|
||||
|
Loading…
Reference in New Issue
Block a user