about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering
diff options
context:
space:
mode:
authorLuca Versari <veluca@google.com>2025-08-18 15:09:45 +0200
committerLuca Versari <veluca@google.com>2025-08-22 01:26:26 +0200
commit291da71b2ae2e5d313739a7d6a8ffa634f408db5 (patch)
tree61a65575461bc4d16394c51ba93dff879b32a39b /compiler/rustc_ast_lowering
parent6ba0ce40941eee1ca02e9ba49c791ada5158747a (diff)
downloadrust-291da71b2ae2e5d313739a7d6a8ffa634f408db5.tar.gz
rust-291da71b2ae2e5d313739a7d6a8ffa634f408db5.zip
Add an experimental unsafe(force_target_feature) attribute.
This uses the feature gate for
https://github.com/rust-lang/rust/issues/143352, but is described in
https://github.com/rust-lang/rfcs/pull/3820 which is strongly tied to
the experiment.
Diffstat (limited to 'compiler/rustc_ast_lowering')
-rw-r--r--compiler/rustc_ast_lowering/src/item.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs
index cd0f9f2403e..bb559bd8921 100644
--- a/compiler/rustc_ast_lowering/src/item.rs
+++ b/compiler/rustc_ast_lowering/src/item.rs
@@ -1596,7 +1596,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
         let safety = self.lower_safety(h.safety, default_safety);
 
         // Treat safe `#[target_feature]` functions as unsafe, but also remember that we did so.
-        let safety = if find_attr!(attrs, AttributeKind::TargetFeature { .. })
+        let safety = if find_attr!(attrs, AttributeKind::TargetFeature { was_forced: false, .. })
             && safety.is_safe()
             && !self.tcx.sess.target.is_like_wasm
         {