Skip to content

Commit 0cefa5f

Browse files
committed
Force inline InternedObligationCauseCode creation
1 parent 59bbbe7 commit 0cefa5f

File tree

1 file changed

+4
-4
lines changed
  • compiler/rustc_middle/src/traits

1 file changed

+4
-4
lines changed

compiler/rustc_middle/src/traits/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,11 @@ pub struct InternedObligationCauseCode<'tcx> {
203203
code: Option<Lrc<ObligationCauseCode<'tcx>>>,
204204
}
205205

206-
impl<'tcx> From<ObligationCauseCode<'tcx>> for InternedObligationCauseCode<'tcx> {
206+
impl<'tcx> ObligationCauseCode<'tcx> {
207207
#[inline(always)]
208-
fn from(code: ObligationCauseCode<'tcx>) -> Self {
209-
Self {
210-
code: if let MISC_OBLIGATION_CAUSE_CODE = code { None } else { Some(Lrc::new(code)) },
208+
fn into(self) -> InternedObligationCauseCode<'tcx> {
209+
InternedObligationCauseCode {
210+
code: if let MISC_OBLIGATION_CAUSE_CODE = self { None } else { Some(Lrc::new(self)) },
211211
}
212212
}
213213
}

0 commit comments

Comments
 (0)