Skip to content

Conversation

@Keith-Cancel
Copy link

@Keith-Cancel Keith-Cancel commented Nov 18, 2025

When Group::set_span() is called the span's for Group::span_open() and Group::span_close() methods just become the whole span instead where it should be the span of the delimiters. This PR ensures they have at least a more usable value after a call to Group::set_span().

Here is a kinda of motivating example of this issue I observed. If you compare the current behavior the outputs the diagnostics will not be on the opening and closing delimiters after calling set span. If you look at the outputs after using this PR they will match. Further, afterward Span::eq() then evaluates to true which nice to see.

#![feature(proc_macro_diagnostic)]
#![feature(proc_macro_span)]
extern crate proc_macro;

use proc_macro::TokenStream;
use proc_macro::TokenTree;

#[proc_macro_attribute]
pub fn foo(args: TokenStream, _: TokenStream) -> TokenStream {
    let mut i = args.into_iter();
    let mut grp = match i.next().expect("iterator empty") {
    TokenTree::Group(g) => g,
        _ => panic!("Expected Group")
    };

    let o_open = grp.span_open();
    let o_close = grp.span_close();
    o_open.note("Old Open Span").emit();
    o_close.note("Old Close Span").emit();

    // Set the span with the same span
    grp.set_span(grp.span());

    // Notice where the span these diagnostics are compared to the first.
    let n_open = grp.span_open();
    let n_close = grp.span_close();
    n_open.note("New Open Span").emit();
    n_close.note("New Close Span").emit();


    grp.span().note(&format!(
        "old_open == new_open: {}\nold_close == new_close: {}",
        o_open.eq(&n_open),
        o_close.eq(&n_close)
    )).emit();

    return TokenStream::new();
}

This is all I did to invoke the proc_macro example above.

#[macro_test::foo({ bar })]
struct Foo;

@rustbot
Copy link
Collaborator

rustbot commented Nov 18, 2025

r? @petrochenkov

rustbot has assigned @petrochenkov.
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 the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 18, 2025
@rust-log-analyzer

This comment has been minimized.

@Keith-Cancel Keith-Cancel marked this pull request as draft November 18, 2025 07:38
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 18, 2025
@Keith-Cancel Keith-Cancel marked this pull request as ready for review November 18, 2025 07:42
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 18, 2025
@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

DelimSpan::from_single in the compiler also currently doesn't try to update the opening and closing spans in a smart way, just sets the whole span.

I think it would be better to test the opening/closing span recovery strategy on the compiler first, and then do the same for proc macros.
There are multiple alternatives, and in some of them the choices here are obvious, but in some not and need to be checked experimentally (what diagnostic changes they cause).

  • The delimiter is invisible
    • It's not clear what is better to use, the whole span, or empty spans at the end and beginning, need to check experimentally
  • The delimiter is visible and the source map actually contains the matching symbols at the beginning and end of the span
    • The obvious choice - use spans of those symbols
  • The delimiter is visible, but the source map doesn't contain the matching symbols neither at the beginning nor at the end
    • It's not clear what is better to use, the whole span, or empty spans at the end and beginning, need to check
  • The delimiter is visible, but the source map only contains one matching symbols either at the beginning or at the end, the weird case
    • It's still not clear what is better to use for both the matching delimiter (its symbol's span, whole span, or empty span) and the non-matching delimiter (whole span or empty span), need to check

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 18, 2025
@Keith-Cancel
Copy link
Author

Keith-Cancel commented Nov 18, 2025

DelimSpan::from_single in the compiler also currently doesn't try to update the opening and closing spans in a smart way, just sets the whole span.

I think it would be better to test the opening/closing span recovery strategy on the compiler first, and then do the same for proc macros. There are multiple alternatives, and in some of them the choices here are obvious, but in some not and need to be checked experimentally (what diagnostic changes they cause).

* The delimiter is invisible
  
  * It's not clear what is better to use, the whole span, or empty spans at the end and beginning, need to check experimentally

* The delimiter is visible and the source map actually contains the matching symbols at the beginning and end of the span
  
  * The obvious choice - use spans of those symbols

* The delimiter is visible, but the source map doesn't contain the matching symbols neither at the beginning nor at the end
  
  * It's not clear what is better to use, the whole span, or empty spans at the end and beginning, need to check

* The delimiter is visible, but the source map only contains one matching symbols either at the beginning or at the end, the weird case
  
  * It's still not clear what is better to use for both the matching delimiter (its symbol's span, whole span, or empty span) and the non-matching delimiter (whole span or empty span), need to check

I can look at adding something to the compiler side of things first. I suppose we could inspect parts of the stream itself if that is desired. However, at least on the proc_macro side I did not do that. That's because someone could assign a span not directly associated to the underlying stream that the group contains. Therefore, inspecting the stream may not provide any useful information. Thusly, I chose what I did since it would more accurate in most cases than just using the whole span.

From a quick look the DelimSpan I see popup on the compiler side only stores the open and close spans so I would need to investigate a little more. I will say at least most cases that I have seen any Group tokens coming from the compiler have seem to have the correct open and close for anything it parsed/lexed.

As for the four options:

  • None/Invisible Group
    • Open and close clearly indicate we should be talking about the start and end of that group of tokens. The fact we have a Group means its has at least logically/structurally delimited. However there are no Glyphs or Symbols to point to directly. So the span in my opinion should be zero width here.
  • Visible and matches up
    • Like you said this one is obvious
  • Delimiter is set to a visible variant, but there are no delimiters in the token stream.
    • If we are wanting to inspect the token stream. In this case we have the logical/structural delimitation provided by the Group. However, there is no symbol/glyph that logically make sense to point out. So I guess like the first case a Zero width start and end. Just marking the where the group is considered opened and closed would be the most logical choice.
  • Only one Visible delimiter
    • One span would have width, the other would have zero width matching the reasoning I gave above. In the case we at least have one symbol/glyph we can point to. The other-side we should just mark where it starts/ends.

As for the diagnostic output is there anything you're particularly looking for or wanting to avoid when you mention experimentally testing?

@petrochenkov
Copy link
Contributor

I suppose we could inspect parts of the stream itself if that is desired.

... but there are no delimiters in the token stream

I was not suggesting to inspect token stream, "source map" is some source text to which all spans map, not tokens.

@petrochenkov
Copy link
Contributor

As for the diagnostic output is there anything you're particularly looking for or wanting to avoid when you mention experimentally testing?

Just want to look at the results with different options for a start.

@rustbot
Copy link
Collaborator

rustbot commented Nov 19, 2025

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rustbot

This comment has been minimized.

@rustbot rustbot added the has-merge-commits PR has merge commits, merge with caution. label Nov 19, 2025
When `Group::set_span()` is called the spans for `Group::span_open()` and `Group::span_close() ` methods just become the whole span instead of the spans the delimiters. This ensure this have at least a more useable value after a call to `Group::set_span()`.
@rustbot rustbot removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. has-merge-commits PR has merge commits, merge with caution. labels Nov 19, 2025
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Nov 19, 2025
@Keith-Cancel
Copy link
Author

Keith-Cancel commented Nov 19, 2025

As for the diagnostic output is there anything you're particularly looking for or wanting to avoid when you mention experimentally testing?

Just want to look at the results with different options for a start.

So I have here the from_single in with the default being an empty close and open. It causes UI tests to fail. Looking at some of the diffs I would says some are an improvement, but others I would call a regression. If you set the default_open and default_close to be the whole span as before the UI tests pass.

Honestly, in the compiler I would say that it might better to have not just some catch all from_single method, but maybe a couple different ones where the caller has more context, and make a better choice on which one to call when constructing a DelimSpan from a single span.

This still does nothing about my main concern though about fixing the proco_macro::Group in the proc_macro lib loosing the open and closing delimiter spans after a set_span which is my main concern with the initial pr.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui/attributes/nonterminal-expansion.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/attributes/nonterminal-expansion/nonterminal-expansion.stderr`
diff of stderr:

1 error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `expr` metavariable
-   --> $DIR/nonterminal-expansion.rs:7:22
+   --> $DIR/nonterminal-expansion.rs:7:24
3    |
4 LL |         #[repr(align($n))]
-    |                      ^^
+    |                        ^
6 ...
7 LL | pass_nonterminal!(n!());
8    | ----------------------- in this macro invocation

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/attributes/nonterminal-expansion.rs:7:24
+   --> $DIR/nonterminal-expansion.rs:7:24
---
To only update this specific test, also pass `--test-args attributes/nonterminal-expansion.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/attributes/nonterminal-expansion.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/attributes/nonterminal-expansion" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-Zdeduplicate-diagnostics=yes"
stdout: none
--- stderr -------------------------------
error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `expr` metavariable
##[error]  --> /checkout/tests/ui/attributes/nonterminal-expansion.rs:7:24
   |
LL |         #[repr(align($n))]
   |                        ^
...
LL | pass_nonterminal!(n!());
   | ----------------------- in this macro invocation
   |
   = note: this error originates in the macro `pass_nonterminal` (in Nightly builds, run with -Z macro-backtrace for more info)

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

2   --> $DIR/span-semicolon-issue-139049.rs:11:41
3    |
4 LL | macro_rules! perform { ($e:expr) => { D(&$e).end() } }
-    |                                       --^^^-
+    |                                       --^---
6    |                                       | |
7    |                                       | borrowed value does not live long enough
8    |                                       a temporary with access to the borrow is created here ...

24   --> $DIR/span-semicolon-issue-139049.rs:11:41
25    |
26 LL | macro_rules! perform { ($e:expr) => { D(&$e).end() } }
-    |                                       --^^^-
+    |                                       --^---
28    |                                       | |
29    |                                       | borrowed value does not live long enough
30    |                                       a temporary with access to the borrow is created here ...


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 borrowck/span-semicolon-issue-139049.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/borrowck/span-semicolon-issue-139049.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/borrowck/span-semicolon-issue-139049" "-A" "unused" "-W" "unused_attributes" "-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[E0597]: `l` does not live long enough
##[error]  --> /checkout/tests/ui/borrowck/span-semicolon-issue-139049.rs:11:41
   |
LL | macro_rules! perform { ($e:expr) => { D(&$e).end() } }
   |                                       --^---
   |                                       | |
   |                                       | borrowed value does not live long enough
   |                                       a temporary with access to the borrow is created here ...
...
LL |     { let l = (); perform!(l) };
   |           -       ----------- -- ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
   |           |       |           |
   |           |       |           `l` dropped here while still borrowed
   |           |       in this macro invocation
   |           binding `l` declared here
   |
   = note: this error originates in the macro `perform` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
   |
LL |     { let l = (); perform!(l); };
   |                              +

error[E0597]: `l` does not live long enough
##[error]  --> /checkout/tests/ui/borrowck/span-semicolon-issue-139049.rs:11:41
   |
LL | macro_rules! perform { ($e:expr) => { D(&$e).end() } }
   |                                       --^---
   |                                       | |
   |                                       | borrowed value does not live long enough
   |                                       a temporary with access to the borrow is created here ...
...
LL |     let _x = { let l = (); perform!(l) };
   |                    -       ----------- -- ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
   |                    |       |           |
   |                    |       |           `l` dropped here while still borrowed
   |                    |       in this macro invocation
   |                    binding `l` declared here
   |
   = note: the temporary is part of an expression at the end of a block;
           consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
   = note: this error originates in the macro `perform` (in Nightly builds, run with -Z macro-backtrace for more info)
help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
   |
LL |     let _x = { let l = (); let x = perform!(l); x };
   |                            +++++++            +++

error: aborting due to 2 previous errors

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

25    = note: this warning originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
26 help: add a dummy let to cause `a` to be fully captured
27    |
- LL ~     m!({
- LL +         let _ = &a;
-    |
+ LL |         m!(@ $body{ let _ = &a;  });
+    |                   +++++++++++++  +
31 
32 warning: 1 warning emitted
33 


The actual stderr differed from the expected stderr
Saved the actual fixed to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment/closure-body-macro-fragment.fixed`
diff of fixed:

18         f();
19     }};
20     ($body:block) => {{
-         m!(@ $body);
+         m!(@ $body }{ let _ = &a; );
22     }};
23 }
24 

25 fn main() {
---
To only update this specific test, also pass `--test-args closures/2229_closure_analysis/migrations/closure-body-macro-fragment.rs`

error: 2 errors occurred comparing output.
status: exit status: 0
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/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.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/closures/2229_closure_analysis/migrations/closure-body-macro-fragment" "-A" "unused" "-W" "unused_attributes" "-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=2018"
stdout: none
--- stderr -------------------------------
warning: changes to closure capture in Rust 2021 will affect drop order
##[warning]  --> /checkout/tests/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.rs:16:17
   |
LL |           let f = || $body;
   |                   ^^
...
LL |       }};
   |       - in Rust 2018, `a` is dropped here, but in Rust 2021, only `a.0` will be dropped here as part of the closure
...
LL | /     m!({
LL | |         //~^ HELP: add a dummy
LL | |         let x = a.0;
   | |                 --- in Rust 2018, this closure captures all of `a`, but in Rust 2021, it will only capture `a.0`
LL | |         println!("{:?}", x);
LL | |     });
   | |______- in this macro invocation
   |
   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html>
---
   = note: `#[warn(rust_2021_incompatible_closure_captures)]` implied by `#[warn(rust_2021_compatibility)]`
   = note: this warning originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
help: add a dummy let to cause `a` to be fully captured
   |
LL |         m!(@ $body{ let _ = &a;  });
   |                   +++++++++++++  +

warning: 1 warning emitted
------------------------------------------

---- [ui] tests/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.rs stdout end ----
---- [ui] tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/conditional-compilation/cfg-attr-syntax-validation/cfg-attr-syntax-validation.stderr`
diff of stderr:

92    = note: expected a normal string literal, not a byte string literal
93 
94 error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `expr` metavariable
-   --> $DIR/cfg-attr-syntax-validation.rs:51:25
+   --> $DIR/cfg-attr-syntax-validation.rs:51:30
96    |
97 LL |         #[cfg(feature = $expr)]
-    |                         ^^^^^
+    |                              ^
99 ...
100 LL | generate_s10!(concat!("nonexistent"));
101    | ------------------------------------- in this macro invocation

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs:51:30
+   --> $DIR/cfg-attr-syntax-validation.rs:51:30
---
To only update this specific test, also pass `--test-args conditional-compilation/cfg-attr-syntax-validation.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/conditional-compilation/cfg-attr-syntax-validation.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/conditional-compilation/cfg-attr-syntax-validation" "-A" "unused" "-W" "unused_attributes" "-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[E0539]: malformed `cfg` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs:1:1
   |
LL | #[cfg]
   | ^^^^^^
   | |
   | expected this to be a list
   | help: must be of the form: `#[cfg(predicate)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>

error[E0539]: malformed `cfg` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs:7:1
   |
LL | #[cfg = 10]
   | ^^^^^^^^^^^
   | |
   | expected this to be a list
   | help: must be of the form: `#[cfg(predicate)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>

error[E0805]: malformed `cfg` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs:13:1
   |
LL | #[cfg()]
   | ^^^^^--^
   | |    |
   | |    expected a single argument here
   | help: must be of the form: `#[cfg(predicate)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>

error[E0805]: malformed `cfg` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs:19:1
   |
LL | #[cfg(a, b)]
   | ^^^^^------^
   | |    |
   | |    expected a single argument here
   | help: must be of the form: `#[cfg(predicate)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>

error[E0539]: malformed `cfg` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs:25:1
   |
LL | #[cfg("str")]
   | ^^^^^^-----^^
   | |     |
   | |     expected a valid identifier here
   | help: must be of the form: `#[cfg(predicate)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>

error[E0539]: malformed `cfg` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs:31:1
   |
LL | #[cfg(a::b)]
   | ^^^^^^----^^
   | |     |
   | |     expected a valid identifier here
   | help: must be of the form: `#[cfg(predicate)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>

error[E0537]: invalid predicate `a`
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs:37:7
   |
LL | #[cfg(a())] //~ ERROR invalid predicate `a`
   |       ^^^

error[E0539]: malformed `cfg` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs:40:1
   |
LL | #[cfg(a = 10)] //~ ERROR malformed `cfg` attribute input
   | ^^^^^^^^^^--^^
   | |         |
   | |         expected a string literal here
   | help: must be of the form: `#[cfg(predicate)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>

error[E0539]: malformed `cfg` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs:45:1
   |
LL | #[cfg(a = b"hi")]  //~ ERROR malformed `cfg` attribute input
   | ^^^^^^^^^^-^^^^^^
   |           |
   |           help: consider removing the prefix
   |
   = note: expected a normal string literal, not a byte string literal

error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `expr` metavariable
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs:51:30
   |
LL |         #[cfg(feature = $expr)]
   |                              ^
...
LL | generate_s10!(concat!("nonexistent"));
   | ------------------------------------- in this macro invocation
   |
   = note: this error originates in the macro `generate_s10` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 10 previous errors
---
diff of stderr:

92    = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>
93 
94 error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `expr` metavariable
-   --> $DIR/cfg_attr-attr-syntax-validation.rs:30:30
+   --> $DIR/cfg_attr-attr-syntax-validation.rs:30:35
96    |
97 LL |         #[cfg_attr(feature = $expr)]
-    |         ---------------------^^^^^-- help: must be of the form: `#[cfg_attr(predicate, attr1, attr2, ...)]`
+    |         --------------------------^- help: must be of the form: `#[cfg_attr(predicate, attr1, attr2, ...)]`
99 ...
100 LL | generate_s10!(concat!("nonexistent"));
101    | ------------------------------------- in this macro invocation

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.rs:30:35
+   --> $DIR/cfg_attr-attr-syntax-validation.rs:30:35
+    |         --------------------------^- help: must be of the form: `#[cfg_attr(predicate, attr1, attr2, ...)]`


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 conditional-compilation/cfg_attr-attr-syntax-validation.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/conditional-compilation/cfg_attr-attr-syntax-validation.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/conditional-compilation/cfg_attr-attr-syntax-validation" "-A" "unused" "-W" "unused_attributes" "-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[E0539]: malformed `cfg_attr` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.rs:1:1
   |
LL | #[cfg_attr]
   | ^^^^^^^^^^^
   | |
   | expected this to be a list
   | help: must be of the form: `#[cfg_attr(predicate, attr1, attr2, ...)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>

error[E0539]: malformed `cfg_attr` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.rs:5:1
   |
LL | #[cfg_attr = 10]
   | ^^^^^^^^^^^^^^^^
   | |
   | expected this to be a list
   | help: must be of the form: `#[cfg_attr(predicate, attr1, attr2, ...)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>

error[E0539]: malformed `cfg_attr` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.rs:9:1
   |
LL | #[cfg_attr()]
   | ^^^^^^^^^^--^
   | |         |
   | |         expected at least 1 argument here
   | help: must be of the form: `#[cfg_attr(predicate, attr1, attr2, ...)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>

error[E0539]: malformed `cfg_attr` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.rs:13:1
   |
LL | #[cfg_attr("str")] //~ ERROR malformed `cfg_attr` attribute input
   | ^^^^^^^^^^^-----^^
   | |          |
   | |          expected a valid identifier here
   | help: must be of the form: `#[cfg_attr(predicate, attr1, attr2, ...)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>

error[E0539]: malformed `cfg_attr` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.rs:16:1
   |
LL | #[cfg_attr(a::b)] //~ ERROR malformed `cfg_attr` attribute input
   | ^^^^^^^^^^^----^^
   | |          |
   | |          expected a valid identifier here
   | help: must be of the form: `#[cfg_attr(predicate, attr1, attr2, ...)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>

error[E0537]: invalid predicate `a`
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.rs:19:12
   |
LL | #[cfg_attr(a())] //~ ERROR invalid predicate `a`
   |            ^^^

error[E0539]: malformed `cfg_attr` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.rs:22:1
   |
LL | #[cfg_attr(a = 10)] //~ ERROR malformed `cfg_attr` attribute input
   | ^^^^^^^^^^^^^^^--^^
   | |              |
   | |              expected a string literal here
   | help: must be of the form: `#[cfg_attr(predicate, attr1, attr2, ...)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>

error[E0539]: malformed `cfg_attr` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.rs:25:1
   |
LL | #[cfg_attr(a = b"hi")]  //~ ERROR malformed `cfg_attr` attribute input
   | ^^^^^^^^^^^^^^^-^^^^^^
   |                |
   |                help: consider removing the prefix
   |
   = note: expected a normal string literal, not a byte string literal

error: expected `,`, found end of `cfg_attr` input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.rs:38:16
   |
LL | #[cfg_attr(true)] //~ ERROR expected `,`, found end of `cfg_attr` input
   | ---------------^-
   | |              |
   | |              expected `,`
   | help: must be of the form: `#[cfg_attr(predicate, attr1, attr2, ...)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>

error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `expr` metavariable
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.rs:30:35
   |
LL |         #[cfg_attr(feature = $expr)]
   |         --------------------------^- help: must be of the form: `#[cfg_attr(predicate, attr1, attr2, ...)]`
...
LL | generate_s10!(concat!("nonexistent"));
   | ------------------------------------- in this macro invocation
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>
   = note: this error originates in the macro `generate_s10` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find attribute `unknown_attribute` in this scope
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.rs:41:18
   |
LL | #[cfg_attr(true, unknown_attribute)] //~ ERROR cannot find attribute `unknown_attribute` in this scope
   |                  ^^^^^^^^^^^^^^^^^

error[E0539]: malformed `link_section` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.rs:44:18
   |
LL | #[cfg_attr(true, link_section)] //~ ERROR malformed `link_section` attribute input
   |                  ^^^^^^^^^^^^ help: must be of the form: `link_section = "name"`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/abi.html#the-link_section-attribute>

error[E0805]: malformed `inline` attribute input
##[error]  --> /checkout/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.rs:49:18
   |
LL | #[cfg_attr(true, inline())] //~ ERROR malformed `inline` attribute input
   |                  ^^^^^^--
   |                        |
   |                        expected a single argument here
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/codegen.html#the-inline-attribute>
help: try changing it to one of the following valid forms of the attribute
   |
LL - #[cfg_attr(true, inline())] //~ ERROR malformed `inline` attribute input
LL + #[cfg_attr(true, inline)] //~ ERROR malformed `inline` attribute input
   |
LL | #[cfg_attr(true, inline(always))] //~ ERROR malformed `inline` attribute input
   |                         ++++++
LL | #[cfg_attr(true, inline(never))] //~ ERROR malformed `inline` attribute input
   |                         +++++

warning: `#[link_section]` attribute cannot be used on structs
##[warning]  --> /checkout/tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.rs:44:18
   |
LL | #[cfg_attr(true, link_section)] //~ ERROR malformed `link_section` attribute input
   |                  ^^^^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = help: `#[link_section]` can be applied to functions and statics
   = note: requested on the command line with `-W unused-attributes`
---
diff of stderr:

90   --> $DIR/bad-assoc-expr.rs:23:19
91    |
92 LL |     ($ty: ty) => ($ty::clone(&0))
-    |                   ^^^
+    |                   ^
94 ...
95 LL |     expr!(u8);
96    |     --------- in this macro invocation

98    = note: this error originates in the macro `expr` (in Nightly builds, run with -Z macro-backtrace for more info)
99 help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
100    |
- LL |     ($ty: ty) => (<$ty>::clone(&0))
-    |                   +   +
+ LL |     ($ty: ty) => (<>$ty::clone(&0))
+    |                   ++
103 
104 error: aborting due to 9 previous errors
105 


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 did_you_mean/bad-assoc-expr.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/did_you_mean/bad-assoc-expr.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/did_you_mean/bad-assoc-expr" "-A" "unused" "-W" "unused_attributes" "-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: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-expr.rs:3:5
   |
LL |     [i32; 4]::clone(&a);
   |     ^^^^^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL |     <[i32; 4]>::clone(&a);
   |     +        +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-expr.rs:6:5
   |
LL |     [i32]::as_ref(&a);
   |     ^^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL |     <[i32]>::as_ref(&a);
   |     +     +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-expr.rs:9:5
   |
LL |     (u8)::clone(&0);
   |     ^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL |     <(u8)>::clone(&0);
   |     +    +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-expr.rs:12:5
   |
LL |     (u8, u8)::clone(&(0, 0));
   |     ^^^^^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL |     <(u8, u8)>::clone(&(0, 0));
   |     +        +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-expr.rs:15:6
   |
LL |     &(u8)::clone(&0);
   |      ^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL |     &<(u8)>::clone(&0);
   |      +    +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-expr.rs:18:10
   |
LL |     10 + (u8)::clone(&0);
   |          ^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL |     10 + <(u8)>::clone(&0);
   |          +    +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-expr.rs:32:13
   |
LL |     let _ = ty!()::clone(&0);
   |             ^^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL |     let _ = <ty!()>::clone(&0);
   |             +     +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-expr.rs:34:5
   |
LL |     ty!()::clone(&0);
   |     ^^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL |     <ty!()>::clone(&0);
   |     +     +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-expr.rs:23:19
   |
LL |     ($ty: ty) => ($ty::clone(&0))
   |                   ^
...
LL |     expr!(u8);
   |     --------- in this macro invocation
   |
   = note: this error originates in the macro `expr` (in Nightly builds, run with -Z macro-backtrace for more info)
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL |     ($ty: ty) => (<>$ty::clone(&0))
   |                   ++

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

---- [ui] tests/ui/did_you_mean/bad-assoc-expr.rs stdout end ----
---- [ui] tests/ui/did_you_mean/bad-assoc-pat.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/did_you_mean/bad-assoc-pat/bad-assoc-pat.stderr`
diff of stderr:

57   --> $DIR/bad-assoc-pat.rs:21:19
58    |
59 LL |     ($ty: ty) => ($ty::AssocItem)
-    |                   ^^^
+    |                   ^
61 ...
62 LL |         pat!(u8) => {}
63    |         -------- in this macro invocation

65    = note: this error originates in the macro `pat` (in Nightly builds, run with -Z macro-backtrace for more info)
66 help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
67    |
- LL |     ($ty: ty) => (<$ty>::AssocItem)
-    |                   +   +
+ LL |     ($ty: ty) => (<>$ty::AssocItem)
+    |                   ++
70 
71 error[E0599]: no associated item named `AssocItem` found for slice `[u8]` in the current scope
72   --> $DIR/bad-assoc-pat.rs:3:15


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 did_you_mean/bad-assoc-pat.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/did_you_mean/bad-assoc-pat.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/did_you_mean/bad-assoc-pat" "-A" "unused" "-W" "unused_attributes" "-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: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-pat.rs:3:9
   |
LL |         [u8]::AssocItem => {}
   |         ^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL |         <[u8]>::AssocItem => {}
   |         +    +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-pat.rs:6:9
   |
LL |         (u8, u8)::AssocItem => {}
   |         ^^^^^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL |         <(u8, u8)>::AssocItem => {}
   |         +        +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-pat.rs:9:9
   |
LL |         _::AssocItem => {}
   |         ^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL |         <_>::AssocItem => {}
   |         + +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-pat.rs:14:10
   |
LL |         &(u8,)::AssocItem => {}
   |          ^^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL |         &<(u8,)>::AssocItem => {}
   |          +     +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-pat.rs:32:9
   |
LL |         ty!()::AssocItem => {}
   |         ^^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL |         <ty!()>::AssocItem => {}
   |         +     +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-pat.rs:21:19
   |
LL |     ($ty: ty) => ($ty::AssocItem)
   |                   ^
...
LL |         pat!(u8) => {}
   |         -------- in this macro invocation
   |
   = note: this error originates in the macro `pat` (in Nightly builds, run with -Z macro-backtrace for more info)
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL |     ($ty: ty) => (<>$ty::AssocItem)
   |                   ++

error[E0599]: no associated item named `AssocItem` found for slice `[u8]` in the current scope
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-pat.rs:3:15
   |
LL |         [u8]::AssocItem => {}
   |               ^^^^^^^^^ associated item not found in `[u8]`

error[E0599]: no associated item named `AssocItem` found for tuple `(u8, u8)` in the current scope
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-pat.rs:6:19
   |
LL |         (u8, u8)::AssocItem => {}
   |                   ^^^^^^^^^ associated item not found in `(u8, u8)`

error[E0599]: no associated item named `AssocItem` found for type `_` in the current scope
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-pat.rs:9:12
   |
LL |         _::AssocItem => {}
   |            ^^^^^^^^^ associated item not found in `_`

error[E0599]: no associated item named `AssocItem` found for tuple `(u8,)` in the current scope
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-pat.rs:14:17
   |
LL |         &(u8,)::AssocItem => {}
   |                 ^^^^^^^^^ associated item not found in `(u8,)`

error[E0599]: no associated item named `AssocItem` found for type `u8` in the current scope
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-pat.rs:21:24
   |
LL |     ($ty: ty) => ($ty::AssocItem)
   |                        ^^^^^^^^^ associated item not found in `u8`
...
LL |         pat!(u8) => {}
   |         -------- in this macro invocation
   |
   = note: this error originates in the macro `pat` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no associated item named `AssocItem` found for type `u8` in the current scope
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-pat.rs:32:16
   |
LL |         ty!()::AssocItem => {}
   |                ^^^^^^^^^ associated item not found in `u8`

error: aborting due to 12 previous errors

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

---- [ui] tests/ui/did_you_mean/bad-assoc-pat.rs stdout end ----
---- [ui] tests/ui/did_you_mean/bad-assoc-ty.rs#edition2015 stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/did_you_mean/bad-assoc-ty.edition2015/bad-assoc-ty.edition2015.stderr`
diff of stderr:

90   --> $DIR/bad-assoc-ty.rs:44:19
91    |
92 LL |     ($ty: ty) => ($ty::AssocTy);
-    |                   ^^^
+    |                   ^
94 ...
95 LL | type J = ty!(u8);
96    |          ------- in this macro invocation

98    = note: this error originates in the macro `ty` (in Nightly builds, run with -Z macro-backtrace for more info)
99 help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
100    |
- LL |     ($ty: ty) => (<$ty>::AssocTy);
-    |                   +   +
+ LL |     ($ty: ty) => (<>$ty::AssocTy);
+    |                   ++
103 
104 error[E0223]: ambiguous associated type
105   --> $DIR/bad-assoc-ty.rs:5:10


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 did_you_mean/bad-assoc-ty.rs`

error in revision `edition2015`: 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/did_you_mean/bad-assoc-ty.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" "--cfg" "edition2015" "--check-cfg" "cfg(test,FALSE,edition2015,edition2021)" "--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/did_you_mean/bad-assoc-ty.edition2015" "-A" "unused" "-W" "unused_attributes" "-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=2015"
stdout: none
--- stderr -------------------------------
error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-ty.rs:5:10
   |
LL | type A = [u8; 4]::AssocTy;
   |          ^^^^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL | type A = <[u8; 4]>::AssocTy;
   |          +       +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-ty.rs:9:10
   |
LL | type B = [u8]::AssocTy;
   |          ^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL | type B = <[u8]>::AssocTy;
   |          +    +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-ty.rs:13:10
   |
LL | type C = (u8)::AssocTy;
   |          ^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL | type C = <(u8)>::AssocTy;
   |          +    +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-ty.rs:17:10
   |
LL | type D = (u8, u8)::AssocTy;
   |          ^^^^^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL | type D = <(u8, u8)>::AssocTy;
   |          +        +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-ty.rs:21:10
   |
LL | type E = _::AssocTy;
   |          ^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL | type E = <_>::AssocTy;
   |          + +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-ty.rs:25:19
   |
LL | type F = &'static (u8)::AssocTy;
   |                   ^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL | type F = &'static <(u8)>::AssocTy;
   |                   +    +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-ty.rs:31:10
   |
LL | type G = dyn 'static + (Send)::AssocTy;
   |          ^^^^^^^^^^^^^^^^^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL | type G = <dyn 'static + (Send)>::AssocTy;
   |          +                    +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-ty.rs:51:10
   |
LL | type I = ty!()::AssocTy;
   |          ^^^^^
   |
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL | type I = <ty!()>::AssocTy;
   |          +     +

error: missing angle brackets in associated item path
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-ty.rs:44:19
   |
LL |     ($ty: ty) => ($ty::AssocTy);
   |                   ^
...
LL | type J = ty!(u8);
   |          ------- in this macro invocation
   |
   = note: this error originates in the macro `ty` (in Nightly builds, run with -Z macro-backtrace for more info)
help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
   |
LL |     ($ty: ty) => (<>$ty::AssocTy);
   |                   ++

error[E0223]: ambiguous associated type
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-ty.rs:5:10
   |
LL | type A = [u8; 4]::AssocTy;
   |          ^^^^^^^^^^^^^^^^
   |
help: if there were a trait named `Example` with associated type `AssocTy` implemented for `[u8; 4]`, you could use the fully-qualified path
   |
LL - type A = [u8; 4]::AssocTy;
LL + type A = <[u8; 4] as Example>::AssocTy;
   |

error[E0223]: ambiguous associated type
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-ty.rs:9:10
   |
LL | type B = [u8]::AssocTy;
   |          ^^^^^^^^^^^^^
   |
help: if there were a trait named `Example` with associated type `AssocTy` implemented for `[u8]`, you could use the fully-qualified path
   |
LL - type B = [u8]::AssocTy;
LL + type B = <[u8] as Example>::AssocTy;
   |

error[E0223]: ambiguous associated type
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-ty.rs:13:10
   |
LL | type C = (u8)::AssocTy;
   |          ^^^^^^^^^^^^^
   |
help: if there were a trait named `Example` with associated type `AssocTy` implemented for `u8`, you could use the fully-qualified path
   |
LL - type C = (u8)::AssocTy;
LL + type C = <u8 as Example>::AssocTy;
   |

error[E0223]: ambiguous associated type
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-ty.rs:17:10
   |
LL | type D = (u8, u8)::AssocTy;
   |          ^^^^^^^^^^^^^^^^^
   |
help: if there were a trait named `Example` with associated type `AssocTy` implemented for `(u8, u8)`, you could use the fully-qualified path
   |
LL - type D = (u8, u8)::AssocTy;
LL + type D = <(u8, u8) as Example>::AssocTy;
   |

error[E0121]: the placeholder `_` is not allowed within types on item signatures for type aliases
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-ty.rs:21:10
   |
LL | type E = _::AssocTy;
   |          ^ not allowed in type signatures

error[E0223]: ambiguous associated type
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-ty.rs:25:19
   |
LL | type F = &'static (u8)::AssocTy;
   |                   ^^^^^^^^^^^^^
   |
help: if there were a trait named `Example` with associated type `AssocTy` implemented for `u8`, you could use the fully-qualified path
   |
LL - type F = &'static (u8)::AssocTy;
LL + type F = &'static <u8 as Example>::AssocTy;
   |

error[E0223]: ambiguous associated type
##[error]  --> /checkout/tests/ui/did_you_mean/bad-assoc-ty.rs:31:10
   |
LL | type G = dyn 'static + (Send)::AssocTy;
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: if there were a trait named `Example` with associated type `AssocTy` implemented for `(dyn Send + 'static)`, you could use the fully-qualified path
---
diff of stderr:

66   --> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:25:17
67    |
68 LL |             let ...$e;
-    |                 ^^^^^ pattern `1_i32..=i32::MAX` not covered
+    |                 ^^^ pattern `1_i32..=i32::MAX` not covered
70 ...
71 LL |     mac!(0);
72    |     ------- in this macro invocation


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 half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.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/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.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/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax" "-A" "unused" "-W" "unused_attributes" "-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: range-to patterns with `...` are not allowed
##[error]  --> /checkout/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:15:9
   |
LL |         ...X => {} //~ ERROR range-to patterns with `...` are not allowed
   |         ^^^
   |
help: use `..=` instead
   |
LL -         ...X => {} //~ ERROR range-to patterns with `...` are not allowed
LL +         ..=X => {} //~ ERROR range-to patterns with `...` are not allowed
   |

error: range-to patterns with `...` are not allowed
##[error]  --> /checkout/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:16:9
   |
LL |         ...0 => {} //~ ERROR range-to patterns with `...` are not allowed
   |         ^^^
   |
help: use `..=` instead
   |
LL -         ...0 => {} //~ ERROR range-to patterns with `...` are not allowed
LL +         ..=0 => {} //~ ERROR range-to patterns with `...` are not allowed
   |

error: range-to patterns with `...` are not allowed
##[error]  --> /checkout/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:17:9
   |
LL |         ...'a' => {} //~ ERROR range-to patterns with `...` are not allowed
   |         ^^^
   |
help: use `..=` instead
   |
LL -         ...'a' => {} //~ ERROR range-to patterns with `...` are not allowed
LL +         ..='a' => {} //~ ERROR range-to patterns with `...` are not allowed
   |

error: range-to patterns with `...` are not allowed
##[error]  --> /checkout/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:18:9
   |
LL |         ...0.0f32 => {} //~ ERROR range-to patterns with `...` are not allowed
   |         ^^^
   |
help: use `..=` instead
   |
LL -         ...0.0f32 => {} //~ ERROR range-to patterns with `...` are not allowed
LL +         ..=0.0f32 => {} //~ ERROR range-to patterns with `...` are not allowed
   |

error: range-to patterns with `...` are not allowed
##[error]  --> /checkout/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:25:17
   |
LL |             let ...$e; //~ ERROR range-to patterns with `...` are not allowed
   |                 ^^^
...
LL |     mac!(0);
   |     ------- in this macro invocation
   |
   = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use `..=` instead
   |
LL -             let ...$e; //~ ERROR range-to patterns with `...` are not allowed
LL +             let ..=$e; //~ ERROR range-to patterns with `...` are not allowed
   |

error[E0005]: refutable pattern in local binding
##[error]  --> /checkout/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:25:17
   |
LL |             let ...$e; //~ ERROR range-to patterns with `...` are not allowed
   |                 ^^^ pattern `1_i32..=i32::MAX` not covered
...
LL |     mac!(0);
   |     ------- in this macro invocation
   |
   = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
   = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
   = note: the matched value is of type `i32`
   = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 6 previous errors

---
87 error[E0005]: refutable pattern in local binding
-   --> $DIR/half-open-range-pats-inclusive-no-end.rs:18:17
+   --> $DIR/half-open-range-pats-inclusive-no-end.rs:18:19
89    |
90 LL |             let $e...;
-    |                 ^^^^^ pattern `i32::MIN..=-1_i32` not covered
+    |                   ^^^ pattern `i32::MIN..=-1_i32` not covered
92 ...
93 LL |     mac!(0);
94    |     ------- in this macro invocation

99    = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
100 
101 error[E0005]: refutable pattern in local binding
-   --> $DIR/half-open-range-pats-inclusive-no-end.rs:20:17
+   --> $DIR/half-open-range-pats-inclusive-no-end.rs:20:19
103    |
104 LL |             let $e..=;
-    |                 ^^^^^ pattern `i32::MIN..=-1_i32` not covered
+    |                   ^^^ pattern `i32::MIN..=-1_i32` not covered
106 ...
107 LL |     mac!(0);
108    |     ------- in this macro invocation

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs:18:19
-   --> /checkout/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs:20:19
+   --> $DIR/half-open-range-pats-inclusive-no-end.rs:18:19
+    |                   ^^^ pattern `i32::MIN..=-1_i32` not covered
+   --> $DIR/half-open-range-pats-inclusive-no-end.rs:20:19
+    |                   ^^^ pattern `i32::MIN..=-1_i32` not covered


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 half-open-range-patterns/half-open-range-pats-inclusive-no-end.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/half-open-range-patterns/half-open-range-pats-inclusive-no-end.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/half-open-range-patterns/half-open-range-pats-inclusive-no-end" "-A" "unused" "-W" "unused_attributes" "-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[E0586]: inclusive range with no end
##[error]  --> /checkout/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs:8:13
   |
LL |     if let 0... = 1 {} //~ ERROR inclusive range with no end
   |             ^^^
   |
   = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
   |
LL -     if let 0... = 1 {} //~ ERROR inclusive range with no end
LL +     if let 0.. = 1 {} //~ ERROR inclusive range with no end
   |

error[E0586]: inclusive range with no end
##[error]  --> /checkout/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs:9:13
   |
LL |     if let 0..= = 1 {} //~ ERROR inclusive range with no end
   |             ^^^
   |
   = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
   |
LL -     if let 0..= = 1 {} //~ ERROR inclusive range with no end
LL +     if let 0.. = 1 {} //~ ERROR inclusive range with no end
   |

error[E0586]: inclusive range with no end
##[error]  --> /checkout/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs:11:13
   |
LL |     if let X... = 1 {} //~ ERROR inclusive range with no end
   |             ^^^
   |
   = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
   |
LL -     if let X... = 1 {} //~ ERROR inclusive range with no end
LL +     if let X.. = 1 {} //~ ERROR inclusive range with no end
   |

error[E0586]: inclusive range with no end
##[error]  --> /checkout/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs:12:13
   |
LL |     if let X..= = 1 {} //~ ERROR inclusive range with no end
   |             ^^^
   |
   = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
   |
LL -     if let X..= = 1 {} //~ ERROR inclusive range with no end
LL +     if let X.. = 1 {} //~ ERROR inclusive range with no end
   |

error[E0586]: inclusive range with no end
##[error]  --> /checkout/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs:18:19
   |
LL |             let $e...; //~ ERROR inclusive range with no end
   |                   ^^^
...
LL |     mac!(0);
   |     ------- in this macro invocation
   |
   = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
   = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use `..` instead
   |
LL -             let $e...; //~ ERROR inclusive range with no end
LL +             let $e..; //~ ERROR inclusive range with no end
   |

error[E0586]: inclusive range with no end
##[error]  --> /checkout/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs:20:19
   |
LL |             let $e..=; //~ ERROR inclusive range with no end
   |                   ^^^
...
LL |     mac!(0);
   |     ------- in this macro invocation
   |
   = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
   = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use `..` instead
   |
LL -             let $e..=; //~ ERROR inclusive range with no end
LL +             let $e..; //~ ERROR inclusive range with no end
   |

error[E0005]: refutable pattern in local binding
##[error]  --> /checkout/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs:18:19
   |
LL |             let $e...; //~ ERROR inclusive range with no end
   |                   ^^^ pattern `i32::MIN..=-1_i32` not covered
...
LL |     mac!(0);
   |     ------- in this macro invocation
   |
   = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
   = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
   = note: the matched value is of type `i32`
   = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0005]: refutable pattern in local binding
##[error]  --> /checkout/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs:20:19
   |
LL |             let $e..=; //~ ERROR inclusive range with no end
   |                   ^^^ pattern `i32::MIN..=-1_i32` not covered
...
LL |     mac!(0);
   |     ------- in this macro invocation
   |
   = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
   = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
   = note: the matched value is of type `i32`
   = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 8 previous errors

---
1 error: expected identifier, found metavariable
-   --> $DIR/import-prefix-macro-2.rs:11:26
+   --> $DIR/import-prefix-macro-2.rs:11:28
3    |
4 LL |     ($p: path) => (use ::$p {S, Z});
-    |                          ^^ expected identifier, found metavariable
+    |                            ^ expected identifier, found metavariable
6 ...
7 LL | import! { a::b::c }
8    | ------------------- in this macro invocation

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/imports/import-prefix-macro-2.rs:11:28
+   --> $DIR/import-prefix-macro-2.rs:11:28
---
To only update this specific test, also pass `--test-args imports/import-prefix-macro-2.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/imports/import-prefix-macro-2.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/imports/import-prefix-macro-2" "-A" "unused" "-W" "unused_attributes" "-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 identifier, found metavariable
##[error]  --> /checkout/tests/ui/imports/import-prefix-macro-2.rs:11:28
   |
LL |     ($p: path) => (use ::$p {S, Z}); //~ERROR expected identifier, found metavariable
   |                            ^ expected identifier, found metavariable
...
LL | import! { a::b::c }
   | ------------------- in this macro invocation
   |
   = note: this error originates in the macro `import` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 1 previous error
---

13    = note: this warning originates in the macro `bad_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
14 help: add parentheses for clarity
15    |
- LL |         -(-$e)
-    |          +   +
+ LL |         -(-)$e
+    |          + +
18 
19 warning: 1 warning emitted
20 

Note: some mismatched output was normalized before being compared
- LL |         -(-)$e //~ WARN use of a double negation
+    |         ^^
+ LL |         -(-)$e
+    |          + +


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 lint/lint-double-negations-macro.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
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/lint/lint-double-negations-macro.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/lint/lint-double-negations-macro" "-A" "unused" "-W" "unused_attributes" "-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 -------------------------------
warning: use of a double negation
##[warning]  --> /checkout/tests/ui/lint/lint-double-negations-macro.rs:9:9
   |
LL |         --$e //~ WARN use of a double negation
   |         ^^
...
LL |     bad_macro!(1);
   |     ------------- in this macro invocation
   |
   = note: the prefix `--` could be misinterpreted as a decrement operator which exists in other languages
   = note: use `-= 1` if you meant to decrement the value
   = note: `#[warn(double_negations)]` on by default
   = note: this warning originates in the macro `bad_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
help: add parentheses for clarity
   |
LL |         -(-)$e //~ WARN use of a double negation
   |          + +

warning: 1 warning emitted
------------------------------------------

---- [ui] tests/ui/lint/lint-double-negations-macro.rs stdout end ----
---
114 warning: unreachable `pub` item
-   --> $DIR/unreachable_pub.rs:44:47
+   --> $DIR/unreachable_pub.rs:44:58
116    |
117 LL |         ($visibility: vis, $name: ident) => { $visibility struct $name {} }
-    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |                                                          ^^^^^^^^^^^^^^^^
119 ...
120 LL |     define_empty_struct_with_visibility!(pub, Fluorine);
121    |     ---------------------------------------------------

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/lint/unreachable_pub.rs:44:58
+   --> $DIR/unreachable_pub.rs:44:58
---
To only update this specific test, also pass `--test-args lint/unreachable_pub.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
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/lint/unreachable_pub.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/lint/unreachable_pub" "-A" "unused" "-W" "unused_attributes" "-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=2018"
stdout: none
--- stderr -------------------------------
warning: unreachable `pub` item
##[warning]  --> /checkout/tests/ui/lint/unreachable_pub.rs:10:13
   |
LL |     pub use std::fmt; //~ WARNING unreachable_pub
   |     ---     ^^^^^^^^
   |     |
   |     help: consider restricting its visibility: `pub(crate)`
   |
   = help: or consider exporting it for use by other crates

@petrochenkov petrochenkov added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 19, 2025
@petrochenkov
Copy link
Contributor

Could you update the tests (to make CI green) and submit the compiler changes in a separate PR?
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 19, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

4 participants