33#[ allow( unused_imports) ]
44#[ stable( feature = "simd_arch" , since = "1.27.0" ) ]
55pub use crate :: core_arch:: arch:: * ;
6- #[ unstable( feature = "naked_functions" , issue = "90957" ) ]
7- #[ cfg( bootstrap) ]
8- pub use crate :: naked_asm;
96
107/// Inline assembly.
118///
@@ -20,37 +17,6 @@ pub macro asm("assembly template", $(operands,)* $(options($(option),*))?) {
2017 /* compiler built-in */
2118}
2219
23- /// Inline assembly used in combination with `#[naked]` functions.
24- ///
25- /// Refer to [Rust By Example] for a usage guide and the [reference] for
26- /// detailed information about the syntax and available options.
27- ///
28- /// [Rust By Example]: https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html
29- /// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html
30- #[ unstable( feature = "naked_functions" , issue = "90957" ) ]
31- #[ macro_export]
32- #[ cfg( bootstrap) ]
33- macro_rules! naked_asm {
34- ( [ $last: expr] , [ $( $pushed: expr) ,* ] ) => {
35- #[ cfg( any( target_arch = "x86_64" , target_arch = "x86" ) ) ]
36- {
37- core:: arch:: asm!( $( $pushed) ,* , options( att_syntax, noreturn) )
38- }
39- #[ cfg( not( any( target_arch = "x86_64" , target_arch = "x86" ) ) ) ]
40- {
41- core:: arch:: asm!( $( $pushed) ,* , $last, options( noreturn) )
42- }
43- } ;
44-
45- ( [ $first: expr $( , $rest: expr) * ] , [ $( $pushed: expr) ,* ] ) => {
46- naked_asm!( [ $( $rest) ,* ] , [ $( $pushed, ) * $first] ) ;
47- } ;
48-
49- ( $( $expr: expr) ,* $( , ) ?) => {
50- naked_asm!( [ $( $expr) ,* ] , [ ] ) ;
51- } ;
52- }
53-
5420/// Inline assembly used in combination with `#[naked]` functions.
5521///
5622/// Refer to [Rust By Example] for a usage guide and the [reference] for
@@ -60,7 +26,6 @@ macro_rules! naked_asm {
6026/// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html
6127#[ unstable( feature = "naked_functions" , issue = "90957" ) ]
6228#[ rustc_builtin_macro]
63- #[ cfg( not( bootstrap) ) ]
6429pub macro naked_asm ( "assembly template" , $( operands, ) * $( options ( $( option) , * ) ) ?) {
6530 /* compiler built-in */
6631}
0 commit comments