about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-09-24 20:34:22 +0200
committerGitHub <noreply@github.com>2025-09-24 20:34:22 +0200
commit2320fc3a3828c0cfc4d1471d9fd30becdd045faa (patch)
tree84e6e4cd32f8111b9f41838baf4c689701905c09 /compiler
parent4e225ee72dfe55a249f09dc40a0c4c58f29b637c (diff)
parente8a8e061bf0187efbb33d972e31ef2b5d9f6d529 (diff)
downloadrust-2320fc3a3828c0cfc4d1471d9fd30becdd045faa.tar.gz
rust-2320fc3a3828c0cfc4d1471d9fd30becdd045faa.zip
Rollup merge of #146915 - clarfonthey:safe-intrinsics-2, r=RalfJung
Make missed precondition-free float intrinsics safe

So, in my defence, these were both separated out from the other intrinsics in the file *and* had a different safety comment in the stable versions, so, I didn't notice them before. But, in my offence, the entire reason I did the previous PR was because I was using them for SIMD intrinsic fallbacks, and `fabs` is needed for those too, so, I don't really have an excuse.

Extra follow-up to rust-lang/rust#146683.

r? ```@RalfJung``` who reviewed the previous one

These don't appear to be used anywhere outside of the standard locations, at least.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_hir_analysis/src/check/intrinsic.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/intrinsic.rs b/compiler/rustc_hir_analysis/src/check/intrinsic.rs
index 6faa67f6a90..bc3448be582 100644
--- a/compiler/rustc_hir_analysis/src/check/intrinsic.rs
+++ b/compiler/rustc_hir_analysis/src/check/intrinsic.rs
@@ -90,6 +90,10 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
         | sym::contract_check_ensures
         | sym::contract_check_requires
         | sym::contract_checks
+        | sym::copysignf16
+        | sym::copysignf32
+        | sym::copysignf64
+        | sym::copysignf128
         | sym::cosf16
         | sym::cosf32
         | sym::cosf64
@@ -106,6 +110,10 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
         | sym::expf32
         | sym::expf64
         | sym::expf128
+        | sym::fabsf16
+        | sym::fabsf32
+        | sym::fabsf64
+        | sym::fabsf128
         | sym::fadd_algebraic
         | sym::fdiv_algebraic
         | sym::floorf16