Avoid invoking the full eq
infrastructure when all we want is to check a discriminant
This commit is contained in:
parent
72f144de24
commit
59bbbe78e2
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue