Commit bc50aff
authored
Rollup merge of rust-lang#105798 - Amanieu:relax-asm, r=joshtriplett
Relax ordering rules for `asm!` operands
The `asm!` and `global_asm!` macros require their operands to appear strictly in the following order:
- Template strings
- Positional operands
- Named operands
- Explicit register operands
- `clobber_abi`
- `options`
This is overly strict and can be inconvienent when building complex `asm!` statements with macros. This PR relaxes the ordering requirements as follows:
- Template strings must still come before all other operands.
- Positional operands must still come before named and explicit register operands.
- Named and explicit register operands can be freely mixed.
- `options` and `clobber_abi` can appear in any position after the template strings.
r? ```@joshtriplett```File tree
9 files changed
+152
-291
lines changed- compiler/rustc_builtin_macros/src
- tests/ui/asm
- aarch64
- x86_64
9 files changed
+152
-291
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | 206 | | |
218 | 207 | | |
219 | 208 | | |
| |||
227 | 216 | | |
228 | 217 | | |
229 | 218 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | 219 | | |
242 | 220 | | |
243 | 221 | | |
| |||
478 | 456 | | |
479 | 457 | | |
480 | 458 | | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | 459 | | |
491 | 460 | | |
492 | 461 | | |
| |||
699 | 668 | | |
700 | 669 | | |
701 | 670 | | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
702 | 675 | | |
703 | 676 | | |
704 | 677 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
49 | | - | |
50 | | - | |
| 48 | + | |
51 | 49 | | |
52 | | - | |
53 | 50 | | |
54 | | - | |
| 51 | + | |
55 | 52 | | |
56 | 53 | | |
57 | 54 | | |
| |||
60 | 57 | | |
61 | 58 | | |
62 | 59 | | |
63 | | - | |
64 | | - | |
| 60 | + | |
65 | 61 | | |
66 | | - | |
67 | | - | |
| 62 | + | |
68 | 63 | | |
69 | 64 | | |
70 | 65 | | |
| |||
106 | 101 | | |
107 | 102 | | |
108 | 103 | | |
109 | | - | |
110 | 104 | | |
111 | 105 | | |
112 | 106 | | |
113 | 107 | | |
114 | 108 | | |
115 | 109 | | |
116 | 110 | | |
117 | | - | |
118 | | - | |
| 111 | + | |
119 | 112 | | |
120 | | - | |
| 113 | + | |
121 | 114 | | |
122 | | - | |
| 115 | + | |
123 | 116 | | |
124 | 117 | | |
125 | 118 | | |
| |||
0 commit comments