diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2025-09-04 10:01:55 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-04 10:01:55 +1000 |
| commit | f90cc353b808d9a1a1e6cc9748dc10e7a20ee211 (patch) | |
| tree | 50cd1dd0d1ecc456b3b973999e322f608c39d9a1 /compiler/rustc_feature | |
| parent | 3a6ae1167f56516fc0de1d304fcb9163cea0cb40 (diff) | |
| parent | bcfc9b5073a92bbb4b1e4db2eab535357d8973ad (diff) | |
| download | rust-f90cc353b808d9a1a1e6cc9748dc10e7a20ee211.tar.gz rust-f90cc353b808d9a1a1e6cc9748dc10e7a20ee211.zip | |
Rollup merge of #145932 - JamieCunliffe:target-feature-inlining, r=jackh726
Allow `inline(always)` with a target feature behind a unstable feature `target_feature_inline_always`. Rather than adding the inline always attribute to the function definition, we add it to the callsite. We can then check that the target features match and that the call would be safe to inline. If the function isn't inlined due to a mismatch, we emit a warning informing the user that the function can't be inlined due to the target feature mismatch. See tracking issue rust-lang/rust#145574
Diffstat (limited to 'compiler/rustc_feature')
| -rw-r--r-- | compiler/rustc_feature/src/unstable.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 573e9aab055..4f35bf63a1a 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -642,6 +642,8 @@ declare_features! ( (unstable, super_let, "1.88.0", Some(139076)), /// Allows subtrait items to shadow supertrait items. (unstable, supertrait_item_shadowing, "1.86.0", Some(89151)), + /// Allows the use of target_feature when a function is marked inline(always). + (unstable, target_feature_inline_always, "CURRENT_RUSTC_VERSION", Some(145574)), /// Allows using `#[thread_local]` on `static` items. (unstable, thread_local, "1.0.0", Some(29594)), /// Allows defining `trait X = A + B;` alias items. |
