Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 6ba9696

Browse files
committed
Add documentation for asm!
1 parent 2aa9aaa commit 6ba9696

File tree

7 files changed

+695
-18
lines changed

7 files changed

+695
-18
lines changed

src/doc/unstable-book/src/library-features/asm.md

Lines changed: 678 additions & 0 deletions
Large diffs are not rendered by default.

src/libcore/macros/mod.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,30 +1293,29 @@ pub(crate) mod builtin {
12931293
/// [unstable book]: ../unstable-book/library-features/asm.html
12941294
#[unstable(
12951295
feature = "asm",
1296-
issue = "70173",
1296+
issue = "72016",
12971297
reason = "inline assembly is not stable enough for use and is subject to change"
12981298
)]
12991299
#[rustc_builtin_macro]
13001300
#[macro_export]
13011301
macro_rules! asm {
1302-
("assembly template"
1303-
: $("output"(operand),)*
1304-
: $("input"(operand),)*
1305-
: $("clobbers",)*
1306-
: $("options",)*) => {
1302+
("assembly template",
1303+
$(operands,)*
1304+
$(options($(option),*))?
1305+
) => {
13071306
/* compiler built-in */
13081307
};
13091308
}
13101309

1311-
/// Inline assembly.
1310+
/// LLVM-style inline assembly.
13121311
///
13131312
/// Read the [unstable book] for the usage.
13141313
///
13151314
/// [unstable book]: ../unstable-book/library-features/llvm-asm.html
13161315
#[unstable(
13171316
feature = "llvm_asm",
13181317
issue = "70173",
1319-
reason = "inline assembly is not stable enough for use and is subject to change"
1318+
reason = "LLVM-style inline assembly will never be stabilized, prefer using asm! instead"
13201319
)]
13211320
#[rustc_builtin_macro]
13221321
#[macro_export]

src/librustc_error_codes/error_codes/E0660.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ llvm_asm!("nop" "nop");
77
```
88

99
Considering that this would be a long explanation, we instead recommend you
10-
take a look at the [`asm`] chapter of the Unstable book:
10+
take a look at the [`llvm_asm`] chapter of the Unstable book:
1111

12-
[asm]: https://doc.rust-lang.org/stable/unstable-book/library-features/asm.html
12+
[llvm_asm]: https://doc.rust-lang.org/stable/unstable-book/library-features/llvm-asm.html

src/librustc_error_codes/error_codes/E0661.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ llvm_asm!("nop" : "r"(a));
88
```
99

1010
Considering that this would be a long explanation, we instead recommend you
11-
take a look at the [`asm`] chapter of the Unstable book:
11+
take a look at the [`llvm_asm`] chapter of the Unstable book:
1212

13-
[asm]: https://doc.rust-lang.org/stable/unstable-book/library-features/asm.html
13+
[llvm_asm]: https://doc.rust-lang.org/stable/unstable-book/library-features/llvm-asm.html

src/librustc_error_codes/error_codes/E0662.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ llvm_asm!("xor %eax, %eax"
1111
```
1212

1313
Considering that this would be a long explanation, we instead recommend you
14-
take a look at the [`asm`] chapter of the Unstable book:
14+
take a look at the [`llvm_asm`] chapter of the Unstable book:
1515

16-
[asm]: https://doc.rust-lang.org/stable/unstable-book/library-features/asm.html
16+
[llvm_asm]: https://doc.rust-lang.org/stable/unstable-book/library-features/llvm-asm.html

src/librustc_error_codes/error_codes/E0663.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ llvm_asm!("xor %eax, %eax"
1111
```
1212

1313
Considering that this would be a long explanation, we instead recommend you
14-
take a look at the [`asm`] chapter of the Unstable book:
14+
take a look at the [`llvm_asm`] chapter of the Unstable book:
1515

16-
[asm]: https://doc.rust-lang.org/stable/unstable-book/library-features/asm.html
16+
[llvm_asm]: https://doc.rust-lang.org/stable/unstable-book/library-features/llvm-asm.html

src/librustc_error_codes/error_codes/E0664.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ llvm_asm!("mov $$0x200, %eax"
1111
```
1212

1313
Considering that this would be a long explanation, we instead recommend you
14-
take a look at the [`asm`] chapter of the Unstable book:
14+
take a look at the [`llvm_asm`] chapter of the Unstable book:
1515

16-
[asm]: https://doc.rust-lang.org/stable/unstable-book/library-features/asm.html
16+
[llvm_asm]: https://doc.rust-lang.org/stable/unstable-book/library-features/llvm-asm.html

0 commit comments

Comments
 (0)