Note binding obligation causes for const equate errors

This commit is contained in:
Michael Goulet
2022-08-12 03:13:45 +00:00
parent 4e976262a1
commit 4ff587263e
6 changed files with 101 additions and 3 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.