diff options
| author | Michael Goulet <michael@errs.io> | 2024-12-31 01:56:28 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-12-31 01:56:33 +0000 |
| commit | aea2a6f8361c95d60cc8e2757ca473f6915902a9 (patch) | |
| tree | 975e84cd34a60716d98febe5d63035a25ccce512 /compiler/rustc_middle | |
| parent | 7f75bfa1ad4e9a9d33a179a90603001515e91991 (diff) | |
Convert some Into impls into From impls
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/mir/interpret/error.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/adt.rs | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_middle/src/mir/interpret/error.rs b/compiler/rustc_middle/src/mir/interpret/error.rs index 37328470aa7..8c085fa310a 100644 --- a/compiler/rustc_middle/src/mir/interpret/error.rs +++ b/compiler/rustc_middle/src/mir/interpret/error.rs @@ -88,10 +88,10 @@ impl ReportedErrorInfo { } } -impl Into<ErrorGuaranteed> for ReportedErrorInfo { +impl From<ReportedErrorInfo> for ErrorGuaranteed { #[inline] - fn into(self) -> ErrorGuaranteed { - self.error + fn from(val: ReportedErrorInfo) -> Self { + val.error } } diff --git a/compiler/rustc_middle/src/ty/adt.rs b/compiler/rustc_middle/src/ty/adt.rs index 8f4137cc011..e28fcc555dc 100644 --- a/compiler/rustc_middle/src/ty/adt.rs +++ b/compiler/rustc_middle/src/ty/adt.rs @@ -249,9 +249,9 @@ pub enum AdtKind { Enum, } -impl Into<DataTypeKind> for AdtKind { - fn into(self) -> DataTypeKind { - match self { +impl From<AdtKind> for DataTypeKind { + fn from(val: AdtKind) -> Self { + match val { AdtKind::Struct => DataTypeKind::Struct, AdtKind::Union => DataTypeKind::Union, AdtKind::Enum => DataTypeKind::Enum, |
