diff --git a/compiler/rustc_middle/src/traits/mod.rs b/compiler/rustc_middle/src/traits/mod.rs index dcd457957a819..04a4d07394565 100644 --- a/compiler/rustc_middle/src/traits/mod.rs +++ b/compiler/rustc_middle/src/traits/mod.rs @@ -203,11 +203,11 @@ pub struct InternedObligationCauseCode<'tcx> { code: Option>>, } -impl<'tcx> From> 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)) }, } } }