about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_middle/src/traits/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/traits/mod.rs b/compiler/rustc_middle/src/traits/mod.rs
index dcd457957a8..04a4d073945 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<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)) },
         }
     }
 }