Skip to content

Commit ad3ac84

Browse files
authored
Rollup merge of rust-lang#140490 - folkertdev:asm-parser-changes, r=Amanieu,traviscross
split `asm!` parsing and validation This PR splits `asm!` parsing and validation into two separate steps. The parser constructs a `Vec<RawAsmArg>`, with each element corresponding to an argument to one of the `asm!` macros. The validation then checks things like ordering of arguments or that options are not provided twice. The motivation is rust-lang#140279, which wants to add `#[cfg(...)]` support to these arguments. This support can now be added in a straightforward way by adding an `attributes: ast::AttrVec` field to `RawAsmArg`. An extra reason for this split is that `rustfmt` probably wants to format the assembly at some point (currently that appears to be stubbed out, and the formatting is unstable rust-lang/style-team#152). r? `@ghost` (just want to look at CI for now) cc `@ytmimi` we discussed asm formatting a little while ago in rust-lang/rustfmt#6526. Am I correct in assuming that `AsmArgs` does not give enough information for formatting, but that `RawAsmArgs` would (it e.g. does not join information from multiple lines). This must have been an issue before? try-job: aarch64-apple
2 parents 47047c7 + 26e3a50 commit ad3ac84

File tree

7 files changed

+335
-287
lines changed

7 files changed

+335
-287
lines changed

0 commit comments

Comments
 (0)