Skip to content

Commit ac44a37

Browse files
committed
Add admonition about asm attribute implementation
The implementation of attributes for asm macro template strings and operands doesn't use the normal system in `rustc` for handling attributes. This leads to the limitations and may lead to subtle divergences in behavior. Let's make a note about this. For background, see: - rust-lang#2063 (comment) - rust-lang/rust#147736 (comment)
1 parent 447b76c commit ac44a37

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/inline-assembly.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ core::arch::global_asm!(
289289
);
290290
```
291291

292+
> [!NOTE]
293+
> In `rustc`, the assembly macros implement handling of these attributes separately from the normal system that handles similar attributes in the language. This accounts for the limited kinds of attributes supported and may give rise to subtle differences in behavior.
294+
292295
r[asm.attributes.starts-with-template]
293296
Syntactically there must be at least one template string before the first operand.
294297

0 commit comments

Comments
 (0)