mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-26 14:43:24 +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>>>,
|
||||
}
|
||||
|
||||
impl<'tcx> From<ObligationCauseCode<'tcx>> for InternedObligationCauseCode<'tcx> {
|
||||
impl<'tcx> ObligationCauseCode<'tcx> {
|
||||
#[inline(always)]
|
||||
fn from(code: ObligationCauseCode<'tcx>) -> Self {
|
||||
Self {
|
||||
code: if let MISC_OBLIGATION_CAUSE_CODE = code { None } else { Some(Lrc::new(code)) },
|
||||
fn into(self) -> InternedObligationCauseCode<'tcx> {
|
||||
InternedObligationCauseCode {
|
||||
code: if let MISC_OBLIGATION_CAUSE_CODE = self { None } else { Some(Lrc::new(self)) },
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user