Skip to content

Commit 1606f27

Browse files
committed
Add f16 and f128 to rustc_smir and rustc_trait_selection
These two crates check successfully at this point
1 parent 70cdc47 commit 1606f27

File tree

3 files changed

+7
-1
lines changed
  • compiler
    • rustc_smir/src
    • rustc_trait_selection/src/solve/assembly

3 files changed

+7
-1
lines changed

compiler/rustc_smir/src/rustc_smir/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,8 +956,10 @@ impl<'tcx> Stable<'tcx> for ty::FloatTy {
956956

957957
fn stable(&self, _: &mut Tables<'tcx>) -> Self::T {
958958
match self {
959+
ty::FloatTy::F16 => FloatTy::F16,
959960
ty::FloatTy::F32 => FloatTy::F32,
960961
ty::FloatTy::F64 => FloatTy::F64,
962+
ty::FloatTy::F128 => FloatTy::F128,
961963
}
962964
}
963965
}

compiler/rustc_smir/src/stable_mir/ty.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ pub enum UintTy {
6767

6868
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6969
pub enum FloatTy {
70+
F16,
7071
F32,
7172
F64,
73+
F128,
7274
}
7375

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

compiler/rustc_trait_selection/src/solve/assembly/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,10 +515,12 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
515515

516516
ty::Infer(ty::FloatVar(_)) => {
517517
// This causes a compiler error if any new float kinds are added.
518-
let (ty::FloatTy::F32 | ty::FloatTy::F64);
518+
let (ty::FloatTy::F16 | ty::FloatTy::F32 | ty::FloatTy::F64 | ty::FloatTy::F128);
519519
let possible_floats = [
520+
SimplifiedType::Float(ty::FloatTy::F16),
520521
SimplifiedType::Float(ty::FloatTy::F32),
521522
SimplifiedType::Float(ty::FloatTy::F64),
523+
SimplifiedType::Float(ty::FloatTy::F128),
522524
];
523525

524526
for simp in possible_floats {

0 commit comments

Comments
 (0)