Improve selection errors for ~const trait bounds

This commit is contained in:
Deadbeef
2021-12-24 22:50:44 +08:00
parent 17dfae79bb
commit fdf7d01088
23 changed files with 323 additions and 203 deletions

View File

@@ -2413,7 +2413,7 @@ impl<'tcx> TraitObligationExt<'tcx> for TraitObligation<'tcx> {
// chain. Ideally, we should have a way to configure this either
// by using -Z verbose or just a CLI argument.
let derived_cause = DerivedObligationCause {
parent_trait_ref: obligation.predicate.to_poly_trait_ref(),
parent_trait_pred: obligation.predicate,
parent_code: obligation.cause.clone_code(),
};
let derived_code = variant(derived_cause);