Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 3 pull requests #128268

Closed
wants to merge 9 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

folkertdev and others added 9 commits July 25, 2024 22:33
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
`missing_fragment_specifier` has been a future compatibility warning
since 2017. Uplifting it to an unconditional hard error was attempted in
2020, but eventually reverted due to fallout.

Make it an error only in edition >= 2024, leaving the lint for older
editions. This change will make it easier to support more macro syntax
that relies on usage of `$`.

Fixes <rust-lang#40107>
…r-e2024, r=petrochenkov

Make `missing_fragment_specifier` an error in edition 2024

`missing_fragment_specifier` has been a future compatibility warning since 2017. Uplifting it to an unconditional hard error was attempted in 2020, but eventually reverted due to fallout.

Make it an error only in edition >= 2024, leaving the lint for older editions. This change will make it easier to support more macro syntax that relies on usage of `$`.

Fixes <rust-lang#40107>

---

It is rather late for the edition but since this change is relatively small, it seems worth at least bringing up. This follows a brief [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/268952-edition/topic/.60.20DBD.20-.3E.20hard.20error) (cc `@tmandry).`

Making this an edition-dependent lint has come up before but there was not a strong motivation. I am proposing it at this time because this would simplify the [named macro capture groups](rust-lang/rfcs#3649) RFC, which has had mildly positive response, and makes use of new `$` syntax in the matcher. The proposed syntax currently parses as metavariables without a fragment specifier; this warning is raised, but there are no errors.

It is obviously not known that this specific RFC will eventually be accepted, but forbidding `missing_fragment_specifier` should make it easier to support any new syntax in the future that makes use of `$` in different ways. The syntax conflict is also not impossible to overcome, but making it clear that unnamed metavariables are rejected makes things more straightforward and should allow for better diagnostics.

`@Mark-Simulacrum` suggested making this forbid-by-default instead of an error at rust-lang#40107 (comment), but I don't think this would allow the same level of syntax flexibility.

It is also possible to reconsider making this an unconditional error since four years have elapsed since the previous attempt, but this seems likely to hit the same pitfalls. (Possibly worth a crater run?)

Tracking:

- rust-lang#128143
…r=Amanieu

improve error message when `global_asm!` uses `asm!` options

specifically, what was

    error: expected one of `)`, `att_syntax`, or `raw`, found `preserves_flags`
      --> $DIR/bad-options.rs:45:25
       |
    LL | global_asm!("", options(preserves_flags));
       |                         ^^^^^^^^^^^^^^^ expected one of `)`, `att_syntax`, or `raw`

is now

    error: the `preserves_flags` option cannot be used with `global_asm!`
      --> $DIR/bad-options.rs:45:25
       |
    LL | global_asm!("", options(preserves_flags));
       |                         ^^^^^^^^^^^^^^^ the `preserves_flags` option is not meaningful for global-scoped inline assembly

mirroring the phrasing of the [reference](https://doc.rust-lang.org/reference/inline-assembly.html#options).

This is also a bit of a refactor for a future `naked_asm!` macro (for use in `#[naked]` functions). Currently this sort of error can come up when switching from inline to global asm, or when a user just isn't that experienced with assembly. With  `naked_asm!` added to the mix hitting this error is more likely.
…tolnay

update `rust.channel` default value documentation

self-explanatory

Resolves rust-lang#128258

r? dtolnay
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jul 27, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Jul 27, 2024

📌 Commit 3f0fb36 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 27, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 27, 2024
…iaskrgr

Rollup of 3 pull requests

Successful merges:

 - rust-lang#128006 (Make `missing_fragment_specifier` an error in edition 2024)
 - rust-lang#128207 (improve error message when `global_asm!` uses `asm!` options)
 - rust-lang#128266 (update `rust.channel` default value documentation)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Jul 27, 2024

⌛ Testing commit 3f0fb36 with merge a84c790...

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-apple failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

36    |                    |
37    |                    generic outputs
38 
- error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
+ error: the `nomem` option cannot be used with `global_asm!`
41    |
41    |
42 LL | global_asm!("", options(nomem));

-    |                         ^^^^^ expected one of `)`, `att_syntax`, or `raw`
+    |                         ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly
44 
- error: expected one of `)`, `att_syntax`, or `raw`, found `readonly`
+ error: the `readonly` option cannot be used with `global_asm!`
47    |
47    |
48 LL | global_asm!("", options(readonly));

-    |                         ^^^^^^^^ expected one of `)`, `att_syntax`, or `raw`
+    |                         ^^^^^^^^ the `readonly` option is not meaningful for global-scoped inline assembly
50 
- error: expected one of `)`, `att_syntax`, or `raw`, found `noreturn`
+ error: the `noreturn` option cannot be used with `global_asm!`
53    |
53    |
54 LL | global_asm!("", options(noreturn));

-    |                         ^^^^^^^^ expected one of `)`, `att_syntax`, or `raw`
+    |                         ^^^^^^^^ the `noreturn` option is not meaningful for global-scoped inline assembly
56 
- error: expected one of `)`, `att_syntax`, or `raw`, found `pure`
+ error: the `pure` option cannot be used with `global_asm!`
59    |
59    |
60 LL | global_asm!("", options(pure));

-    |                         ^^^^ expected one of `)`, `att_syntax`, or `raw`
+    |                         ^^^^ the `pure` option is not meaningful for global-scoped inline assembly
62 
- error: expected one of `)`, `att_syntax`, or `raw`, found `nostack`
+ error: the `nostack` option cannot be used with `global_asm!`
65    |
65    |
66 LL | global_asm!("", options(nostack));

-    |                         ^^^^^^^ expected one of `)`, `att_syntax`, or `raw`
+    |                         ^^^^^^^ the `nostack` option is not meaningful for global-scoped inline assembly
68 
- error: expected one of `)`, `att_syntax`, or `raw`, found `preserves_flags`
+ error: the `preserves_flags` option cannot be used with `global_asm!`
71    |
71    |
72 LL | global_asm!("", options(preserves_flags));

-    |                         ^^^^^^^^^^^^^^^ expected one of `)`, `att_syntax`, or `raw`
+    |                         ^^^^^^^^^^^^^^^ the `preserves_flags` option is not meaningful for global-scoped inline assembly
75 error: invalid ABI for `clobber_abi`
76   --> $DIR/bad-options.rs:20:18



The actual stderr differed from the expected stderr.
Actual stderr saved to /Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/asm/aarch64/bad-options/bad-options.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args asm/aarch64/bad-options.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "/Users/runner/work/rust/rust/tests/ui/asm/aarch64/bad-options.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/work/rust/rust/vendor" "--sysroot" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2" "--target=aarch64-apple-darwin" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/asm/aarch64/bad-options" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/Users/runner/work/rust/rust/build/aarch64-apple-darwin/native/rust-test-helpers" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/asm/aarch64/bad-options/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error: the `nomem` and `readonly` options are mutually exclusive
   |
   |
LL |         asm!("", options(nomem, readonly));


error: the `pure` and `noreturn` options are mutually exclusive
   |
   |
LL |         asm!("", options(pure, nomem, noreturn));


error: asm with the `pure` option must have at least one output
   |
   |
LL |         asm!("", options(pure, nomem, noreturn));


error: asm with the `pure` option must have at least one output
   |
   |
LL |         asm!("{}", in(reg) foo, options(pure, nomem));


error: asm outputs are not allowed with the `noreturn` option
   |
   |
LL |         asm!("{}", out(reg) foo, options(noreturn));


error: asm with `clobber_abi` must specify explicit registers for outputs
   |
   |
LL |         asm!("{}", out(reg) foo, clobber_abi("C"));
   |                    |
   |                    generic outputs


error: the `nomem` option cannot be used with `global_asm!`
   |
   |
LL | global_asm!("", options(nomem));
   |                         ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly
error: the `readonly` option cannot be used with `global_asm!`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/bad-options.rs:30:25
   |
   |
LL | global_asm!("", options(readonly));
   |                         ^^^^^^^^ the `readonly` option is not meaningful for global-scoped inline assembly

error: the `noreturn` option cannot be used with `global_asm!`
   |
   |
LL | global_asm!("", options(noreturn));
   |                         ^^^^^^^^ the `noreturn` option is not meaningful for global-scoped inline assembly

error: the `pure` option cannot be used with `global_asm!`
   |
   |
LL | global_asm!("", options(pure));
   |                         ^^^^ the `pure` option is not meaningful for global-scoped inline assembly

error: the `nostack` option cannot be used with `global_asm!`
   |
   |
LL | global_asm!("", options(nostack));
   |                         ^^^^^^^ the `nostack` option is not meaningful for global-scoped inline assembly

error: the `preserves_flags` option cannot be used with `global_asm!`
   |
   |
LL | global_asm!("", options(preserves_flags));
   |                         ^^^^^^^^^^^^^^^ the `preserves_flags` option is not meaningful for global-scoped inline assembly
error: invalid ABI for `clobber_abi`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/bad-options.rs:20:18
   |
   |
LL |         asm!("", clobber_abi("foo"));
   |
   |
   = note: the following ABIs are supported on this target: `C`, `system`, `efiapi`
error: aborting due to 13 previous errors
------------------------------------------



---- [ui] tests/ui/asm/aarch64/parse-error.rs stdout ----
diff of stderr:

218 LL | global_asm!("", options(FOO));
219    |                         ^^^ expected one of `)`, `att_syntax`, or `raw`
220 
- error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
+ error: the `nomem` option cannot be used with `global_asm!`
223    |
223    |
224 LL | global_asm!("", options(nomem FOO));

-    |                         ^^^^^ expected one of `)`, `att_syntax`, or `raw`
+    |                         ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly
226 
- error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
+ error: expected one of `)` or `,`, found `FOO`
+    |
+    |
+ LL | global_asm!("", options(nomem FOO));
+    |                               ^^^ expected one of `)` or `,`
+ 
+ error: the `nomem` option cannot be used with `global_asm!`
229    |
229    |
230 LL | global_asm!("", options(nomem, FOO));

-    |                         ^^^^^ expected one of `)`, `att_syntax`, or `raw`
+    |                         ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly
232 
+ error: expected one of `)`, `att_syntax`, or `raw`, found `FOO`
+    |
+    |
+ LL | global_asm!("", options(nomem, FOO));
+    |                                ^^^ expected one of `)`, `att_syntax`, or `raw`
233 error: expected string literal
234   --> $DIR/parse-error.rs:104:29
235    |


398 LL |     const bar: /* Type */ = 0;
400 
- error: aborting due to 57 previous errors
+ error: aborting due to 59 previous errors
402 
---
To only update this specific test, also pass `--test-args asm/aarch64/parse-error.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "/Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/work/rust/rust/vendor" "--sysroot" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2" "--target=aarch64-apple-darwin" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/asm/aarch64/parse-error" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/Users/runner/work/rust/rust/build/aarch64-apple-darwin/native/rust-test-helpers" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/asm/aarch64/parse-error/auxiliary"
--- stderr -------------------------------
error: requires at least a template string argument
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:11:9
   |
---

error: expected `)`, found `foo`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:21:27
   |
LL |         asm!("{}", in(reg foo));
   |                           ^^^ expected `)`
error: expected expression, found end of macro arguments
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:23:27
   |
   |
LL |         asm!("{}", in(reg));

error: expected register class or explicit register
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:25:26
   |
   |
LL |         asm!("{}", inout(=) foo => bar);

error: expected expression, found end of macro arguments
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:27:37
   |
   |
LL |         asm!("{}", inout(reg) foo =>);


error: expected one of `!`, `,`, `.`, `::`, `?`, `{`, or an operator, found `=>`
   |
   |
LL |         asm!("{}", in(reg) foo => bar);

error: expected a path for argument to `sym`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:31:24
   |
   |
LL |         asm!("{}", sym foo + bar);


error: expected one of `)`, `att_syntax`, `may_unwind`, `nomem`, `noreturn`, `nostack`, `preserves_flags`, `pure`, `raw`, or `readonly`, found `foo`
   |
   |
LL |         asm!("", options(foo));


error: expected one of `)` or `,`, found `foo`
   |
   |
LL |         asm!("", options(nomem foo));
   |                                ^^^ expected one of `)` or `,`

error: expected one of `)`, `att_syntax`, `may_unwind`, `nomem`, `noreturn`, `nostack`, `preserves_flags`, `pure`, `raw`, or `readonly`, found `foo`
   |
   |
LL |         asm!("", options(nomem, foo));

error: expected string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:41:30
   |
   |
LL |         asm!("", clobber_abi(foo));


error: expected one of `)` or `,`, found `foo`
   |
   |
LL |         asm!("", clobber_abi("C" foo));
   |                                  ^^^ expected one of `)` or `,`
error: expected string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:45:35
   |
   |
LL |         asm!("", clobber_abi("C", foo));

error: duplicate argument named `a`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:52:36
   |
   |
LL |         asm!("{a}", a = const foo, a = const bar);
   |                     -------------  ^^^^^^^^^^^^^ duplicate argument
   |                     previously here

error: argument never used
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:52:36
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:52:36
   |
LL |         asm!("{a}", a = const foo, a = const bar);
   |                                    ^^^^^^^^^^^^^ argument never used
   |
   = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {1} */"`
error: explicit register arguments cannot have names
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:57:18
   |
   |
LL |         asm!("", a = in("x0") foo);

error: positional arguments cannot follow named arguments or explicit register arguments
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:63:35
   |
   |
LL |         asm!("{1}", in("x0") foo, const bar);
   |                     ------------  ^^^^^^^^^ positional argument
   |                     explicit register argument


error: expected one of `clobber_abi`, `const`, `in`, `inlateout`, `inout`, `label`, `lateout`, `options`, `out`, or `sym`, found `""`
   |
   |
LL |         asm!("", options(), "");


error: expected one of `clobber_abi`, `const`, `in`, `inlateout`, `inout`, `label`, `lateout`, `options`, `out`, or `sym`, found `"{}"`
   |
   |
LL |         asm!("{}", in(reg) foo, "{}", out(reg) foo);

error: asm template must be a string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:70:14
   |
   |
LL |         asm!(format!("{{{}}}", 0), in(reg) foo);
   |
   = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)

error: asm template must be a string literal
error: asm template must be a string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:72:21
   |
LL |         asm!("{1}", format!("{{{}}}", 0), in(reg) foo, out(reg) bar);
   |
   = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)


error: _ cannot be used for input operands
   |
   |
LL |         asm!("{}", in(reg) _);


error: _ cannot be used for input operands
   |
   |
LL |         asm!("{}", inout(reg) _);


error: _ cannot be used for input operands
   |
   |
LL |         asm!("{}", inlateout(reg) _);

error: requires at least a template string argument
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:85:1
   |
   |
LL | global_asm!();

error: asm template must be a string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:87:13
   |
   |
LL | global_asm!(FOO);

error: expected token: `,`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:89:18
   |
   |
LL | global_asm!("{}" FOO);
   |                  ^^^ expected `,`
error: expected operand, options, or additional template string
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:91:19
   |
LL | global_asm!("{}", FOO);
---
   |
LL | global_asm!("{}", const);
   |                        ^ expected expression

error: expected one of `,`, `.`, `?`, or an operator, found `FOO`
   |
   |
LL | global_asm!("{}", const(reg) FOO);
   |                              ^^^ expected one of `,`, `.`, `?`, or an operator

error: expected one of `)`, `att_syntax`, or `raw`, found `FOO`
   |
   |
LL | global_asm!("", options(FOO));
   |                         ^^^ expected one of `)`, `att_syntax`, or `raw`

error: the `nomem` option cannot be used with `global_asm!`
   |
   |
LL | global_asm!("", options(nomem FOO));
   |                         ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly

error: expected one of `)` or `,`, found `FOO`
   |
   |
LL | global_asm!("", options(nomem FOO));
   |                               ^^^ expected one of `)` or `,`

error: the `nomem` option cannot be used with `global_asm!`
   |
   |
LL | global_asm!("", options(nomem, FOO));
   |                         ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly

error: expected one of `)`, `att_syntax`, or `raw`, found `FOO`
   |
   |
LL | global_asm!("", options(nomem, FOO));
   |                                ^^^ expected one of `)`, `att_syntax`, or `raw`
error: expected string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:104:29
   |
   |
LL | global_asm!("", clobber_abi(FOO));


error: expected one of `)` or `,`, found `FOO`
   |
   |
LL | global_asm!("", clobber_abi("C" FOO));
   |                                 ^^^ expected one of `)` or `,`
error: expected string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:108:34
   |
   |
LL | global_asm!("", clobber_abi("C", FOO));


error: `clobber_abi` cannot be used with `global_asm!`
   |
   |
LL | global_asm!("{}", clobber_abi("C"), const FOO);


error: `clobber_abi` cannot be used with `global_asm!`
   |
   |
LL | global_asm!("", options(), clobber_abi("C"));


error: `clobber_abi` cannot be used with `global_asm!`
   |
   |
LL | global_asm!("{}", options(), clobber_abi("C"), const FOO);

error: duplicate argument named `a`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:116:35
   |
   |
LL | global_asm!("{a}", a = const FOO, a = const BAR);
   |                    -------------  ^^^^^^^^^^^^^ duplicate argument
   |                    previously here

error: argument never used
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:116:35
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:116:35
   |
LL | global_asm!("{a}", a = const FOO, a = const BAR);
   |                                   ^^^^^^^^^^^^^ argument never used
   |
   = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {1} */"`

error: expected one of `clobber_abi`, `const`, `options`, or `sym`, found `""`
   |
   |
LL | global_asm!("", options(), "");
   |                            ^^ expected one of `clobber_abi`, `const`, `options`, or `sym`

error: expected one of `clobber_abi`, `const`, `options`, or `sym`, found `"{}"`
   |
   |
LL | global_asm!("{}", const FOO, "{}", const FOO);
   |                              ^^^^ expected one of `clobber_abi`, `const`, `options`, or `sym`
error: asm template must be a string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:123:13
   |
   |
LL | global_asm!(format!("{{{}}}", 0), const FOO);
   |
   = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)

error: asm template must be a string literal
error: asm template must be a string literal
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:125:20
   |
LL | global_asm!("{1}", format!("{{{}}}", 0), const FOO, const BAR);
   |
   = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0435]: attempt to use a non-constant value in a constant
error[E0435]: attempt to use a non-constant value in a constant
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:39:37
   |
LL |         asm!("{}", options(), const foo);
   |                                     ^^^ non-constant value
   |
help: consider using `const` instead of `let`
   |
LL |     const foo: /* Type */ = 0;

error[E0435]: attempt to use a non-constant value in a constant
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:47:44
   |
   |
LL |         asm!("{}", clobber_abi("C"), const foo);
   |                                            ^^^ non-constant value
help: consider using `const` instead of `let`
   |
   |
LL |     const foo: /* Type */ = 0;

error[E0435]: attempt to use a non-constant value in a constant
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:50:55
   |
   |
LL |         asm!("{}", options(), clobber_abi("C"), const foo);
   |                                                       ^^^ non-constant value
help: consider using `const` instead of `let`
   |
   |
LL |     const foo: /* Type */ = 0;

error[E0435]: attempt to use a non-constant value in a constant
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:52:31
   |
   |
LL |         asm!("{a}", a = const foo, a = const bar);
   |                               ^^^ non-constant value
help: consider using `const` instead of `let`
   |
   |
LL |     const foo: /* Type */ = 0;

error[E0435]: attempt to use a non-constant value in a constant
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:52:46
   |
   |
LL |         asm!("{a}", a = const foo, a = const bar);
   |                                              ^^^ non-constant value
help: consider using `const` instead of `let`
   |
   |
LL |     const bar: /* Type */ = 0;

error[E0435]: attempt to use a non-constant value in a constant
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:59:45
   |
   |
LL |         asm!("{a}", in("x0") foo, a = const bar);
   |                                             ^^^ non-constant value
help: consider using `const` instead of `let`
   |
   |
LL |     const bar: /* Type */ = 0;

error[E0435]: attempt to use a non-constant value in a constant
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:61:45
   |
   |
LL |         asm!("{a}", in("x0") foo, a = const bar);
   |                                             ^^^ non-constant value
help: consider using `const` instead of `let`
   |
   |
LL |     const bar: /* Type */ = 0;

error[E0435]: attempt to use a non-constant value in a constant
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/aarch64/parse-error.rs:63:41
   |
   |
LL |         asm!("{1}", in("x0") foo, const bar);
   |                                         ^^^ non-constant value
help: consider using `const` instead of `let`
   |
   |
LL |     const bar: /* Type */ = 0;

error: aborting due to 59 previous errors

For more information about this error, try `rustc --explain E0435`.
For more information about this error, try `rustc --explain E0435`.
------------------------------------------


---- [ui] tests/ui/asm/unsupported-option.rs stdout ----
diff of stderr:

16 LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
17    |                                                      ^^^^^^^^ the `noreturn` option is not meaningful for global-scoped inline assembly
- error: aborting due to 3 previous errors
+ error: the `att_syntax` option is only supported on x86
+   --> $DIR/unsupported-option.rs:7:1
+    |
+    |
+ LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
+ 
+ error: aborting due to 4 previous errors
20 
21 
---
To only update this specific test, also pass `--test-args asm/unsupported-option.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "/Users/runner/work/rust/rust/tests/ui/asm/unsupported-option.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/work/rust/rust/vendor" "--sysroot" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2" "--target=aarch64-apple-darwin" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/asm/unsupported-option" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/Users/runner/work/rust/rust/build/aarch64-apple-darwin/native/rust-test-helpers" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/asm/unsupported-option/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error: the `nomem` option cannot be used with `global_asm!`
   |
   |
LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
   |                                     ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly
error: the `readonly` option cannot be used with `global_asm!`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/unsupported-option.rs:7:44
   |
   |
LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
   |                                            ^^^^^^^^ the `readonly` option is not meaningful for global-scoped inline assembly

error: the `noreturn` option cannot be used with `global_asm!`
   |
   |
LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
   |                                                      ^^^^^^^^ the `noreturn` option is not meaningful for global-scoped inline assembly
error: the `att_syntax` option is only supported on x86
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/unsupported-option.rs:7:1
   |
   |
LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));

error: aborting due to 4 previous errors
------------------------------------------

@bors
Copy link
Contributor

bors commented Jul 27, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 27, 2024
@matthiaskrgr matthiaskrgr deleted the rollup-tck33df branch September 1, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants