Skip to content

Conversation

@notJoon
Copy link
Contributor

@notJoon notJoon commented Aug 13, 2025

Description

Fixes #134061

When parsing invalid code like const x: () = |&'a, the compiler failed to generate suggestions due to incorrect span handling in the parser's bump function. The issue occurred when:

  1. A token with a dummy span (like <eof>) was encountered
  2. The dummy span was assigned the entire span of the previous token
  3. This caused empty or overlapping spans that prevented the diagnostic system from generating suggestions
  4. Additionally, this could trigger debug assertions

Changes

Change the span assignment from:

let fallback_span = self.token.span;

to:

let fallback_span = self.token.span.shrink_to_hi();

This change is also proposed in the original issue. This also ensures that dummy span receive the end position of the previous token rather than its entire span, allowing the diagnostic system to generate proper suggestions.

Results

Before the fix:

error: unexpected lifetime `'a` in pattern
 --> test_case.rs:1:17
  |
1 | const x: () = |&'a
  |                 ^^

error: expected parameter name, found `<eof>`
 --> test_case.rs:1:19
  |
1 | const x: () = |&'a
  |                   ^ expected parameter name

After the fix:

error: unexpected lifetime `'a` in pattern
 --> test_debug_assert.rs:2:17
  |
2 | const x: () = |&'a
  |                 ^^
  |
help: remove the lifetime
  |
2 - const x: () = |&'a
2 + const x: () = |&
  |

error: expected parameter name, found `<eof>`
 --> test_debug_assert.rs:2:19
  |
2 | const x: () = |&'a
  |                   ^ expected parameter name

Debug Assertions

The fix also resolves debug assertion failures. The assertion in:

debug_assert!(
!(sp.is_empty() && suggestion.to_string().is_empty()),
"Span must not be empty and have no suggestion"
);

This assertion previously could fail when spans were incorrectly handled. With our fix, Produces proper diagnostics without assertion failures.

@rustbot
Copy link
Collaborator

rustbot commented Aug 13, 2025

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 13, 2025
@rust-log-analyzer

This comment has been minimized.

Comment on lines +9 to +10
LL - const x: () = |&'a| ();
LL + const x: () = |&| ();
Copy link
Member

@Kivooeo Kivooeo Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel like that's a good idea to show incorrect suggestion like this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about whether there might be other good alternatives, but I keep reaching that this code suggestion is definitely unnecessary. I also confirmed that the updated stderr files show poor error indication quality. So, I'll closing this PR. Thanks for the review 👍

Comment on lines +9 to +10
LL - const x: () = |&'a
LL + const x: () = |&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not make sense at all for me, but I may missing something?

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
92   --> $DIR/parse-error.rs:44:30

205    = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
206 
207 error: _ cannot be used for input operands
-   --> $DIR/parse-error.rs:88:28
+   --> $DIR/parse-error.rs:88:29
209    |
210 LL |         asm!("{}", in(reg) _);
-    |                            ^
+    |                             ^
212 
213 error: _ cannot be used for input operands
-   --> $DIR/parse-error.rs:90:31
+   --> $DIR/parse-error.rs:90:32
215    |
216 LL |         asm!("{}", inout(reg) _);
-    |                               ^
+    |                                ^
218 
219 error: _ cannot be used for input operands
-   --> $DIR/parse-error.rs:92:35
+   --> $DIR/parse-error.rs:92:36
221    |
222 LL |         asm!("{}", inlateout(reg) _);
-    |                                   ^
+    |                                    ^
224 
225 error: requires at least a template string argument
226   --> $DIR/parse-error.rs:99:1
---
To only update this specific test, also pass `--test-args asm/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" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/asm/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=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,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" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/parse-error" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: requires at least a template string argument
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:9:9
   |
---

error: expected `)`, found `foo`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:19:27
   |
LL |         asm!("{}", in(reg foo));
   |                           ^^^ expected `)`

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

error: expected register class or explicit register
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:23:26
   |
LL |         asm!("{}", inout(=) foo => bar);
   |                          ^

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

error: expected one of `!`, `,`, `.`, `::`, `?`, `{`, or an operator, found `=>`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:27:32
   |
LL |         asm!("{}", in(reg) foo => bar);
   |                                ^^ expected one of 7 possible tokens

error: expected a path for argument to `sym`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:29: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`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:31:26
   |
LL |         asm!("", options(foo));
   |                          ^^^ expected one of 10 possible tokens

error: expected one of `)` or `,`, found `foo`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:33:32
   |
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`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:35:33
   |
LL |         asm!("", options(nomem, foo));
   |                                 ^^^ expected one of 10 possible tokens

error: at least one abi must be provided as an argument to `clobber_abi`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:42:31
   |
LL |         asm!("", clobber_abi());
   |                               ^

error: expected string literal
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:44:30
   |
LL |         asm!("", clobber_abi(foo));
   |                              ^^^ not a string literal

error: expected one of `)` or `,`, found `foo`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:46:34
   |
LL |         asm!("", clobber_abi("C" foo));
   |                                  ^^^ expected one of `)` or `,`

error: expected string literal
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:48:35
   |
LL |         asm!("", clobber_abi("C", foo));
   |                                   ^^^ not a string literal

error: expected string literal
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:50:30
   |
LL |         asm!("", clobber_abi(1));
   |                              ^ not a string literal

error: expected string literal
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:52:30
   |
LL |         asm!("", clobber_abi(()));
   |                              ^ not a string literal

error: expected string literal
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:54:30
   |
LL |         asm!("", clobber_abi(uwu));
   |                              ^^^ not a string literal

error: expected string literal
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:56:30
   |
LL |         asm!("", clobber_abi({}));
   |                              ^ not a string literal

error: expected string literal
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:58:30
   |
LL |         asm!("", clobber_abi(loop {}));
   |                              ^^^^ not a string literal

error: expected string literal
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:60:30
   |
LL |         asm!("", clobber_abi(if));
   |                              ^^ not a string literal

error: expected string literal
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:62:30
   |
LL |         asm!("", clobber_abi(do));
   |                              ^^ not a string literal

error: expected string literal
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:64:30
   |
LL |         asm!("", clobber_abi(<));
   |                              ^ not a string literal

error: expected string literal
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:66:30
   |
LL |         asm!("", clobber_abi(.));
   |                              ^ not a string literal

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

error: argument never used
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:74: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: expected one of `#`, `clobber_abi`, `const`, `in`, `inlateout`, `inout`, `label`, `lateout`, `options`, `out`, or `sym`, found `""`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:80:29
   |
LL |         asm!("", options(), "");
   |                             ^^ expected one of 11 possible tokens

error: expected one of `#`, `clobber_abi`, `const`, `in`, `inlateout`, `inout`, `label`, `lateout`, `options`, `out`, or `sym`, found `"{}"`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:82:33
   |
LL |         asm!("{}", in(reg) foo, "{}", out(reg) foo);
   |                                 ^^^^ expected one of 11 possible tokens

error: asm template must be a string literal
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:84: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]  --> /checkout/tests/ui/asm/parse-error.rs:86: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
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:88:29
   |
LL |         asm!("{}", in(reg) _);
   |                             ^

error: _ cannot be used for input operands
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:90:32
   |
LL |         asm!("{}", inout(reg) _);
   |                                ^

error: _ cannot be used for input operands
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:92:36
   |
LL |         asm!("{}", inlateout(reg) _);
   |                                    ^

error: requires at least a template string argument
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:99:1
   |
LL | global_asm!();
   | ^^^^^^^^^^^^^

error: asm template must be a string literal
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:101:13
   |
LL | global_asm!(FOO);
   |             ^^^

error: expected token: `,`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:103:18
   |
LL | global_asm!("{}" FOO);
   |                  ^^^ expected `,`

error: expected operand, options, or additional template string
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:105:19
   |
LL | global_asm!("{}", FOO);
---
   |
LL | global_asm!("{}", const);
   |                        ^ expected expression

error: expected one of `,`, `.`, `?`, or an operator, found `FOO`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:109:30
   |
LL | global_asm!("{}", const(reg) FOO);
   |                              ^^^ expected one of `,`, `.`, `?`, or an operator

error: expected one of `)`, `att_syntax`, or `raw`, found `FOO`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:111:25
   |
LL | global_asm!("", options(FOO));
   |                         ^^^ expected one of `)`, `att_syntax`, or `raw`

error: expected one of `)`, `att_syntax`, or `raw`, found `FOO`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:113:25
   |
LL | global_asm!("", options(FOO,));
   |                         ^^^ expected one of `)`, `att_syntax`, or `raw`

error: expected one of `)` or `,`, found `FOO`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:115:31
   |
LL | global_asm!("", options(nomem FOO));
   |                               ^^^ expected one of `)` or `,`

error: expected one of `)`, `att_syntax`, or `raw`, found `FOO`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:117:32
   |
LL | global_asm!("", options(nomem, FOO));
   |                                ^^^ expected one of `)`, `att_syntax`, or `raw`

error: expected string literal
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:120:29
   |
LL | global_asm!("", clobber_abi(FOO));
   |                             ^^^ not a string literal

error: expected one of `)` or `,`, found `FOO`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:122:33
   |
LL | global_asm!("", clobber_abi("C" FOO));
   |                                 ^^^ expected one of `)` or `,`

error: expected string literal
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:124:34
   |
LL | global_asm!("", clobber_abi("C", FOO));
   |                                  ^^^ not a string literal

error: `clobber_abi` cannot be used with `global_asm!`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:126:19
   |
LL | global_asm!("{}", clobber_abi("C"), const FOO);
   |                   ^^^^^^^^^^^^^^^^

error: `clobber_abi` cannot be used with `global_asm!`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:128:28
   |
LL | global_asm!("", options(), clobber_abi("C"));
   |                            ^^^^^^^^^^^^^^^^

error: `clobber_abi` cannot be used with `global_asm!`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:130:30
   |
LL | global_asm!("{}", options(), clobber_abi("C"), const FOO);
   |                              ^^^^^^^^^^^^^^^^

error: `clobber_abi` cannot be used with `global_asm!`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:132:17
   |
LL | global_asm!("", clobber_abi("C"), clobber_abi("C"));
   |                 ^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^

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

error: argument never used
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:134: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 `""`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:137:28
   |
LL | global_asm!("", options(), "");
   |                            ^^ expected one of `#`, `clobber_abi`, `const`, `options`, or `sym`

error: expected one of `#`, `clobber_abi`, `const`, `options`, or `sym`, found `"{}"`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:139:30
   |
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]  --> /checkout/tests/ui/asm/parse-error.rs:141: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]  --> /checkout/tests/ui/asm/parse-error.rs:143: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: the `in` operand cannot be used with `global_asm!`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:146:19
   |
LL | global_asm!("{}", in(reg));
   |                   ^^ the `in` operand is not meaningful for global-scoped inline assembly, remove it

error: the `out` operand cannot be used with `global_asm!`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:148:19
   |
LL | global_asm!("{}", out(reg));
   |                   ^^^ the `out` operand is not meaningful for global-scoped inline assembly, remove it

error: the `lateout` operand cannot be used with `global_asm!`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:150:19
   |
LL | global_asm!("{}", lateout(reg));
   |                   ^^^^^^^ the `lateout` operand is not meaningful for global-scoped inline assembly, remove it

error: the `inout` operand cannot be used with `global_asm!`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:152:19
   |
LL | global_asm!("{}", inout(reg));
   |                   ^^^^^ the `inout` operand is not meaningful for global-scoped inline assembly, remove it

error: the `inlateout` operand cannot be used with `global_asm!`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:154:19
   |
LL | global_asm!("{}", inlateout(reg));
   |                   ^^^^^^^^^ the `inlateout` operand is not meaningful for global-scoped inline assembly, remove it

error: the `label` operand cannot be used with `global_asm!`
##[error]  --> /checkout/tests/ui/asm/parse-error.rs:156:19
   |
LL | global_asm!("{}", label(reg));
   |                   ^^^^^ the `label` operand is not meaningful for global-scoped inline assembly, remove it

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

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

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

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

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

error: aborting due to 70 previous errors

For more information about this error, try `rustc --explain E0435`.
---
7 error: expected a statement
-   --> $DIR/issue-103529.rs:5:10
+   --> $DIR/issue-103529.rs:5:11
9    |
10 LL |     ($s:stmt) => {}
11    |      ------- while parsing argument for this `stmt` macro fragment

12 ...
13 LL | m! { mut x }
-    |          ^
+    |           ^
15 
16 error: invalid variable declaration
17   --> $DIR/issue-103529.rs:8:6
---
To only update this specific test, also pass `--test-args macros/issue-103529.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/issue-103529.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=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,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" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/macros/issue-103529" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: expected expression, found keyword `mut`
##[error]  --> /checkout/tests/ui/macros/issue-103529.rs:5:6
   |
LL | m! { mut x }
   |      ^^^ expected expression

error: expected a statement
##[error]  --> /checkout/tests/ui/macros/issue-103529.rs:5:11
   |
LL |     ($s:stmt) => {}
   |      ------- while parsing argument for this `stmt` macro fragment
...
LL | m! { mut x }
   |           ^

error: invalid variable declaration
##[error]  --> /checkout/tests/ui/macros/issue-103529.rs:8:6
   |
LL | m! { auto x }
   |      ^^^^
   |
help: write `let` instead of `auto` to introduce a new variable
   |
LL - m! { auto x }
LL + m! { let x }
   |

error: invalid variable declaration
##[error]  --> /checkout/tests/ui/macros/issue-103529.rs:10:6
   |
LL | m! { var x }
   |      ^^^
   |
help: write `let` instead of `var` to introduce a new variable
   |
LL - m! { var x }
LL + m! { let x }
   |

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


---- [ui] tests/ui/macros/syntax-error-recovery.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/macros/syntax-error-recovery/syntax-error-recovery.stderr`
diff of stderr:

22    = note: the usage of `values!` is likely invalid in item context
23 
24 error: expected one of `!` or `::`, found `<eof>`
-   --> $DIR/syntax-error-recovery.rs:7:17
+   --> $DIR/syntax-error-recovery.rs:7:23
26    |
27 LL |                 $token $($inner)? = $value,
-    |                 ^^^^^^ expected one of `!` or `::`
+    |                       ^ expected one of `!` or `::`
29 
30 error: aborting due to 3 previous errors
31 

Note: some mismatched output was normalized before being compared
---
To only update this specific test, also pass `--test-args macros/syntax-error-recovery.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/syntax-error-recovery.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=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,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" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/macros/syntax-error-recovery" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: expected one of `(`, `,`, `=`, `{`, or `}`, found `ty` metavariable
##[error]  --> /checkout/tests/ui/macros/syntax-error-recovery.rs:7:26
   |
LL |                 $token $($inner)? = $value,
   |                          ^^^^^^ expected one of `(`, `,`, `=`, `{`, or `}`
...
LL | values!(STRING(1) as (String) => cfg(test),);
   | -------------------------------------------- in this macro invocation
   |
   = help: enum variants can be `Variant`, `Variant = <integer>`, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }`
   = note: this error originates in the macro `values` (in Nightly builds, run with -Z macro-backtrace for more info)

error: macro expansion ignores `ty` metavariable and any tokens following
##[error]  --> /checkout/tests/ui/macros/syntax-error-recovery.rs:7:26
   |
LL |                 $token $($inner)? = $value,
   |                          ^^^^^^
...
LL | values!(STRING(1) as (String) => cfg(test),);
   | -------------------------------------------- caused by the macro expansion here
   |
   = note: the usage of `values!` is likely invalid in item context

error: expected one of `!` or `::`, found `<eof>`
##[error]  --> /checkout/tests/ui/macros/syntax-error-recovery.rs:7:23
   |
LL |                 $token $($inner)? = $value,
   |                       ^ expected one of `!` or `::`

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


---- [ui] tests/ui/parser/bad-recover-kw-after-impl.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/parser/bad-recover-kw-after-impl/bad-recover-kw-after-impl.stderr`
diff of stderr:

1 error: expected identifier, found `<eof>`
-   --> $DIR/bad-recover-kw-after-impl.rs:13:22
+   --> $DIR/bad-recover-kw-after-impl.rs:13:27
3    |
4 LL |     ($ty:ty) => {
5    |      ------ while parsing argument for this `ty` macro fragment
---
To only update this specific test, also pass `--test-args parser/bad-recover-kw-after-impl.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/parser/bad-recover-kw-after-impl.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=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,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" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/parser/bad-recover-kw-after-impl" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2021"
stdout: none
--- stderr -------------------------------
error: expected identifier, found `<eof>`
##[error]  --> /checkout/tests/ui/parser/bad-recover-kw-after-impl.rs:13:27
   |
LL |     ($ty:ty) => {
   |      ------ while parsing argument for this `ty` macro fragment
...
---
LL | impl_primitive!(impl async);
   |                      ^^^^^
   |
   = note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information
   = help: add `#![feature(async_trait_bounds)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
   = help: use the desugared name of the async trait, such as `AsyncFn`

error: aborting due to 2 previous errors

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


---- [ui] tests/ui/parser/column-offset-1-based.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/parser/column-offset-1-based/column-offset-1-based.stderr`
diff of stderr:

1 error: expected one of `!` or `[`, found `<eof>`
-   --> $DIR/column-offset-1-based.rs:1:1
+   --> $DIR/column-offset-1-based.rs:1:2
3    |
4 LL | #
-    | ^ expected one of `!` or `[`
---
To only update this specific test, also pass `--test-args parser/column-offset-1-based.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/parser/column-offset-1-based.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=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,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" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/parser/column-offset-1-based" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: expected one of `!` or `[`, found `<eof>`
##[error]  --> /checkout/tests/ui/parser/column-offset-1-based.rs:1:2
   |
LL | # //~ ERROR expected one of `!` or `[`, found `<eof>`
   |  ^ expected one of `!` or `[`

error: aborting due to 1 previous error
------------------------------------------


---- [ui] tests/ui/parser/issues/issue-21146.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/parser/issues/issue-21146/issue-21146.stderr`
diff of stderr:

1 error: expected one of `!` or `::`, found `<eof>`
-   --> $DIR/auxiliary/issue-21146-inc.rs:3:1
+   --> $DIR/auxiliary/issue-21146-inc.rs:3:12
3    |
4 LL | parse_error
-    | ^^^^^^^^^^^ expected one of `!` or `::`
+    |            ^ expected one of `!` or `::`
6 
---
To only update this specific test, also pass `--test-args parser/issues/issue-21146.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/parser/issues/issue-21146.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=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,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" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/parser/issues/issue-21146" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: expected one of `!` or `::`, found `<eof>`
##[error]  --> /checkout/tests/ui/parser/issues/auxiliary/issue-21146-inc.rs:3:12
   |
LL | parse_error
   |            ^ expected one of `!` or `::`

error: aborting due to 1 previous error
---
diff of stderr:

11    |
12 
13 error: expected one of `->`, `where`, or `{`, found `<eof>`
-   --> $DIR/issue-84148-1.rs:1:15
+   --> $DIR/issue-84148-1.rs:1:16
15    |
16 LL | fn f(t:for<>t?)
-    |               ^ expected one of `->`, `where`, or `{`
+    |                ^ expected one of `->`, `where`, or `{`
18 
19 error: aborting due to 2 previous errors
20 

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/parser/issues/issue-84148-1.rs:1:16
+   --> $DIR/issue-84148-1.rs:1:16
+    |                ^ expected one of `->`, `where`, or `{`


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args parser/issues/issue-84148-1.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/parser/issues/issue-84148-1.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=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,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" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/parser/issues/issue-84148-1" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: invalid `?` in type
##[error]  --> /checkout/tests/ui/parser/issues/issue-84148-1.rs:1:14
   |
LL | fn f(t:for<>t?)
   |              ^ `?` is only allowed on expressions, not types
   |
help: if you meant to express that the type might not contain a value, use the `Option` wrapper type
   |
LL - fn f(t:for<>t?)
LL + fn f(t:Option<for<>t>)
   |

error: expected one of `->`, `where`, or `{`, found `<eof>`
##[error]  --> /checkout/tests/ui/parser/issues/issue-84148-1.rs:1:16
   |
LL | fn f(t:for<>t?)
   |                ^ expected one of `->`, `where`, or `{`

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


---- [ui] tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-1.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/parser/recover/recover-where-clause-before-tuple-struct-body-1/recover-where-clause-before-tuple-struct-body-1.stderr`
diff of stderr:

14    |
15 
16 error: expected `;`, found `<eof>`
-   --> $DIR/recover-where-clause-before-tuple-struct-body-1.rs:5:35
+   --> $DIR/recover-where-clause-before-tuple-struct-body-1.rs:5:36
18    |
19 LL | struct Foo<T> where T: MyTrait, (T)
-    |                                   ^ expected `;`
+    |                                    ^ expected `;`
21 
22 error: aborting due to 2 previous errors
23 

Note: some mismatched output was normalized before being compared
---
To only update this specific test, also pass `--test-args parser/recover/recover-where-clause-before-tuple-struct-body-1.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-1.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=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,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" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/parser/recover/recover-where-clause-before-tuple-struct-body-1" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: where clauses are not allowed before tuple struct bodies
##[error]  --> /checkout/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-1.rs:5:15
   |
LL | struct Foo<T> where T: MyTrait, (T)
   |        ---    ^^^^^^^^^^^^^^^^^ --- the struct body
   |        |      |
   |        |      unexpected where clause
   |        while parsing this tuple struct
   |
help: move the body before the where clause
   |
LL - struct Foo<T> where T: MyTrait, (T)
LL + struct Foo<T>(T) where T: MyTrait
   |

error: expected `;`, found `<eof>`
##[error]  --> /checkout/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-1.rs:5:36
   |
LL | struct Foo<T> where T: MyTrait, (T)
   |                                    ^ expected `;`

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


---- [ui] tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/rust-2018/removing-extern-crate-malformed-cfg/removing-extern-crate-malformed-cfg.stderr`
diff of stderr:

8    = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>
9 
10 error: expected one of `(`, `,`, `::`, or `=`, found `<eof>`
-   --> $DIR/removing-extern-crate-malformed-cfg.rs:12:16
+   --> $DIR/removing-extern-crate-malformed-cfg.rs:12:20
12    |
13 LL |     #[cfg_attr(test)]
-    |                ^^^^ expected one of `(`, `,`, `::`, or `=`
+    |                    ^ expected one of `(`, `,`, `::`, or `=`
15    |
16    = help: the valid syntax is `#[cfg_attr(condition, attribute, other_attribute, ...)]`
17    = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs:12:20
+   --> $DIR/removing-extern-crate-malformed-cfg.rs:12:20
+    |                    ^ expected one of `(`, `,`, `::`, or `=`


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args rust-2018/removing-extern-crate-malformed-cfg.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.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=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,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" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/rust-2018/removing-extern-crate-malformed-cfg" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/rust-2018/removing-extern-crate-malformed-cfg/auxiliary" "--edition=2018"
stdout: none
--- stderr -------------------------------
error: expected identifier, found `"macro_use"`
##[error]  --> /checkout/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs:7:18
   |
LL | #[cfg_attr(test, "macro_use")] //~ ERROR expected
   |                  ^^^^^^^^^^^ expected identifier
   |
   = help: the valid syntax is `#[cfg_attr(condition, attribute, other_attribute, ...)]`
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>

error: expected one of `(`, `,`, `::`, or `=`, found `<eof>`
##[error]  --> /checkout/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs:12:20
   |
LL |     #[cfg_attr(test)] //~ ERROR expected
   |                    ^ expected one of `(`, `,`, `::`, or `=`
   |
   = help: the valid syntax is `#[cfg_attr(condition, attribute, other_attribute, ...)]`
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>

warning: unused extern crate
---
   |         ^^^^^^^^^^^^^^^^
   = note: `#[warn(unused_extern_crates)]` implied by `#[warn(rust_2018_idioms)]`
help: remove the unused `extern crate`
   |
LL - #[cfg_attr(test, "macro_use")] //~ ERROR expected
LL - extern crate remove_extern_crate as foo; //~ WARNING unused extern crate
LL +  //~ WARNING unused extern crate
   |

warning: unused extern crate
##[warning]  --> /checkout/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs:9:1
   |
LL | extern crate core; //~ WARNING unused extern crate
   | ^^^^^^^^^^^^^^^^^^ unused
   |
help: remove the unused `extern crate`
   |
LL - extern crate core; //~ WARNING unused extern crate
LL +  //~ WARNING unused extern crate
   |

warning: unused extern crate
##[warning]  --> /checkout/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs:13:5
   |
LL |     extern crate remove_extern_crate as foo; //~ WARNING unused extern crate
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused
   |
help: remove the unused `extern crate`
   |
LL -     #[cfg_attr(test)] //~ ERROR expected
LL -     extern crate remove_extern_crate as foo; //~ WARNING unused extern crate
LL +      //~ WARNING unused extern crate
   |

warning: unused extern crate
##[warning]  --> /checkout/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs:14:5
   |
LL |     extern crate core; //~ WARNING unused extern crate
   |     ^^^^^^^^^^^^^^^^^^ unused
   |
help: remove the unused `extern crate`
   |
LL -     extern crate core; //~ WARNING unused extern crate
LL +      //~ WARNING unused extern crate
   |

error: aborting due to 2 previous errors; 4 warnings emitted
------------------------------------------

@Kivooeo
Copy link
Member

Kivooeo commented Aug 13, 2025

You might want to run ./x test --bless to update all files at once?

@notJoon notJoon closed this Aug 14, 2025
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Some code suggestions failed to be shown due to span tweaking

5 participants