Skip to content

Commit 2661a16

Browse files
authored
Unrolled build for #140367
Rollup merge of #140367 - folkertdev:asm-cfg, r=nnethercote add `asm_cfg`: `#[cfg(...)]` within `asm!` tracking issue: #140364 blocked on: #140490 This feature was discussed in #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 #140490, which should be merged first.
2 parents be42293 + c7c0194 commit 2661a16

File tree

17 files changed

+869
-432
lines changed

17 files changed

+869
-432
lines changed

compiler/rustc_builtin_macros/messages.ftl

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
builtin_macros_alloc_error_must_be_fn = alloc_error_handler must be a function
22
builtin_macros_alloc_must_statics = allocators must be statics
33
4+
builtin_macros_asm_attribute_not_supported =
5+
this attribute is not supported on assembly
6+
builtin_macros_asm_cfg =
7+
the `#[cfg(/* ... */)]` and `#[cfg_attr(/* ... */)]` attributes on assembly are unstable
8+
49
builtin_macros_asm_clobber_abi = clobber_abi
510
builtin_macros_asm_clobber_no_reg = asm with `clobber_abi` must specify explicit registers for outputs
611
builtin_macros_asm_clobber_outputs = generic outputs
@@ -9,17 +14,6 @@ builtin_macros_asm_duplicate_arg = duplicate argument named `{$name}`
914
.label = previously here
1015
.arg = duplicate argument
1116
12-
builtin_macros_asm_expected_comma = expected token: `,`
13-
.label = expected `,`
14-
15-
builtin_macros_asm_expected_other = expected operand, {$is_inline_asm ->
16-
[false] options
17-
*[true] clobber_abi, options
18-
}, or additional template string
19-
20-
builtin_macros_asm_expected_string_literal = expected string literal
21-
.label = not a string literal
22-
2317
builtin_macros_asm_explicit_register_name = explicit register arguments cannot have names
2418
2519
builtin_macros_asm_mayunwind = asm labels are not allowed with the `may_unwind` option
@@ -45,17 +39,8 @@ builtin_macros_asm_pure_combine = the `pure` option must be combined with either
4539
4640
builtin_macros_asm_pure_no_output = asm with the `pure` option must have at least one output
4741
48-
builtin_macros_asm_requires_template = requires at least a template string argument
49-
50-
builtin_macros_asm_sym_no_path = expected a path for argument to `sym`
51-
52-
builtin_macros_asm_underscore_input = _ cannot be used for input operands
53-
5442
builtin_macros_asm_unsupported_clobber_abi = `clobber_abi` cannot be used with `{$macro_name}!`
5543
56-
builtin_macros_asm_unsupported_operand = the `{$symbol}` operand cannot be used with `{$macro_name}!`
57-
.label = the `{$symbol}` operand is not meaningful for global-scoped inline assembly, remove it
58-
5944
builtin_macros_asm_unsupported_option = the `{$symbol}` option cannot be used with `{$macro_name}!`
6045
.label = the `{$symbol}` option is not meaningful for global-scoped inline assembly
6146
.suggestion = remove this option
@@ -162,7 +147,10 @@ builtin_macros_expected_comma_in_list = expected token: `,`
162147
163148
builtin_macros_expected_one_cfg_pattern = expected 1 cfg-pattern
164149
165-
builtin_macros_expected_register_class_or_explicit_register = expected register class or explicit register
150+
builtin_macros_expected_other = expected operand, {$is_inline_asm ->
151+
[false] options
152+
*[true] clobber_abi, options
153+
}, or additional template string
166154
167155
builtin_macros_export_macro_rules = cannot export macro_rules! macros from a `proc-macro` crate type currently
168156
@@ -255,8 +243,6 @@ builtin_macros_no_default_variant = `#[derive(Default)]` on enum with no `#[defa
255243
.label = this enum needs a unit variant marked with `#[default]`
256244
.suggestion = make this unit variant default by placing `#[default]` on it
257245
258-
builtin_macros_non_abi = at least one abi must be provided as an argument to `clobber_abi`
259-
260246
builtin_macros_non_exhaustive_default = default variant must be exhaustive
261247
.label = declared `#[non_exhaustive]` here
262248
.help = consider a manual implementation of `Default`

0 commit comments

Comments
 (0)