Rollup merge of #124381 - compiler-errors:derived-for-wf, r=lcnr
Renamed `DerivedObligation` to `WellFormedDeriveObligation` It's used when computing `WellFormed` obligations, so let's give it a less ambiguous name.
This commit is contained in:
commit
88eae31261
4 changed files with 11 additions and 6 deletions
|
@ -128,7 +128,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
|||
match obligation.cause.code() {
|
||||
ObligationCauseCode::BuiltinDerivedObligation(..)
|
||||
| ObligationCauseCode::ImplDerivedObligation(..)
|
||||
| ObligationCauseCode::DerivedObligation(..) => {}
|
||||
| ObligationCauseCode::WellFormedDerivedObligation(..) => {}
|
||||
_ => {
|
||||
// this is a "direct", user-specified, rather than derived,
|
||||
// obligation.
|
||||
|
|
|
@ -2294,7 +2294,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
|||
|
||||
next_code = Some(&cause.derived.parent_code);
|
||||
}
|
||||
ObligationCauseCode::DerivedObligation(derived_obligation)
|
||||
ObligationCauseCode::WellFormedDerivedObligation(derived_obligation)
|
||||
| ObligationCauseCode::BuiltinDerivedObligation(derived_obligation) => {
|
||||
let ty = derived_obligation.parent_trait_pred.skip_binder().self_ty();
|
||||
debug!(
|
||||
|
@ -3423,7 +3423,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
|||
)
|
||||
});
|
||||
}
|
||||
ObligationCauseCode::DerivedObligation(ref data) => {
|
||||
ObligationCauseCode::WellFormedDerivedObligation(ref data) => {
|
||||
let parent_trait_ref = self.resolve_vars_if_possible(data.parent_trait_pred);
|
||||
let parent_predicate = parent_trait_ref;
|
||||
// #74711: avoid a stack overflow
|
||||
|
|
|
@ -381,7 +381,7 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
|
|||
if let Some(parent_trait_pred) = predicate.to_opt_poly_trait_pred() {
|
||||
cause = cause.derived_cause(
|
||||
parent_trait_pred,
|
||||
traits::ObligationCauseCode::DerivedObligation,
|
||||
traits::ObligationCauseCode::WellFormedDerivedObligation,
|
||||
);
|
||||
}
|
||||
extend_cause_with_original_assoc_item_obligation(tcx, item, &mut cause, predicate);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue