mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-14 21:16:50 +00:00
Avoid invoking the full eq
infrastructure when all we want is to check a discriminant
This commit is contained in:
parent
72f144de24
commit
59bbbe78e2
@ -206,7 +206,9 @@ pub struct InternedObligationCauseCode<'tcx> {
|
||||
impl<'tcx> From<ObligationCauseCode<'tcx>> for InternedObligationCauseCode<'tcx> {
|
||||
#[inline(always)]
|
||||
fn from(code: ObligationCauseCode<'tcx>) -> Self {
|
||||
Self { code: if code == MISC_OBLIGATION_CAUSE_CODE { None } else { Some(Lrc::new(code)) } }
|
||||
Self {
|
||||
code: if let MISC_OBLIGATION_CAUSE_CODE = code { None } else { Some(Lrc::new(code)) },
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user