Force inline InternedObligationCauseCode creation
This commit is contained in:
parent
59bbbe78e2
commit
0cefa5fa18
1 changed files with 4 additions and 4 deletions
|
@ -203,11 +203,11 @@ pub struct InternedObligationCauseCode<'tcx> {
|
||||||
code: Option<Lrc<ObligationCauseCode<'tcx>>>,
|
code: Option<Lrc<ObligationCauseCode<'tcx>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> From<ObligationCauseCode<'tcx>> for InternedObligationCauseCode<'tcx> {
|
impl<'tcx> ObligationCauseCode<'tcx> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn from(code: ObligationCauseCode<'tcx>) -> Self {
|
fn into(self) -> InternedObligationCauseCode<'tcx> {
|
||||||
Self {
|
InternedObligationCauseCode {
|
||||||
code: if let MISC_OBLIGATION_CAUSE_CODE = code { None } else { Some(Lrc::new(code)) },
|
code: if let MISC_OBLIGATION_CAUSE_CODE = self { None } else { Some(Lrc::new(self)) },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue