Simplify derived obligation peeling
This commit is contained in:
parent
87fd70c107
commit
2ea2ced2be
1 changed files with 5 additions and 15 deletions
|
@ -694,29 +694,19 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
|
||||||
}
|
}
|
||||||
ObligationCauseCode::ImplDerivedObligation(
|
ObligationCauseCode::ImplDerivedObligation(
|
||||||
box ImplDerivedObligationCause {
|
box ImplDerivedObligationCause {
|
||||||
derived:
|
derived,
|
||||||
DerivedObligationCause {
|
|
||||||
parent_code,
|
|
||||||
parent_trait_pred,
|
|
||||||
},
|
|
||||||
..
|
..
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
| ObligationCauseCode::BuiltinDerivedObligation(
|
| ObligationCauseCode::BuiltinDerivedObligation(
|
||||||
DerivedObligationCause {
|
derived,
|
||||||
parent_code,
|
|
||||||
parent_trait_pred,
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
| ObligationCauseCode::DerivedObligation(
|
| ObligationCauseCode::DerivedObligation(
|
||||||
DerivedObligationCause {
|
derived,
|
||||||
parent_code,
|
|
||||||
parent_trait_pred,
|
|
||||||
},
|
|
||||||
) => {
|
) => {
|
||||||
peeled = true;
|
peeled = true;
|
||||||
code = &parent_code;
|
code = &derived.parent_code;
|
||||||
trait_pred = *parent_trait_pred;
|
trait_pred = derived.parent_trait_pred;
|
||||||
}
|
}
|
||||||
_ => break,
|
_ => break,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue