Force inline InternedObligationCauseCode creation

This commit is contained in:
Oli Scherer 2022-05-16 13:34:03 +00:00
parent 59bbbe78e2
commit 0cefa5fa18

View File

@ -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)) },
} }
} }
} }