about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2024-05-16 04:05:34 -0500
committerTrevor Gross <tmgross@umich.edu>2024-05-16 04:07:02 -0500
commit488ddd3bbc2bb1d5956b3d677f3012694610a8c6 (patch)
treee0ca5f1d1b82f243cf026b513d4bf066e6ef97a0 /compiler/rustc_codegen_ssa/src
parentb71e8cbaf2c7cae4d36898fff1d0ba19d9233082 (diff)
downloadrust-488ddd3bbc2bb1d5956b3d677f3012694610a8c6.tar.gz
rust-488ddd3bbc2bb1d5956b3d677f3012694610a8c6.zip
Fix assertion when attempting to convert `f16` and `f128` with `as`
These types are currently rejected for `as` casts by the compiler.
Remove this incorrect check and add codegen tests for all conversions
involving these types.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/traits/builder.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/traits/builder.rs b/compiler/rustc_codegen_ssa/src/traits/builder.rs
index fdeccb90700..9fd6eb8edab 100644
--- a/compiler/rustc_codegen_ssa/src/traits/builder.rs
+++ b/compiler/rustc_codegen_ssa/src/traits/builder.rs
@@ -247,7 +247,10 @@ pub trait BuilderMethods<'a, 'tcx>:
         } else {
             (in_ty, dest_ty)
         };
-        assert!(matches!(self.cx().type_kind(float_ty), TypeKind::Float | TypeKind::Double));
+        assert!(matches!(
+            self.cx().type_kind(float_ty),
+            TypeKind::Half | TypeKind::Float | TypeKind::Double | TypeKind::FP128
+        ));
         assert_eq!(self.cx().type_kind(int_ty), TypeKind::Integer);
 
         if let Some(false) = self.cx().sess().opts.unstable_opts.saturating_float_casts {