1
Fork 0

Rollup merge of #100437 - compiler-errors:better-const-mismatch-err, r=oli-obk

Improve const mismatch `FulfillmentError`

Fixes #100414
This commit is contained in:
Matthias Krüger 2022-08-29 06:34:44 +02:00 committed by GitHub
commit 26c86c6993
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 194 additions and 45 deletions

View file

@ -469,6 +469,13 @@ impl<'tcx> ObligationCauseCode<'tcx> {
_ => None,
}
}
pub fn peel_match_impls(&self) -> &Self {
match self {
MatchImpl(cause, _) => cause.code(),
_ => self,
}
}
}
// `ObligationCauseCode` is used a lot. Make sure it doesn't unintentionally get bigger.