diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-05-16 13:34:03 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-05-16 13:34:03 +0000 |
| commit | 0cefa5fa183fc2ff672d68a4c67009b79ded76e4 (patch) | |
| tree | 7fb590df375fb3e40eb853c56073ad16f520bafd | |
| parent | 59bbbe78e2ddf6f5c823372890b928fe19e41ac3 (diff) | |
| download | rust-0cefa5fa183fc2ff672d68a4c67009b79ded76e4.tar.gz rust-0cefa5fa183fc2ff672d68a4c67009b79ded76e4.zip | |
Force inline InternedObligationCauseCode creation
| -rw-r--r-- | compiler/rustc_middle/src/traits/mod.rs | 8 |
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)) }, } } } |
