Skip to content

Commit

Permalink
Force inline InternedObligationCauseCode creation
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed May 16, 2022
1 parent 59bbbe7 commit 0cefa5f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/rustc_middle/src/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)) },
}
}
}
Expand Down

0 comments on commit 0cefa5f

Please sign in to comment.