diff options
| author | bors <bors@rust-lang.org> | 2024-03-01 03:36:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-01 03:36:11 +0000 |
| commit | 6cbf0926d54c80ea6d15df333be9281f65bbeb36 (patch) | |
| tree | a68611bb2c60aed0f51ecea1c44568b40bfa61a5 /compiler/rustc_pattern_analysis | |
| parent | 6f435eb0eb2926cdb6640b3382b9e3e21ef05f07 (diff) | |
| parent | 406790e9d1f2a02f3b4d004cca7d33e69ef7dca5 (diff) | |
| download | rust-6cbf0926d54c80ea6d15df333be9281f65bbeb36.tar.gz rust-6cbf0926d54c80ea6d15df333be9281f65bbeb36.zip | |
Auto merge of #121728 - tgross35:f16-f128-step1-ty-updates, r=compiler-errors
Add stubs in IR and ABI for `f16` and `f128` This is the very first step toward the changes in https://github.com/rust-lang/rust/pull/114607 and the [`f16` and `f128` RFC](https://rust-lang.github.io/rfcs/3453-f16-and-f128.html). It adds the types to `rustc_type_ir::FloatTy` and `rustc_abi::Primitive`, and just propagates those out as `unimplemented!` stubs where necessary. These types do not parse yet so there is no feature gate, and it should be okay to use `unimplemented!`. The next steps will probably be AST support with parsing and the feature gate. r? `@compiler-errors` cc `@Nilstrieb` suggested breaking the PR up in https://github.com/rust-lang/rust/pull/120645#issuecomment-1925900572
Diffstat (limited to 'compiler/rustc_pattern_analysis')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/rustc.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_pattern_analysis/src/rustc.rs b/compiler/rustc_pattern_analysis/src/rustc.rs index 7a0562e12f1..f8839b0b590 100644 --- a/compiler/rustc_pattern_analysis/src/rustc.rs +++ b/compiler/rustc_pattern_analysis/src/rustc.rs @@ -604,6 +604,7 @@ impl<'p, 'tcx: 'p> RustcMatchCheckCtxt<'p, 'tcx> { let lo = lo.as_finite().map(|c| c.eval_bits(cx.tcx, cx.param_env)); let hi = hi.as_finite().map(|c| c.eval_bits(cx.tcx, cx.param_env)); match fty { + ty::FloatTy::F16 => unimplemented!("f16_f128"), ty::FloatTy::F32 => { use rustc_apfloat::ieee::Single; let lo = lo.map(Single::from_bits).unwrap_or(-Single::INFINITY); @@ -616,6 +617,7 @@ impl<'p, 'tcx: 'p> RustcMatchCheckCtxt<'p, 'tcx> { let hi = hi.map(Double::from_bits).unwrap_or(Double::INFINITY); F64Range(lo, hi, end) } + ty::FloatTy::F128 => unimplemented!("f16_f128"), } } _ => bug!("invalid type for range pattern: {}", ty.inner()), |
