You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only the [`cfg`] and [`cfg_attr`] attributes are accepted semantically on inline assembly template strings and operands. Other attributes are parsed but rejected when the assembly macro is expanded.
278
+
279
+
```rust
280
+
# fnmain() {}
281
+
# #[cfg(target_arch ="x86_64")]
282
+
core::arch::global_asm!(
283
+
#[cfg(not(panic ="abort"))]
284
+
".cfi_startproc",
285
+
// ...
286
+
"ret",
287
+
#[cfg(not(panic ="abort"))]
288
+
".cfi_endproc",
289
+
);
290
+
```
291
+
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
+
295
+
r[asm.attributes.starts-with-template]
296
+
Syntactically there must be at least one template string before the first operand.
297
+
298
+
```rust,compile_fail
299
+
// This is rejected because `a = out(reg) x` does not parse as a
0 commit comments