rust/compiler/rustc_span
Trevor Gross 743d2527a2
Rollup merge of #140367 - folkertdev:asm-cfg, r=nnethercote
add `asm_cfg`: `#[cfg(...)]` within `asm!`

tracking issue: https://github.com/rust-lang/rust/issues/140364
blocked on: https://github.com/rust-lang/rust/pull/140490

This feature was discussed in https://github.com/rust-lang/rust/issues/140279. It allows configuring templates and operands in the assembly macros, for example:

```rust
asm!( // or global_asm! or naked_asm!
    "nop",
    #[cfg(target_feature = "sse2")]
    "nop",
    // ...
    #[cfg(target_feature = "sse2")]
    a = const 123, // only used on sse2
);
```

r? `@tgross35`

cc `@traviscross` `@Amanieu`

Now builds on https://github.com/rust-lang/rust/pull/140490, which should be merged first.
2025-05-27 20:28:30 -04:00
..
src Rollup merge of #140367 - folkertdev:asm-cfg, r=nnethercote 2025-05-27 20:28:30 -04:00
Cargo.toml Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00