diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2024-06-27 02:06:20 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-27 02:06:20 -0400 |
| commit | 73016dc8a41a494ddacf1b7e5b3b6a7852b3a74a (patch) | |
| tree | 583b45d6b952d0349316a81d81279958459a4424 | |
| parent | 8905be5ef30272c3c4ce8b3464be3dbed84a5213 (diff) | |
| parent | 518b74ec5d97317af70d3fdbc41eac903622a6b9 (diff) | |
| download | rust-73016dc8a41a494ddacf1b7e5b3b6a7852b3a74a.tar.gz rust-73016dc8a41a494ddacf1b7e5b3b6a7852b3a74a.zip | |
Rollup merge of #126983 - tgross35:f16-f128-smir, r=celinval
Remove `f16` and `f128` ICE paths from smir Just chasing down some possible ICE paths. ```@compiler-errors``` mentioned in https://github.com/rust-lang/rust/pull/121728#discussion_r1506133496 that it is okay not to support these in smir, but this change seems pretty trivial? r? ```@celinval``` since you reviewed https://github.com/rust-lang/rust/pull/114607#pullrequestreview-1771673591
| -rw-r--r-- | compiler/rustc_smir/src/rustc_internal/internal.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_smir/src/rustc_smir/convert/ty.rs | 4 | ||||
| -rw-r--r-- | compiler/stable_mir/src/ty.rs | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_smir/src/rustc_internal/internal.rs b/compiler/rustc_smir/src/rustc_internal/internal.rs index c9c1570a29a..7b5abcf4513 100644 --- a/compiler/rustc_smir/src/rustc_internal/internal.rs +++ b/compiler/rustc_smir/src/rustc_internal/internal.rs @@ -188,8 +188,10 @@ impl RustcInternal for FloatTy { fn internal<'tcx>(&self, _tables: &mut Tables<'_>, _tcx: TyCtxt<'tcx>) -> Self::T<'tcx> { match self { + FloatTy::F16 => rustc_ty::FloatTy::F16, FloatTy::F32 => rustc_ty::FloatTy::F32, FloatTy::F64 => rustc_ty::FloatTy::F64, + FloatTy::F128 => rustc_ty::FloatTy::F128, } } } diff --git a/compiler/rustc_smir/src/rustc_smir/convert/ty.rs b/compiler/rustc_smir/src/rustc_smir/convert/ty.rs index 9cd841bba10..74c3fcc9b9e 100644 --- a/compiler/rustc_smir/src/rustc_smir/convert/ty.rs +++ b/compiler/rustc_smir/src/rustc_smir/convert/ty.rs @@ -304,10 +304,10 @@ impl<'tcx> Stable<'tcx> for ty::FloatTy { fn stable(&self, _: &mut Tables<'_>) -> Self::T { match self { - ty::FloatTy::F16 => unimplemented!("f16_f128"), + ty::FloatTy::F16 => FloatTy::F16, ty::FloatTy::F32 => FloatTy::F32, ty::FloatTy::F64 => FloatTy::F64, - ty::FloatTy::F128 => unimplemented!("f16_f128"), + ty::FloatTy::F128 => FloatTy::F128, } } } diff --git a/compiler/stable_mir/src/ty.rs b/compiler/stable_mir/src/ty.rs index 8c120a96e75..01e4f1d1f33 100644 --- a/compiler/stable_mir/src/ty.rs +++ b/compiler/stable_mir/src/ty.rs @@ -608,8 +608,10 @@ impl UintTy { #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum FloatTy { + F16, F32, F64, + F128, } #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
