Skip to content

Commit 30c64d8

Browse files
authored
Rollup merge of rust-lang#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 rust-lang#121728 (comment) that it is okay not to support these in smir, but this change seems pretty trivial? r? ``@celinval`` since you reviewed rust-lang#114607 (review)
2 parents 63e00dc + 518b74e commit 30c64d8

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

compiler/rustc_smir/src/rustc_internal/internal.rs

+2
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,10 @@ impl RustcInternal for FloatTy {
188188

189189
fn internal<'tcx>(&self, _tables: &mut Tables<'_>, _tcx: TyCtxt<'tcx>) -> Self::T<'tcx> {
190190
match self {
191+
FloatTy::F16 => rustc_ty::FloatTy::F16,
191192
FloatTy::F32 => rustc_ty::FloatTy::F32,
192193
FloatTy::F64 => rustc_ty::FloatTy::F64,
194+
FloatTy::F128 => rustc_ty::FloatTy::F128,
193195
}
194196
}
195197
}

compiler/rustc_smir/src/rustc_smir/convert/ty.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,10 @@ impl<'tcx> Stable<'tcx> for ty::FloatTy {
304304

305305
fn stable(&self, _: &mut Tables<'_>) -> Self::T {
306306
match self {
307-
ty::FloatTy::F16 => unimplemented!("f16_f128"),
307+
ty::FloatTy::F16 => FloatTy::F16,
308308
ty::FloatTy::F32 => FloatTy::F32,
309309
ty::FloatTy::F64 => FloatTy::F64,
310-
ty::FloatTy::F128 => unimplemented!("f16_f128"),
310+
ty::FloatTy::F128 => FloatTy::F128,
311311
}
312312
}
313313
}

compiler/stable_mir/src/ty.rs

+2
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,10 @@ impl UintTy {
608608

609609
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
610610
pub enum FloatTy {
611+
F16,
611612
F32,
612613
F64,
614+
F128,
613615
}
614616

615617
#[derive(Clone, Copy, Debug, PartialEq, Eq)]

0 commit comments

Comments
 (0)