Skip to content

Commit 02cff1f

Browse files
committed
stabilize naked_functions
1 parent be73c1f commit 02cff1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+149
-273
lines changed

compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
#![feature(
2-
no_core,
3-
lang_items,
4-
never_type,
5-
linkage,
6-
extern_types,
7-
naked_functions,
8-
thread_local,
9-
repr_simd
10-
)]
1+
#![feature(no_core, lang_items, never_type, linkage, extern_types, thread_local, repr_simd)]
112
#![no_core]
123
#![allow(dead_code, non_camel_case_types, internal_features)]
134

compiler/rustc_error_codes/src/error_codes/E0787.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ An unsupported naked function definition.
33
Erroneous code example:
44

55
```compile_fail,E0787
6-
#![feature(naked_functions)]
7-
86
#[naked]
97
pub extern "C" fn f() -> u32 {
108
42

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ declare_features! (
298298
/// Allows patterns with concurrent by-move and by-ref bindings.
299299
/// For example, you can write `Foo(a, ref b)` where `a` is by-move and `b` is by-ref.
300300
(accepted, move_ref_pattern, "1.49.0", Some(68354)),
301+
/// Allows using `#[naked]` on functions.
302+
(accepted, naked_functions, "CURRENT_RUSTC_VERSION", Some(90957)),
301303
/// Allows specifying modifiers in the link attribute: `#[link(modifiers = "...")]`
302304
(accepted, native_link_modifiers, "1.61.0", Some(81490)),
303305
/// Allows specifying the bundle link modifier

compiler/rustc_feature/src/builtin_attrs.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
428428
ungated!(unsafe no_mangle, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No),
429429
ungated!(used, Normal, template!(Word, List: "compiler|linker"), WarnFollowing, EncodeCrossCrate::No),
430430
ungated!(link_ordinal, Normal, template!(List: "ordinal"), ErrorPreceding, EncodeCrossCrate::Yes),
431+
ungated!(naked, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No),
431432

432433
// Limits:
433434
ungated!(
@@ -500,12 +501,6 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
500501
// Unstable attributes:
501502
// ==========================================================================
502503

503-
// Linking:
504-
gated!(
505-
naked, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No,
506-
naked_functions, experimental!(naked)
507-
),
508-
509504
// Testing:
510505
gated!(
511506
test_runner, CrateLevel, template!(List: "path"), ErrorFollowing,

compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,6 @@ declare_features! (
564564
(unstable, must_not_suspend, "1.57.0", Some(83310)),
565565
/// Allows `mut ref` and `mut ref mut` identifier patterns.
566566
(incomplete, mut_ref, "1.79.0", Some(123076)),
567-
/// Allows using `#[naked]` on functions.
568-
(unstable, naked_functions, "1.9.0", Some(90957)),
569567
/// Allows using `#[target_feature(enable = "...")]` on `#[naked]` on functions.
570568
(unstable, naked_functions_target_feature, "1.86.0", Some(138568)),
571569
/// Allows specifying the as-needed link modifier

compiler/rustc_lint_defs/src/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2836,7 +2836,7 @@ declare_lint! {
28362836
/// ### Example
28372837
///
28382838
/// ```rust
2839-
/// #![feature(asm_experimental_arch, naked_functions)]
2839+
/// #![feature(asm_experimental_arch)]
28402840
///
28412841
/// use std::arch::naked_asm;
28422842
///

library/core/src/arch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub macro asm("assembly template", $(operands,)* $(options($(option),*))?) {
3232
///
3333
/// [Rust By Example]: https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html
3434
/// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html
35-
#[unstable(feature = "naked_functions", issue = "90957")]
35+
#[stable(feature = "naked_functions", since = "CURRENT_RUSTC_VERSION")]
3636
#[rustc_builtin_macro]
3737
pub macro naked_asm("assembly template", $(operands,)* $(options($(option),*))?) {
3838
/* compiler built-in */

tests/assembly/naked-functions/aarch64-naked-fn-no-bti-prolog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//@ only-aarch64
55

66
#![crate_type = "lib"]
7-
#![feature(naked_functions)]
7+
88
use std::arch::naked_asm;
99

1010
// The problem at hand: Rust has adopted a fairly strict meaning for "naked functions",

tests/assembly/naked-functions/x86_64-naked-fn-no-cet-prolog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//@ only-x86_64
55

66
#![crate_type = "lib"]
7-
#![feature(naked_functions)]
7+
88
use std::arch::naked_asm;
99

1010
// The problem at hand: Rust has adopted a fairly strict meaning for "naked functions",

tests/codegen/cffi/c-variadic-naked.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
#![crate_type = "lib"]
77
#![feature(c_variadic)]
8-
#![feature(naked_functions)]
98
#![no_std]
109

1110
#[naked]

0 commit comments

Comments
 (0)