Remove some lifetime-only ObligationCauseCode notes
This commit is contained in:
parent
54ee79b3b8
commit
0f9ab6371d
1 changed files with 3 additions and 11 deletions
|
@ -2607,7 +2607,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||||
| ObligationCauseCode::BinOp { .. }
|
| ObligationCauseCode::BinOp { .. }
|
||||||
| ObligationCauseCode::AscribeUserTypeProvePredicate(..)
|
| ObligationCauseCode::AscribeUserTypeProvePredicate(..)
|
||||||
| ObligationCauseCode::DropImpl
|
| ObligationCauseCode::DropImpl
|
||||||
| ObligationCauseCode::ConstParam(_) => {}
|
| ObligationCauseCode::ConstParam(_)
|
||||||
|
| ObligationCauseCode::ReferenceOutlivesReferent(..)
|
||||||
|
| ObligationCauseCode::ObjectTypeBound(..) => {}
|
||||||
ObligationCauseCode::RustCall => {
|
ObligationCauseCode::RustCall => {
|
||||||
if let Some(pred) = predicate.to_opt_poly_trait_pred()
|
if let Some(pred) = predicate.to_opt_poly_trait_pred()
|
||||||
&& Some(pred.def_id()) == self.tcx.lang_items().sized_trait()
|
&& Some(pred.def_id()) == self.tcx.lang_items().sized_trait()
|
||||||
|
@ -2621,16 +2623,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||||
ObligationCauseCode::TupleElem => {
|
ObligationCauseCode::TupleElem => {
|
||||||
err.note("only the last element of a tuple may have a dynamically sized type");
|
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::ItemObligation(_)
|
||||||
| ObligationCauseCode::ExprItemObligation(..) => {
|
| ObligationCauseCode::ExprItemObligation(..) => {
|
||||||
// We hold the `DefId` of the item introducing the obligation, but displaying it
|
// We hold the `DefId` of the item introducing the obligation, but displaying it
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue