mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 19:58:32 +00:00
Force inline InternedObligationCauseCode creation
This commit is contained in:
parent
59bbbe78e2
commit
0cefa5fa18
@ -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…
Reference in New Issue
Block a user