Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

make declarative macro expansion a part of query system #125356

Closed
wants to merge 3 commits into from

Conversation

SparrowLii
Copy link
Member

@SparrowLii SparrowLii commented May 21, 2024

This is an attempt to make the macro expansion a part of incremental compilation.

Processing of procedural macros is difficult since they may involve interactions with the external environment. Declaring macros is a good start.

It is not yet possible to test the effect of this PR on incremental compilation since the new query is declared as eval_always.

@SparrowLii SparrowLii marked this pull request as draft May 21, 2024 09:24
@rustbot
Copy link
Collaborator

rustbot commented May 21, 2024

r? @compiler-errors

rustbot has assigned @compiler-errors.
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 May 21, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 21, 2024

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@SparrowLii SparrowLii changed the title make declare macro a part of query system make declare macro expansion a part of query system May 21, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@petrochenkov petrochenkov self-assigned this May 21, 2024
@rust-log-analyzer

This comment has been minimized.

@SparrowLii
Copy link
Member Author

The build was successful with some UI tests failed. I think this is a good start.

test result: FAILED. 16658 passed; 39 failed; 159 ignored; 0 measured; 0 filtered out; finished in 134.24s

@compiler-errors compiler-errors removed their assignment May 22, 2024
@petrochenkov petrochenkov changed the title make declare macro expansion a part of query system make declarative macro expansion a part of query system May 24, 2024
@petrochenkov
Copy link
Contributor

petrochenkov commented May 24, 2024

UPD: This PR is doing a different thing than I initially thought.

I haven't finished reading yet, but my general advice would be to avoid the query system for a start, and just add a specialized cache to Resolver.
It should be simpler, and it can be migrated to queries later if everything goes well.

(trait ResolverExpand serves as a connection between resolver and expand.)

@petrochenkov
Copy link
Contributor

The compiler/rustc_expand/src/mbe/transcribe.rs changes are a good cleanup independent from other changes here, I can approve it right away if submitted separately.

compiler/rustc_expand/src/mbe/transcribe.rs Outdated Show resolved Hide resolved
@@ -387,6 +393,18 @@ pub struct MacroExpander<'a, 'b> {
monotonic: bool, // cf. `cx.monotonic_expander()`
}

pub fn expand_legacy_bang<'tcx>(
tcx: TyCtxt<'tcx>,
key: (LocalExpnId, Span, LocalExpnId),
Copy link
Contributor

Choose a reason for hiding this comment

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

The first LocalExpnId is unique for every macro call, so you won't get any reuse on this key.

Or you want to get reuse only between different compilations, when incremental is enabled?
In that case you do need the query system, not just a cache in resolver.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would be interested to see if there are any matching ExpnId hashes and any reuse at all in the simplest case (empty macro, two compilations, no changes between them).

Copy link
Member Author

@SparrowLii SparrowLii May 25, 2024

Choose a reason for hiding this comment

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

Yes, my main target is in two different compilations with incremental enabled. I think each macro should be expected to be expanded only once in a single compilation.

I cleaned up the Span in the key. Incremental compilation theoretically should not rely on any Span.

Yea, I think we need to do more testing of the effect of this change on two different compilations(let the query results be saved in disk).

@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 May 24, 2024
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-17 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#17 exporting to docker image format
#17 sending tarball 30.4s done
#17 DONE 36.7s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-17]
---
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-17', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-17/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id            := 99999999
---
---- [ui] tests/ui/array-slice-vec/vec-macro-with-comma-only.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/array-slice-vec/vec-macro-with-comma-only.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/array-slice-vec/vec-macro-with-comma-only" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/array-slice-vec/vec-macro-with-comma-only/auxiliary"
stderr: none


---- [ui] tests/ui/const-generics/min_const_generics/macro-fail.rs stdout ----
---
42 
- error: unexpected end of macro invocation
-   --> $DIR/macro-fail.rs:40:25
-    |
- LL |     macro_rules! gimme_a_const {
-    |     -------------------------- when calling this macro
- ...
- LL |   let _fail = Example::<gimme_a_const!()>;
-    |                         ^^^^^^^^^^^^^^^^ missing tokens in macro arguments
-    |
- note: while trying to match meta-variable `$rusty:ident`
-    |
-    |
- LL |       ($rusty: ident) => {{ let $rusty = 3; *&$rusty }}
- 
58 error[E0747]: type provided when a constant was expected
59   --> $DIR/macro-fail.rs:14:33
60    |
60    |

87 LL |   let _fail = Example::<gimme_a_const!()>;
89 
- error: aborting due to 9 previous errors
+ error: aborting due to 8 previous errors
91 
---
To only update this specific test, also pass `--test-args const-generics/min_const_generics/macro-fail.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/const-generics/min_const_generics/macro-fail.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/min_const_generics/macro-fail" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/min_const_generics/macro-fail/auxiliary"
--- stderr -------------------------------
error: expected type, found `{`
##[error]  --> /checkout/tests/ui/const-generics/min_const_generics/macro-fail.rs:30:27
   |
   |
LL | fn make_marker() -> impl Marker<gimme_a_const!(marker)> {
   |                                 |
   |                                 this macro call doesn't expand to a type
   |                                 in this macro invocation
...
...
LL |       ($rusty: ident) => {{ let $rusty = 3; *&$rusty }}
   |
   |
   = note: this error originates in the macro `gimme_a_const` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected type, found `{`
##[error]  --> /checkout/tests/ui/const-generics/min_const_generics/macro-fail.rs:30:27
   |
   |
LL |   Example::<gimme_a_const!(marker)>
   |             |
   |             this macro call doesn't expand to a type
   |             in this macro invocation
...
...
LL |       ($rusty: ident) => {{ let $rusty = 3; *&$rusty }}
   |
   |
   = note: this error originates in the macro `gimme_a_const` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected type, found `{`
##[error]  --> /checkout/tests/ui/const-generics/min_const_generics/macro-fail.rs:4:10
   |
LL |   () => {{
LL |   () => {{
   |          ^ expected type
...
LL |   let _fail = Example::<external_macro!()>;
   |                         |
   |                         this macro call doesn't expand to a type
   |                         in this macro invocation
   |
   |
   = note: this error originates in the macro `external_macro` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0747]: type provided when a constant was expected
##[error]  --> /checkout/tests/ui/const-generics/min_const_generics/macro-fail.rs:14:33
   |
LL | fn make_marker() -> impl Marker<gimme_a_const!(marker)> {

error[E0747]: type provided when a constant was expected
##[error]  --> /checkout/tests/ui/const-generics/min_const_generics/macro-fail.rs:14:33
   |
   |
LL | fn make_marker() -> impl Marker<gimme_a_const!(marker)> {
   |
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error[E0747]: type provided when a constant was expected
##[error]  --> /checkout/tests/ui/const-generics/min_const_generics/macro-fail.rs:17:13
   |
   |
LL |   Example::<gimme_a_const!(marker)>

error[E0747]: type provided when a constant was expected
##[error]  --> /checkout/tests/ui/const-generics/min_const_generics/macro-fail.rs:37:25
   |
   |
LL |   let _fail = Example::<external_macro!()>;

error[E0747]: type provided when a constant was expected
##[error]  --> /checkout/tests/ui/const-generics/min_const_generics/macro-fail.rs:40:25
   |
   |
LL |   let _fail = Example::<gimme_a_const!()>;

error: aborting due to 8 previous errors

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


---- [ui] tests/ui/editions/edition-keywords-2015-2015-parsing.rs stdout ----
diff of stderr:

- error: no rules expected the token `r#async`
+ error[E0308]: mismatched types
+   --> $DIR/edition-keywords-2015-2015-parsing.rs:16:15
3    |
3    |
+ LL |     let mut r#async = 1; // OK
+    |                       - expected due to this value
+ ...
4 LL |     r#async = consumes_async!(r#async);
-    |                               ^^^^^^^ no rules expected this token in macro call
- note: while trying to match `async`
-   --> $DIR/auxiliary/edition-kw-macro-2015.rs:17:6
-    |
- LL |     (async) => (1)
---
-   --> $DIR/edition-keywords-2015-2015-parsing.rs:17:35
+ error[E0308]: mismatched types
+   --> $DIR/edition-keywords-2015-2015-parsing.rs:17:15
15    |
+ LL |     let mut r#async = 1; // OK
+    |                       - expected due to this value
+ ...
16 LL |     r#async = consumes_async_raw!(async);
-    |                                   ^^^^^ no rules expected this token in macro call
-    |
- note: while trying to match `r#async`
-   --> $DIR/auxiliary/edition-kw-macro-2015.rs:22:6
-    |
- LL |     (r#async) => (1)
+    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected integer, found `()`
24 
25 error: aborting due to 2 previous errors
26 
---
To only update this specific test, also pass `--test-args editions/edition-keywords-2015-2015-parsing.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/editions/edition-keywords-2015-2015-parsing.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/editions/edition-keywords-2015-2015-parsing" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/editions/edition-keywords-2015-2015-parsing/auxiliary" "--edition=2015"
--- stderr -------------------------------
error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/editions/edition-keywords-2015-2015-parsing.rs:16:15
   |
   |
LL |     let mut r#async = 1; // OK
   |                       - expected due to this value
...
LL |     r#async = consumes_async!(r#async); //~ ERROR no rules expected the token `r#async`

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/editions/edition-keywords-2015-2015-parsing.rs:17:15
   |
   |
LL |     let mut r#async = 1; // OK
   |                       - expected due to this value
...
LL |     r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`

error: aborting due to 2 previous errors

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


---- [ui] tests/ui/editions/edition-keywords-2015-2018-parsing.rs stdout ----
diff of stderr:

- error: no rules expected the token `r#async`
+ error[E0308]: mismatched types
+   --> $DIR/edition-keywords-2015-2018-parsing.rs:16:15
3    |
3    |
+ LL |     let mut r#async = 1; // OK
+    |                       - expected due to this value
+ ...
4 LL |     r#async = consumes_async!(r#async);
-    |                               ^^^^^^^ no rules expected this token in macro call
- note: while trying to match `async`
-   --> $DIR/auxiliary/edition-kw-macro-2018.rs:17:6
-    |
- LL |     (async) => (1)
---
-   --> $DIR/edition-keywords-2015-2018-parsing.rs:17:35
+ error[E0308]: mismatched types
+   --> $DIR/edition-keywords-2015-2018-parsing.rs:17:15
15    |
+ LL |     let mut r#async = 1; // OK
+    |                       - expected due to this value
+ ...
16 LL |     r#async = consumes_async_raw!(async);
-    |                                   ^^^^^ no rules expected this token in macro call
-    |
- note: while trying to match `r#async`
-   --> $DIR/auxiliary/edition-kw-macro-2018.rs:22:6
-    |
- LL |     (r#async) => (1)
+    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected integer, found `()`
24 
25 error: aborting due to 2 previous errors
26 
---
To only update this specific test, also pass `--test-args editions/edition-keywords-2015-2018-parsing.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/editions/edition-keywords-2015-2018-parsing.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/editions/edition-keywords-2015-2018-parsing" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/editions/edition-keywords-2015-2018-parsing/auxiliary" "--edition=2015"
--- stderr -------------------------------
error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/editions/edition-keywords-2015-2018-parsing.rs:16:15
   |
   |
LL |     let mut r#async = 1; // OK
   |                       - expected due to this value
...
LL |     r#async = consumes_async!(r#async); //~ ERROR no rules expected the token `r#async`

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/editions/edition-keywords-2015-2018-parsing.rs:17:15
   |
   |
LL |     let mut r#async = 1; // OK
   |                       - expected due to this value
...
LL |     r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`

error: aborting due to 2 previous errors

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


---- [ui] tests/ui/editions/edition-keywords-2018-2015-parsing.rs stdout ----
diff of stderr:

20 LL |     module::r#async();
22 
22 
- error: no rules expected the token `r#async`
-    |
-    |
- LL |     r#async = consumes_async!(r#async);
-    |                               ^^^^^^^ no rules expected this token in macro call
- note: while trying to match `async`
-   --> $DIR/auxiliary/edition-kw-macro-2015.rs:17:6
-    |
- LL |     (async) => (1)
- LL |     (async) => (1)
-    |      ^^^^^
- 
- error: no rules expected the token `async`
-   --> $DIR/edition-keywords-2018-2015-parsing.rs:21:35
-    |
- LL |     r#async = consumes_async_raw!(async);
-    |                                   ^^^^^ no rules expected this token in macro call
-    |
- note: while trying to match `r#async`
-   --> $DIR/auxiliary/edition-kw-macro-2015.rs:22:6
-    |
- LL |     (r#async) => (1)
- 
- 
47 error: macro expansion ends with an incomplete expression: expected one of `move`, `|`, or `||`
48   --> $DIR/auxiliary/edition-kw-macro-2015.rs:27:23

60    |
60    |
61 LL |     if passes_tt!(async) == 1 {}
62    |                        ^ expected one of `move`, `|`, or `||`
+ error[E0308]: mismatched types
+   --> $DIR/edition-keywords-2018-2015-parsing.rs:20:15
+    |
+    |
+ LL |     let mut r#async = 1; // OK
+    |                       - expected due to this value
+ ...
+ LL |     r#async = consumes_async!(r#async);
+ 
+ error[E0308]: mismatched types
+   --> $DIR/edition-keywords-2018-2015-parsing.rs:21:15
+    |
+    |
+ LL |     let mut r#async = 1; // OK
+    |                       - expected due to this value
+ ...
+ LL |     r#async = consumes_async_raw!(async);
63 
64 error[E0308]: mismatched types
65   --> $DIR/edition-keywords-2018-2015-parsing.rs:31:33

---
To only update this specific test, also pass `--test-args editions/edition-keywords-2018-2015-parsing.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/editions/edition-keywords-2018-2015-parsing.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/editions/edition-keywords-2018-2015-parsing" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/editions/edition-keywords-2018-2015-parsing/auxiliary" "--edition=2018"
--- stderr -------------------------------
error: expected identifier, found keyword `async`
##[error]  --> /checkout/tests/ui/editions/edition-keywords-2018-2015-parsing.rs:16:13
   |
   |
LL |     let mut async = 1; //~ ERROR expected identifier, found keyword `async`
   |
help: escape `async` to use it as an identifier
   |
   |
LL |     let mut r#async = 1; //~ ERROR expected identifier, found keyword `async`

error: expected identifier, found keyword `async`
##[error]  --> /checkout/tests/ui/editions/edition-keywords-2018-2015-parsing.rs:28:13
   |
   |
LL |     module::async(); //~ ERROR expected identifier, found keyword `async`
   |
help: escape `async` to use it as an identifier
   |
   |
LL |     module::r#async(); //~ ERROR expected identifier, found keyword `async`


error: macro expansion ends with an incomplete expression: expected one of `move`, `|`, or `||`
##[error]  --> /checkout/tests/ui/editions/auxiliary/edition-kw-macro-2015.rs:27:23
   |
LL |     ($i: ident) => ($i)
   |                       ^ expected one of `move`, `|`, or `||`
  ::: /checkout/tests/ui/editions/edition-keywords-2018-2015-parsing.rs:24:8
   |
   |
LL |     if passes_ident!(async) == 1 {} // FIXME: Edition hygiene bug, async here is 2018 and reserved


error: macro expansion ends with an incomplete expression: expected one of `move`, `|`, or `||`
   |
   |
LL |     if passes_tt!(async) == 1 {} //~ ERROR macro expansion ends with an incomplete expression
   |                        ^ expected one of `move`, `|`, or `||`
error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/editions/edition-keywords-2018-2015-parsing.rs:20:15
   |
   |
LL |     let mut r#async = 1; // OK
   |                       - expected due to this value
...
LL |     r#async = consumes_async!(r#async); //~ ERROR no rules expected the token `r#async`

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/editions/edition-keywords-2018-2015-parsing.rs:21:15
   |
   |
LL |     let mut r#async = 1; // OK
   |                       - expected due to this value
...
LL |     r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/editions/edition-keywords-2018-2015-parsing.rs:31:33
   |
   |
LL |     let _recovery_witness: () = 0; //~ ERROR mismatched types
   |                            |
   |                            expected due to this

error: aborting due to 7 previous errors
---
---- [ui] tests/ui/empty/empty-comment.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/empty/empty-comment.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/empty/empty-comment" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/empty/empty-comment/auxiliary"
stderr: none


---- [ui] tests/ui/editions/edition-keywords-2018-2018-parsing.rs stdout ----
---- [ui] tests/ui/editions/edition-keywords-2018-2018-parsing.rs stdout ----
diff of stderr:

20 LL |     module::r#async();
22 
22 
- error: no rules expected the token `r#async`
-    |
-    |
- LL |     r#async = consumes_async!(r#async);
-    |                               ^^^^^^^ no rules expected this token in macro call
- note: while trying to match `async`
-   --> $DIR/auxiliary/edition-kw-macro-2018.rs:17:6
-    |
- LL |     (async) => (1)
- LL |     (async) => (1)
-    |      ^^^^^
- 
- error: no rules expected the token `async`
-   --> $DIR/edition-keywords-2018-2018-parsing.rs:28:35
-    |
- LL |     r#async = consumes_async_raw!(async);
-    |                                   ^^^^^ no rules expected this token in macro call
-    |
- note: while trying to match `r#async`
-   --> $DIR/auxiliary/edition-kw-macro-2018.rs:22:6
-    |
- LL |     (r#async) => (1)
- 
- 
47 error: macro expansion ends with an incomplete expression: expected one of `move`, `|`, or `||`
48   --> $DIR/auxiliary/edition-kw-macro-2018.rs:27:23

72    |
72    |
73 LL |     if local_passes_tt!(async) == 1 {}
74    |                              ^ expected one of `move`, `|`, or `||`
+ error[E0308]: mismatched types
+   --> $DIR/edition-keywords-2018-2018-parsing.rs:27:15
+    |
+    |
+ LL |     let mut r#async = 1; // OK
+    |                       - expected due to this value
+ ...
+ LL |     r#async = consumes_async!(r#async);
+ 
+ error[E0308]: mismatched types
+   --> $DIR/edition-keywords-2018-2018-parsing.rs:28:15
+    |
+    |
+ LL |     let mut r#async = 1; // OK
+    |                       - expected due to this value
+ ...
+ LL |     r#async = consumes_async_raw!(async);
75 
76 error[E0308]: mismatched types
77   --> $DIR/edition-keywords-2018-2018-parsing.rs:42:33

---
To only update this specific test, also pass `--test-args editions/edition-keywords-2018-2018-parsing.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/editions/edition-keywords-2018-2018-parsing.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/editions/edition-keywords-2018-2018-parsing" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/editions/edition-keywords-2018-2018-parsing/auxiliary" "--edition=2018"
--- stderr -------------------------------
error: expected identifier, found keyword `async`
##[error]  --> /checkout/tests/ui/editions/edition-keywords-2018-2018-parsing.rs:23:13
   |
   |
LL |     let mut async = 1; //~ ERROR expected identifier, found keyword `async`
   |
help: escape `async` to use it as an identifier
   |
   |
LL |     let mut r#async = 1; //~ ERROR expected identifier, found keyword `async`

error: expected identifier, found keyword `async`
##[error]  --> /checkout/tests/ui/editions/edition-keywords-2018-2018-parsing.rs:39:13
   |
   |
LL |     module::async(); //~ ERROR expected identifier, found keyword `async`
   |
help: escape `async` to use it as an identifier
   |
   |
LL |     module::r#async(); //~ ERROR expected identifier, found keyword `async`


error: macro expansion ends with an incomplete expression: expected one of `move`, `|`, or `||`
##[error]  --> /checkout/tests/ui/editions/auxiliary/edition-kw-macro-2018.rs:27:23
   |
LL |     ($i: ident) => ($i)
   |                       ^ expected one of `move`, `|`, or `||`
  ::: /checkout/tests/ui/editions/edition-keywords-2018-2018-parsing.rs:31:8
   |
   |
LL |     if passes_ident!(async) == 1 {} // FIXME: Edition hygiene bug, async here is 2018 and reserved


error: macro expansion ends with an incomplete expression: expected one of `move`, `|`, or `||`
   |
   |
LL |     if passes_tt!(async) == 1 {} //~ ERROR macro expansion ends with an incomplete expression
   |                        ^ expected one of `move`, `|`, or `||`

error: macro expansion ends with an incomplete expression: expected one of `move`, `|`, or `||`
   |
   |
LL |     ($i: ident) => ($i) //~ ERROR macro expansion ends with an incomplete expression
   |                       ^ expected one of `move`, `|`, or `||`

error: macro expansion ends with an incomplete expression: expected one of `move`, `|`, or `||`
   |
   |
LL |     if local_passes_tt!(async) == 1 {} //~ ERROR macro expansion ends with an incomplete expression
   |                              ^ expected one of `move`, `|`, or `||`
error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/editions/edition-keywords-2018-2018-parsing.rs:27:15
   |
   |
LL |     let mut r#async = 1; // OK
   |                       - expected due to this value
...
LL |     r#async = consumes_async!(r#async); //~ ERROR no rules expected the token `r#async`

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/editions/edition-keywords-2018-2018-parsing.rs:28:15
   |
   |
LL |     let mut r#async = 1; // OK
   |                       - expected due to this value
...
LL |     r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/editions/edition-keywords-2018-2018-parsing.rs:42:33
   |
   |
LL |     let _recovery_witness: () = 0; //~ ERROR mismatched types
   |                            |
   |                            expected due to this

error: aborting due to 9 previous errors
---
---- [ui] tests/ui/fail-simple.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/fail-simple.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/fail-simple" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/fail-simple/auxiliary"
stderr: none


---- [ui] tests/ui/issues/issue-7970a.rs stdout ----
---- [ui] tests/ui/issues/issue-7970a.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/issues/issue-7970a.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-7970a" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-7970a/auxiliary"
stderr: none


---- [ui] tests/ui/macros/assert-trailing-junk.rs#with-generic-asset stdout ----
---- [ui] tests/ui/macros/assert-trailing-junk.rs#with-generic-asset stdout ----
diff of stderr:

10 LL |     assert!(true some extra junk);
11    |                  ^^^^ expected one of `,`, `.`, `?`, or an operator
12 
- error: no rules expected the token `blah`
-    |
-    |
- LL |     assert!(true, "whatever" blah);
-    |                             -^^^^ no rules expected this token in macro call
-    |                             help: missing comma here
-    |
-    = note: while trying to match sequence start
- 
- 
23 error: unexpected string literal
24   --> $DIR/assert-trailing-junk.rs:18:18
25    |

28    |                 |
29    |                 help: try adding a comma
30 
- error: no rules expected the token `blah`
-    |
-    |
- LL |     assert!(true "whatever" blah);
-    |                            -^^^^ no rules expected this token in macro call
-    |                            help: missing comma here
-    |
-    = note: while trying to match sequence start
- 
---
59 


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/assert-trailing-junk.with-generic-asset/assert-trailing-junk.with-generic-asset.stderr
To only update this specific test, also pass `--test-args macros/assert-trailing-junk.rs`

error in revision `with-generic-asset`: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/assert-trailing-junk.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--cfg" "with_generic_asset" "--check-cfg" "cfg(FALSE,with_generic_asset,without_generic_asset)" "--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/x86_64-unknown-linux-gnu/test/ui/macros/assert-trailing-junk.with-generic-asset" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/assert-trailing-junk.with-generic-asset/auxiliary" "--cfg" "feature=\"generic_assert\""
--- stderr -------------------------------
--- stderr -------------------------------
error: expected one of `,`, `.`, `?`, or an operator, found `some`
   |
   |
LL |     assert!(true some extra junk, "whatever");
   |                  ^^^^ expected one of `,`, `.`, `?`, or an operator

error: expected one of `,`, `.`, `?`, or an operator, found `some`
   |
   |
LL |     assert!(true some extra junk);
   |                  ^^^^ expected one of `,`, `.`, `?`, or an operator
error: unexpected string literal
##[error]  --> /checkout/tests/ui/macros/assert-trailing-junk.rs:18:18
   |
   |
LL |     assert!(true "whatever" blah);
   |                 -^^^^^^^^^^
   |                 help: try adding a comma

error: macro requires an expression as an argument
##[error]  --> /checkout/tests/ui/macros/assert-trailing-junk.rs:22:5
##[error]  --> /checkout/tests/ui/macros/assert-trailing-junk.rs:22:5
   |
LL |     assert!(true;);
   |     ^^^^^^^^^^^^-^
   |                 help: try removing semicolon

error: unexpected string literal
##[error]  --> /checkout/tests/ui/macros/assert-trailing-junk.rs:25:27
##[error]  --> /checkout/tests/ui/macros/assert-trailing-junk.rs:25:27
   |
LL |     assert!(false || true "error message");
   |                          -^^^^^^^^^^^^^^^
   |                          help: try adding a comma

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


---- [ui] tests/ui/macros/assert-trailing-junk.rs#without-generic-asset stdout ----
diff of stderr:

10 LL |     assert!(true some extra junk);
11    |                  ^^^^ expected one of `,`, `.`, `?`, or an operator
12 
- error: no rules expected the token `blah`
-    |
-    |
- LL |     assert!(true, "whatever" blah);
-    |                             -^^^^ no rules expected this token in macro call
-    |                             help: missing comma here
-    |
-    = note: while trying to match sequence start
- 
- 
23 error: unexpected string literal
24   --> $DIR/assert-trailing-junk.rs:18:18
25    |

28    |                 |
29    |                 help: try adding a comma
30 
- error: no rules expected the token `blah`
-    |
-    |
- LL |     assert!(true "whatever" blah);
-    |                            -^^^^ no rules expected this token in macro call
-    |                            help: missing comma here
-    |
-    = note: while trying to match sequence start
- 
---
59 


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/assert-trailing-junk.without-generic-asset/assert-trailing-junk.without-generic-asset.stderr
To only update this specific test, also pass `--test-args macros/assert-trailing-junk.rs`

error in revision `without-generic-asset`: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/assert-trailing-junk.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--cfg" "without_generic_asset" "--check-cfg" "cfg(FALSE,with_generic_asset,without_generic_asset)" "--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/x86_64-unknown-linux-gnu/test/ui/macros/assert-trailing-junk.without-generic-asset" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/assert-trailing-junk.without-generic-asset/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error: expected one of `,`, `.`, `?`, or an operator, found `some`
   |
   |
LL |     assert!(true some extra junk, "whatever");
   |                  ^^^^ expected one of `,`, `.`, `?`, or an operator

error: expected one of `,`, `.`, `?`, or an operator, found `some`
   |
   |
LL |     assert!(true some extra junk);
   |                  ^^^^ expected one of `,`, `.`, `?`, or an operator
error: unexpected string literal
##[error]  --> /checkout/tests/ui/macros/assert-trailing-junk.rs:18:18
   |
   |
LL |     assert!(true "whatever" blah);
   |                 -^^^^^^^^^^
   |                 help: try adding a comma

error: macro requires an expression as an argument
##[error]  --> /checkout/tests/ui/macros/assert-trailing-junk.rs:22:5
##[error]  --> /checkout/tests/ui/macros/assert-trailing-junk.rs:22:5
   |
LL |     assert!(true;);
   |     ^^^^^^^^^^^^-^
   |                 help: try removing semicolon

error: unexpected string literal
##[error]  --> /checkout/tests/ui/macros/assert-trailing-junk.rs:25:27
##[error]  --> /checkout/tests/ui/macros/assert-trailing-junk.rs:25:27
   |
LL |     assert!(false || true "error message");
   |                          -^^^^^^^^^^^^^^^
   |                          help: try adding a comma

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


---- [ui] tests/ui/macros/best-failure.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/best-failure.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/best-failure" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/best-failure/auxiliary"
stderr: none


---- [ui] tests/ui/macros/expr_2021_inline_const.rs#edi2024 stdout ----
---- [ui] tests/ui/macros/expr_2021_inline_const.rs#edi2024 stdout ----

error in revision `edi2024`: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/expr_2021_inline_const.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--cfg" "edi2024" "--check-cfg" "cfg(FALSE,edi2021,edi2024)" "--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/x86_64-unknown-linux-gnu/test/ui/macros/expr_2021_inline_const.edi2024" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/expr_2021_inline_const.edi2024/auxiliary" "--edition=2024" "-Z" "unstable-options"
stderr: none


---- [ui] tests/ui/macros/expr_2021_inline_const.rs#edi2021 stdout ----
---- [ui] tests/ui/macros/expr_2021_inline_const.rs#edi2021 stdout ----

error in revision `edi2021`: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/expr_2021_inline_const.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--cfg" "edi2021" "--check-cfg" "cfg(FALSE,edi2021,edi2024)" "--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/x86_64-unknown-linux-gnu/test/ui/macros/expr_2021_inline_const.edi2021" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/expr_2021_inline_const.edi2021/auxiliary" "--edition=2021"
stderr: none


---- [ui] tests/ui/macros/expr_2021_old_edition.rs stdout ----
---- [ui] tests/ui/macros/expr_2021_old_edition.rs stdout ----
diff of stderr:

7    = help: fragment specifier `expr_2021` requires Rust 2021 or later
8            valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis`
- error: no rules expected the token `(`
-   --> $DIR/expr_2021_old_edition.rs:12:8
-    |
- LL | macro_rules! m {
- LL | macro_rules! m {
-    | -------------- when calling this macro
- ...
- LL |     m!(());
-    |        ^ no rules expected this token in macro call
-    |
- note: while trying to match meta-variable `$e:ident`
-    |
-    |
- LL |     ($e:expr_2021) => {
- 
- error: aborting due to 2 previous errors
+ error: aborting due to 1 previous error
26 
---
To only update this specific test, also pass `--test-args macros/expr_2021_old_edition.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/expr_2021_old_edition.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/expr_2021_old_edition" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/expr_2021_old_edition/auxiliary" "--edition=2018"
--- stderr -------------------------------
error: invalid fragment specifier `expr_2021`
##[error]  --> /checkout/tests/ui/macros/expr_2021_old_edition.rs:6:6
   |
   |
LL |     ($e:expr_2021) => { //~ ERROR: invalid fragment specifier `expr_2021`
   |
   |
   = help: fragment specifier `expr_2021` requires Rust 2021 or later
           valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis`
error: aborting due to 1 previous error
------------------------------------------



---- [ui] tests/ui/macros/issue-103529.rs stdout ----
diff of stderr:

13 LL | m! { mut x }
15 
- error: invalid variable declaration
-   --> $DIR/issue-103529.rs:8:6
-    |
-    |
- LL | m! { auto x }
-    |
-    |
- help: write `let` instead of `auto` to introduce a new variable
-    |
- LL | m! { let x }
- 
- error: invalid variable declaration
-   --> $DIR/issue-103529.rs:10:6
-    |
-    |
- LL | m! { var x }
-    |
-    |
- help: write `let` instead of `var` to introduce a new variable
-    |
- LL | m! { let x }
- 
- error: aborting due to 4 previous errors
+ error: aborting due to 2 previous errors
39 
---
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/x86_64-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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/issue-103529" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/issue-103529/auxiliary"
--- stderr -------------------------------
error: expected expression, found keyword `mut`
##[error]  --> /checkout/tests/ui/macros/issue-103529.rs:5:6
   |
   |
LL | m! { mut x }

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

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



---- [ui] tests/ui/macros/local-ambiguity-multiple-parsing-options.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/local-ambiguity-multiple-parsing-options.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/local-ambiguity-multiple-parsing-options" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/local-ambiguity-multiple-parsing-options/auxiliary"
stderr: none


---- [ui] tests/ui/macros/macro-at-most-once-rep-2015.rs stdout ----
---- [ui] tests/ui/macros/macro-at-most-once-rep-2015.rs stdout ----
diff of stderr:

4 LL |     ($(a),?) => {};
6 
- error: no rules expected the token `?`
-   --> $DIR/macro-at-most-once-rep-2015.rs:25:11
-    |
-    |
- LL | macro_rules! foo {
-    | ---------------- when calling this macro
- ...
- LL |     foo!(a?);
-    |           ^ no rules expected this token in macro call
-    = note: while trying to match sequence end
- 
- error: no rules expected the token `?`
-   --> $DIR/macro-at-most-once-rep-2015.rs:26:11
-   --> $DIR/macro-at-most-once-rep-2015.rs:26:11
-    |
- LL | macro_rules! foo {
-    | ---------------- when calling this macro
- ...
- LL |     foo!(a?a);
-    |           ^ no rules expected this token in macro call
-    = note: while trying to match sequence end
- 
- error: no rules expected the token `?`
-   --> $DIR/macro-at-most-once-rep-2015.rs:27:11
-   --> $DIR/macro-at-most-once-rep-2015.rs:27:11
-    |
- LL | macro_rules! foo {
-    | ---------------- when calling this macro
- ...
- LL |     foo!(a?a?a);
-    |           ^ no rules expected this token in macro call
-    = note: while trying to match sequence end
- 
- error: unexpected end of macro invocation
-   --> $DIR/macro-at-most-once-rep-2015.rs:29:5
-   --> $DIR/macro-at-most-once-rep-2015.rs:29:5
-    |
- LL | macro_rules! barplus {
-    | -------------------- when calling this macro
- ...
- LL |     barplus!();
-    |     ^^^^^^^^^^ missing tokens in macro arguments
- note: while trying to match `+`
-   --> $DIR/macro-at-most-once-rep-2015.rs:15:11
-    |
-    |
- LL |     ($(a)?+) => {}; // ok. matches "a+" and "+"
- 
- error: unexpected end of macro invocation
-   --> $DIR/macro-at-most-once-rep-2015.rs:30:15
-    |
-    |
- LL | macro_rules! barplus {
-    | -------------------- when calling this macro
- ...
- LL |     barplus!(a);
-    |               ^ missing tokens in macro arguments
- note: while trying to match `+`
-   --> $DIR/macro-at-most-once-rep-2015.rs:15:11
-    |
-    |
- LL |     ($(a)?+) => {}; // ok. matches "a+" and "+"
- 
- error: no rules expected the token `?`
-   --> $DIR/macro-at-most-once-rep-2015.rs:31:15
-    |
-    |
- LL | macro_rules! barplus {
-    | -------------------- when calling this macro
- ...
- LL |     barplus!(a?);
-    |               ^ no rules expected this token in macro call
- note: while trying to match `+`
-   --> $DIR/macro-at-most-once-rep-2015.rs:15:11
-    |
-    |
- LL |     ($(a)?+) => {}; // ok. matches "a+" and "+"
- 
- error: no rules expected the token `?`
-   --> $DIR/macro-at-most-once-rep-2015.rs:32:15
-    |
-    |
- LL | macro_rules! barplus {
-    | -------------------- when calling this macro
- ...
- LL |     barplus!(a?a);
-    |               ^ no rules expected this token in macro call
- note: while trying to match `+`
-   --> $DIR/macro-at-most-once-rep-2015.rs:15:11
-    |
-    |
- LL |     ($(a)?+) => {}; // ok. matches "a+" and "+"
- 
- error: unexpected end of macro invocation
-   --> $DIR/macro-at-most-once-rep-2015.rs:36:5
-    |
-    |
- LL | macro_rules! barstar {
-    | -------------------- when calling this macro
- ...
- LL |     barstar!();
-    |     ^^^^^^^^^^ missing tokens in macro arguments
- note: while trying to match `*`
-   --> $DIR/macro-at-most-once-rep-2015.rs:19:11
-    |
-    |
- LL |     ($(a)?*) => {}; // ok. matches "a*" and "*"
- 
- error: unexpected end of macro invocation
-   --> $DIR/macro-at-most-once-rep-2015.rs:37:15
-    |
-    |
- LL | macro_rules! barstar {
-    | -------------------- when calling this macro
- ...
- LL |     barstar!(a);
-    |               ^ missing tokens in macro arguments
- note: while trying to match `*`
-   --> $DIR/macro-at-most-once-rep-2015.rs:19:11
-    |
-    |
- LL |     ($(a)?*) => {}; // ok. matches "a*" and "*"
- 
- error: no rules expected the token `?`
-   --> $DIR/macro-at-most-once-rep-2015.rs:38:15
-    |
-    |
- LL | macro_rules! barstar {
-    | -------------------- when calling this macro
- ...
- LL |     barstar!(a?);
-    |               ^ no rules expected this token in macro call
- note: while trying to match `*`
-   --> $DIR/macro-at-most-once-rep-2015.rs:19:11
-    |
-    |
- LL |     ($(a)?*) => {}; // ok. matches "a*" and "*"
- 
- error: no rules expected the token `?`
-   --> $DIR/macro-at-most-once-rep-2015.rs:39:15
-    |
-    |
- LL | macro_rules! barstar {
-    | -------------------- when calling this macro
- ...
- LL |     barstar!(a?a);
-    |               ^ no rules expected this token in macro call
- note: while trying to match `*`
-   --> $DIR/macro-at-most-once-rep-2015.rs:19:11
-    |
-    |
- LL |     ($(a)?*) => {}; // ok. matches "a*" and "*"
- 
- error: aborting due to 12 previous errors
+ error: aborting due to 1 previous error
161 
---
To only update this specific test, also pass `--test-args macros/macro-at-most-once-rep-2015.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/macro-at-most-once-rep-2015.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-at-most-once-rep-2015" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-at-most-once-rep-2015/auxiliary" "--edition=2015"
--- stderr -------------------------------
--- stderr -------------------------------
error: the `?` macro repetition operator does not take a separator
   |
   |
LL |     ($(a),?) => {}; //~ERROR the `?` macro repetition operator

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



---- [ui] tests/ui/macros/macro-at-most-once-rep-2018.rs stdout ----
diff of stderr:

4 LL |     ($(a),?) => {};
6 
- error: no rules expected the token `?`
-   --> $DIR/macro-at-most-once-rep-2018.rs:25:11
-    |
-    |
- LL | macro_rules! foo {
-    | ---------------- when calling this macro
- ...
- LL |     foo!(a?);
-    |           ^ no rules expected this token in macro call
-    = note: while trying to match sequence end
- 
- error: no rules expected the token `?`
-   --> $DIR/macro-at-most-once-rep-2018.rs:26:11
-   --> $DIR/macro-at-most-once-rep-2018.rs:26:11
-    |
- LL | macro_rules! foo {
-    | ---------------- when calling this macro
- ...
- LL |     foo!(a?a);
-    |           ^ no rules expected this token in macro call
-    = note: while trying to match sequence end
- 
- error: no rules expected the token `?`
-   --> $DIR/macro-at-most-once-rep-2018.rs:27:11
-   --> $DIR/macro-at-most-once-rep-2018.rs:27:11
-    |
- LL | macro_rules! foo {
-    | ---------------- when calling this macro
- ...
- LL |     foo!(a?a?a);
-    |           ^ no rules expected this token in macro call
-    = note: while trying to match sequence end
- 
- error: unexpected end of macro invocation
-   --> $DIR/macro-at-most-once-rep-2018.rs:29:5
-   --> $DIR/macro-at-most-once-rep-2018.rs:29:5
-    |
- LL | macro_rules! barplus {
-    | -------------------- when calling this macro
- ...
- LL |     barplus!();
-    |     ^^^^^^^^^^ missing tokens in macro arguments
- note: while trying to match `+`
-   --> $DIR/macro-at-most-once-rep-2018.rs:15:11
-    |
-    |
- LL |     ($(a)?+) => {}; // ok. matches "a+" and "+"
- 
- error: unexpected end of macro invocation
-   --> $DIR/macro-at-most-once-rep-2018.rs:30:15
-    |
-    |
- LL | macro_rules! barplus {
-    | -------------------- when calling this macro
- ...
- LL |     barplus!(a);
-    |               ^ missing tokens in macro arguments
- note: while trying to match `+`
-   --> $DIR/macro-at-most-once-rep-2018.rs:15:11
-    |
-    |
- LL |     ($(a)?+) => {}; // ok. matches "a+" and "+"
- 
- error: no rules expected the token `?`
-   --> $DIR/macro-at-most-once-rep-2018.rs:31:15
-    |
-    |
- LL | macro_rules! barplus {
-    | -------------------- when calling this macro
- ...
- LL |     barplus!(a?);
-    |               ^ no rules expected this token in macro call
- note: while trying to match `+`
-   --> $DIR/macro-at-most-once-rep-2018.rs:15:11
-    |
-    |
- LL |     ($(a)?+) => {}; // ok. matches "a+" and "+"
- 
- error: no rules expected the token `?`
-   --> $DIR/macro-at-most-once-rep-2018.rs:32:15
-    |
-    |
- LL | macro_rules! barplus {
-    | -------------------- when calling this macro
- ...
- LL |     barplus!(a?a);
-    |               ^ no rules expected this token in macro call
- note: while trying to match `+`
-   --> $DIR/macro-at-most-once-rep-2018.rs:15:11
-    |
-    |
- LL |     ($(a)?+) => {}; // ok. matches "a+" and "+"
- 
- error: unexpected end of macro invocation
-   --> $DIR/macro-at-most-once-rep-2018.rs:36:5
-    |
-    |
- LL | macro_rules! barstar {
-    | -------------------- when calling this macro
- ...
- LL |     barstar!();
-    |     ^^^^^^^^^^ missing tokens in macro arguments
- note: while trying to match `*`
-   --> $DIR/macro-at-most-once-rep-2018.rs:19:11
-    |
-    |
- LL |     ($(a)?*) => {}; // ok. matches "a*" and "*"
- 
- error: unexpected end of macro invocation
-   --> $DIR/macro-at-most-once-rep-2018.rs:37:15
-    |
-    |
- LL | macro_rules! barstar {
-    | -------------------- when calling this macro
- ...
- LL |     barstar!(a);
-    |               ^ missing tokens in macro arguments
- note: while trying to match `*`
-   --> $DIR/macro-at-most-once-rep-2018.rs:19:11
-    |
-    |
- LL |     ($(a)?*) => {}; // ok. matches "a*" and "*"
- 
- error: no rules expected the token `?`
-   --> $DIR/macro-at-most-once-rep-2018.rs:38:15
-    |
-    |
- LL | macro_rules! barstar {
-    | -------------------- when calling this macro
- ...
- LL |     barstar!(a?);
-    |               ^ no rules expected this token in macro call
- note: while trying to match `*`
-   --> $DIR/macro-at-most-once-rep-2018.rs:19:11
-    |
-    |
- LL |     ($(a)?*) => {}; // ok. matches "a*" and "*"
- 
- error: no rules expected the token `?`
-   --> $DIR/macro-at-most-once-rep-2018.rs:39:15
-    |
-    |
- LL | macro_rules! barstar {
-    | -------------------- when calling this macro
- ...
- LL |     barstar!(a?a);
-    |               ^ no rules expected this token in macro call
- note: while trying to match `*`
-   --> $DIR/macro-at-most-once-rep-2018.rs:19:11
-    |
-    |
- LL |     ($(a)?*) => {}; // ok. matches "a*" and "*"
- 
- error: aborting due to 12 previous errors
+ error: aborting due to 1 previous error
161 
---
To only update this specific test, also pass `--test-args macros/macro-at-most-once-rep-2018.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/macro-at-most-once-rep-2018.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-at-most-once-rep-2018" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-at-most-once-rep-2018/auxiliary" "--edition=2018"
--- stderr -------------------------------
--- stderr -------------------------------
error: the `?` macro repetition operator does not take a separator
   |
   |
LL |     ($(a),?) => {}; //~ERROR the `?` macro repetition operator

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



---- [ui] tests/ui/macros/macro-match-nonterminal.rs stdout ----
diff of stderr:

3    |
4 LL |     ($a, $b) => {
- 
- error: missing fragment specifier
-   --> $DIR/macro-match-nonterminal.rs:2:8
9    |
9    |
- LL |     ($a, $b) => {
-    |
13    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
14    = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
15    = note: `#[deny(missing_fragment_specifier)]` on by default
---
To only update this specific test, also pass `--test-args macros/macro-match-nonterminal.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/macro-match-nonterminal.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-match-nonterminal" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-match-nonterminal/auxiliary"
--- stderr -------------------------------
error: missing fragment specifier
##[error]  --> /checkout/tests/ui/macros/macro-match-nonterminal.rs:2:8
   |
   |
LL |     ($a, $b) => {
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
   = note: `#[deny(missing_fragment_specifier)]` on by default
   = note: `#[deny(missing_fragment_specifier)]` on by default

error: missing fragment specifier
##[error]  --> /checkout/tests/ui/macros/macro-match-nonterminal.rs:2:10
   |
LL |     ($a, $b) => {
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>

---
To only update this specific test, also pass `--test-args macros/macro-missing-fragment-deduplication.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/macro-missing-fragment-deduplication.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-missing-fragment-deduplication" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-missing-fragment-deduplication/auxiliary" "-Zdeduplicate-diagnostics=yes"
--- stderr -------------------------------
error: missing fragment specifier
##[error]  --> /checkout/tests/ui/macros/macro-missing-fragment-deduplication.rs:4:6
   |
---
---- [ui] tests/ui/macros/macro-missing-fragment.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/macro-missing-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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-missing-fragment" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-missing-fragment/auxiliary"
--- stderr -------------------------------
warning: missing fragment specifier
##[warning]  --> /checkout/tests/ui/macros/macro-missing-fragment.rs:4:20
   |
   |
LL |     ( $( any_token $field_rust_type )* ) => {};
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
note: the lint level is defined here
---
---- [ui] tests/ui/macros/macro-non-lifetime.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/macro-non-lifetime.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-non-lifetime" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-non-lifetime/auxiliary"
stderr: none


---- [ui] tests/ui/macros/missing-comma.rs stdout ----
---
-    |
- LL | macro_rules! foo {
-    | ---------------- when calling this macro
- ...
- LL |     foo!(a b);
-    |           -^ no rules expected this token in macro call
-    |           help: missing comma here
-    |
-    |
- note: while trying to match meta-variable `$a:ident`
-    |
-    |
- LL |     ($a:ident) => ();
- 
- error: no rules expected the token `e`
-   --> $DIR/missing-comma.rs:23:21
-    |
-    |
- LL | macro_rules! foo {
-    | ---------------- when calling this macro
- ...
- LL |     foo!(a, b, c, d e);
-    |                    -^ no rules expected this token in macro call
-    |                    help: missing comma here
-    |
-    |
- note: while trying to match meta-variable `$d:ident`
-    |
-    |
- LL |     ($a:ident, $b:ident, $c:ident, $d:ident) => ();
- 
- error: no rules expected the token `d`
-   --> $DIR/missing-comma.rs:25:18
-    |
-    |
- LL | macro_rules! foo {
-    | ---------------- when calling this macro
- ...
- LL |     foo!(a, b, c d, e);
-    |                 -^ no rules expected this token in macro call
-    |                 help: missing comma here
-    |
-    |
- note: while trying to match meta-variable `$c:ident`
-    |
-    |
- LL |     ($a:ident, $b:ident, $c:ident) => ();
- 
- error: no rules expected the token `d`
-   --> $DIR/missing-comma.rs:27:18
-    |
-    |
- LL | macro_rules! foo {
-    | ---------------- when calling this macro
- ...
- LL |     foo!(a, b, c d e);
-    |                  ^ no rules expected this token in macro call
-    |
- note: while trying to match meta-variable `$c:ident`
-    |
-    |
- LL |     ($a:ident, $b:ident, $c:ident) => ();
- 
- error: unexpected end of macro invocation
-   --> $DIR/missing-comma.rs:29:23
-    |
-    |
- LL | macro_rules! bar {
-    | ---------------- when calling this macro
- ...
- LL |     bar!(Level::Error, );
-    |                       ^ missing tokens in macro arguments
-    |
- note: while trying to match meta-variable `$arg:tt`
-    |
- LL |     ($lvl:expr, $($arg:tt)+) => {}
-    |                   ^^^^^^^
- 
- 
- error: no rules expected the token `,`
-   --> $DIR/missing-comma.rs:32:38
-    |
- LL | macro_rules! check {
-    | ------------------ when calling this macro
- ...
- LL |     check!(<str as Debug>::fmt, "fmt",);
-    |                                      ^ no rules expected this token in macro call
- note: while trying to match meta-variable `$expected:expr`
-   --> $DIR/missing-comma.rs:14:14
-    |
-    |
- LL |     ($ty:ty, $expected:expr) => {};
- 
- error: aborting due to 7 previous errors
+ error: aborting due to 1 previous error
104 
---
To only update this specific test, also pass `--test-args macros/missing-comma.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/missing-comma.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/missing-comma" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/missing-comma/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error: expected `,`, found `a`
   |
LL |     println!("{}" a);
   |                   ^ expected `,`

---
---- [ui] tests/ui/macros/nonterminal-matching.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/nonterminal-matching.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/nonterminal-matching" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/nonterminal-matching/auxiliary"
stderr: none


---- [ui] tests/ui/macros/recovery-allowed.rs stdout ----
---- [ui] tests/ui/macros/recovery-allowed.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/recovery-allowed.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/recovery-allowed" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/recovery-allowed/auxiliary"
stderr: none


---- [ui] tests/ui/macros/trace_faulty_macros.rs stdout ----
---- [ui] tests/ui/macros/trace_faulty_macros.rs stdout ----
diff of stderr:

- error: no rules expected the token `bcd`
+ error: recursion limit reached while expanding `my_recursive_macro!`
+   --> $DIR/trace_faulty_macros.rs:22:9
3    |
3    |
- LL | macro_rules! my_faulty_macro {
-    | ---------------------------- when calling this macro
- LL |     () => {
- LL |         my_faulty_macro!(bcd);
-    |                          ^^^ no rules expected this token in macro call
+ LL |         my_recursive_macro!();
9 ...
- LL |     my_faulty_macro!();
-    |     ------------------ in this macro invocation
+ LL |     my_recursive_macro!();
---
15 
16 note: trace_macro
17   --> $DIR/trace_faulty_macros.rs:31:5

23    = note: to `my_faulty_macro! (bcd);`
24    = note: expanding `my_faulty_macro! { bcd }`
- error: recursion limit reached while expanding `my_recursive_macro!`
-   --> $DIR/trace_faulty_macros.rs:22:9
-    |
- LL |         my_recursive_macro!();
---
38 note: trace_macro
39   --> $DIR/trace_faulty_macros.rs:32:5
40    |

109    = note: expanding `test! { (x, 1 + 1) }`
110    = note: to `let x = 1 + 1;`
- error: aborting due to 5 previous errors
+ error: aborting due to 4 previous errors
113 
114 For more information about this error, try `rustc --explain E0774`.
---
To only update this specific test, also pass `--test-args macros/trace_faulty_macros.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/trace_faulty_macros.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/trace_faulty_macros" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/trace_faulty_macros/auxiliary" "-Z" "trace-macros"
--- stderr -------------------------------
error: recursion limit reached while expanding `my_recursive_macro!`
##[error]  --> /checkout/tests/ui/macros/trace_faulty_macros.rs:22:9
   |
   |
LL |         my_recursive_macro!(); //~ ERROR recursion limit
...
LL |     my_recursive_macro!();
   |     --------------------- in this macro invocation
   |
---
   |
LL |     my_faulty_macro!();
   |     ^^^^^^^^^^^^^^^^^^
   |
   = note: expanding `my_faulty_macro! {  }`
   = note: to `my_faulty_macro! (bcd);`
   = note: expanding `my_faulty_macro! { bcd }`
note: trace_macro
  --> /checkout/tests/ui/macros/trace_faulty_macros.rs:32:5
   |
LL |     my_recursive_macro!();
LL |     my_recursive_macro!();
   |     ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: expanding `my_recursive_macro! {  }`
   = note: to `my_recursive_macro! ();`
   = note: expanding `my_recursive_macro! {  }`
   = note: to `my_recursive_macro! ();`
   = note: expanding `my_recursive_macro! {  }`
   = note: to `my_recursive_macro! ();`
   = note: expanding `my_recursive_macro! {  }`
   = note: to `my_recursive_macro! ();`

error: expected expression, found pattern `A { a: a, b: 0, c: _, .. }`
   |
   |
LL |         $a //~ ERROR expected expression
...
LL |     let a = pat_macro!();
   |             ------------ in this macro invocation
   |
   |
   = note: this error originates in the macro `pat_macro` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
   |
   |
LL | #[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s
LL | fn use_derive_macro_as_attr() {}
   | -------------------------------- not a `struct`, `enum` or `union`

error: expected expression, found pattern `1 + 1`
error: expected expression, found pattern `1 + 1`
##[error]  --> /checkout/tests/ui/macros/trace_faulty_macros.rs:49:37
   |
LL |     (let $p:pat = $e:expr) => {test!(($p,$e))};
...
...
LL |     (($p:pat, $e:pat)) => {let $p = $e;}; //~ ERROR expected expression, found pattern `1 + 1`
...
...
LL |     test!(let x = 1+1);
   |     |             |
   |     |             this is expected to be expression
   |     in this macro invocation
   |
   |
   = note: when forwarding a matched fragment to another macro-by-example, matchers in the second macro will see an opaque AST of the fragment type, not the underlying tokens

note: trace_macro
  --> /checkout/tests/ui/macros/trace_faulty_macros.rs:36:13
   |
   |
LL |     let a = pat_macro!();
   |             ^^^^^^^^^^^^
   |
   = note: expanding `pat_macro! {  }`
   = note: to `pat_macro! (A { a : a, b : 0, c : _, .. });`
   = note: expanding `pat_macro! { A { a : a, b : 0, c : _, .. } }`
   = note: to `A { a: a, b: 0, c: _, .. }`
note: trace_macro
  --> /checkout/tests/ui/macros/trace_faulty_macros.rs:53:5
   |
   |
LL |     test!(let x = 1+1);
   |
   |
   = note: expanding `test! { let x = 1+1 }`
   = note: to `test! ((x, 1 + 1))`
   = note: expanding `test! { (x, 1 + 1) }`
   = note: to `let x = 1 + 1;`
error: aborting due to 4 previous errors

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

- error: unexpected end of macro invocation
-   --> $DIR/offset-of-arg-count.rs:4:34
-    |
- LL |     offset_of!(NotEnoughArguments);
-    |                                  ^ missing tokens in macro arguments
- note: while trying to match `,`
-   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
- 
- error: unexpected end of macro invocation
- error: unexpected end of macro invocation
-   --> $DIR/offset-of-arg-count.rs:5:45
-    |
- LL |     offset_of!(NotEnoughArgumentsWithAComma, );
-    |                                             ^ missing tokens in macro arguments
-    |
- note: while trying to match meta-variable `$fields:expr`
-   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
- 
- error: no rules expected the token `too`
-    |
- LL |     offset_of!(Container, field, too many arguments);
-    |                                  ^^^ no rules expected this token in macro call
-    |
-    |
-    = note: while trying to match sequence end
- 
27 error: unexpected token: `)`
28   --> $DIR/offset-of-arg-count.rs:9:21
29    |

48 LL |     offset_of!(S, f..,);
50 
- error: aborting due to 7 previous errors
+ error: aborting due to 4 previous errors
52 
---
To only update this specific test, also pass `--test-args offset-of/offset-of-arg-count.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/offset-of/offset-of-arg-count.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/offset-of/offset-of-arg-count" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/offset-of/offset-of-arg-count/auxiliary"
--- stderr -------------------------------
error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-arg-count.rs:9:21
   |
   |
LL |     offset_of!(S, f.); //~ ERROR unexpected token: `)`

error: unexpected token: `,`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-arg-count.rs:10:21
   |
   |
LL |     offset_of!(S, f.,); //~ ERROR unexpected token: `,`

error: offset_of expects dot-separated field and variant names
##[error]  --> /checkout/tests/ui/offset-of/offset-of-arg-count.rs:11:19
   |
   |
LL |     offset_of!(S, f..); //~ ERROR offset_of expects dot-separated field and variant names

error: offset_of expects dot-separated field and variant names
##[error]  --> /checkout/tests/ui/offset-of/offset-of-arg-count.rs:12:19
   |
   |
LL |     offset_of!(S, f..,); //~ ERROR offset_of expects dot-separated field and variant names

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



---- [ui] tests/ui/offset-of/offset-of-tuple.rs stdout ----
diff of stderr:

76 LL |     offset_of!((u8, u8), 1_u8);
77    |                          ^^^^ invalid suffix `u8`
- error: no rules expected the token `+`
-   --> $DIR/offset-of-tuple.rs:12:26
-    |
-    |
- LL |     offset_of!((u8, u8), +1);
-    |                          ^ no rules expected this token in macro call
-    |
- note: while trying to match meta-variable `$fields:expr`
-   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
88 error: offset_of expects dot-separated field and variant names
89   --> $DIR/offset-of-tuple.rs:13:26
90    |


212 LL |     offset_of!(((u8, u16), (u32, u16, u8)), 1.2.0);
214 
- error: aborting due to 33 previous errors
+ error: aborting due to 32 previous errors
216 
---
To only update this specific test, also pass `--test-args offset-of/offset-of-tuple.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/offset-of/offset-of-tuple.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/offset-of/offset-of-tuple" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/offset-of/offset-of-tuple/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error: suffixes on a tuple index are invalid
   |
   |
LL |     builtin # offset_of((u8, u8), 1_u8); //~ ERROR no field `1_`
   |                                   ^^^^ invalid suffix `u8`

error: leading `+` is not supported
   |
   |
LL |     { builtin # offset_of((u8, u8), +1) }; //~ ERROR leading `+` is not supported
   |                                     ^ unexpected `+`
help: try removing the `+`
   |
   |
LL -     { builtin # offset_of((u8, u8), +1) }; //~ ERROR leading `+` is not supported
LL +     { builtin # offset_of((u8, u8), 1) }; //~ ERROR leading `+` is not supported

error: offset_of expects dot-separated field and variant names
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:24:38
   |
   |
LL |     { builtin # offset_of((u8, u8), 1.) }; //~ ERROR offset_of expects dot-separated field and variant names

error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:25:40
   |
   |
LL |     { builtin # offset_of((u8, u8), 1 .) }; //~ ERROR unexpected token: `)`

error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:47:45
   |
   |
LL |     { builtin # offset_of(ComplexTup, 0.0.1.) }; //~ ERROR unexpected token: `)`

error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:48:46
   |
   |
LL |     { builtin # offset_of(ComplexTup, 0 .0.1.) }; //~ ERROR unexpected token: `)`

error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:49:47
   |
   |
LL |     { builtin # offset_of(ComplexTup, 0 . 0.1.) }; //~ ERROR unexpected token: `)`

error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:50:46
   |
   |
LL |     { builtin # offset_of(ComplexTup, 0. 0.1.) }; //~ ERROR unexpected token: `)`

error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:51:46
   |
   |
LL |     { builtin # offset_of(ComplexTup, 0.0 .1.) }; //~ ERROR unexpected token: `)`

error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:52:47
   |
   |
LL |     { builtin # offset_of(ComplexTup, 0.0 . 1.) }; //~ ERROR unexpected token: `)`

error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:53:46
   |
   |
LL |     { builtin # offset_of(ComplexTup, 0.0. 1.) }; //~ ERROR unexpected token: `)`


error: suffixes on a tuple index are invalid
   |
   |
LL |     offset_of!((u8, u8), 1_u8); //~ ERROR no field `1_`
   |                          ^^^^ invalid suffix `u8`
error: offset_of expects dot-separated field and variant names
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:13:26
   |
   |
LL |     offset_of!((u8, u8), -1); //~ ERROR offset_of expects dot-separated field and variant names

error: offset_of expects dot-separated field and variant names
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:14:27
   |
   |
LL |     offset_of!((u8, u8), 1.); //~ ERROR offset_of expects dot-separated field and variant names

error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:15:29
   |
   |
LL |     offset_of!((u8, u8), 1 .); //~ unexpected token: `)`

error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:36:34
   |
   |
LL |     offset_of!(ComplexTup, 0.0.1.); //~ ERROR unexpected token: `)`

error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:37:35
   |
   |
LL |     offset_of!(ComplexTup, 0 .0.1.); //~ ERROR unexpected token: `)`

error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:38:36
   |
   |
LL |     offset_of!(ComplexTup, 0 . 0.1.); //~ ERROR unexpected token: `)`

error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:39:35
   |
   |
LL |     offset_of!(ComplexTup, 0. 0.1.); //~ ERROR unexpected token: `)`

error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:40:35
   |
   |
LL |     offset_of!(ComplexTup, 0.0 .1.); //~ ERROR unexpected token: `)`

error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:41:36
   |
   |
LL |     offset_of!(ComplexTup, 0.0 . 1.); //~ ERROR unexpected token: `)`

error: unexpected token: `)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:42:35
   |
   |
LL |     offset_of!(ComplexTup, 0.0. 1.); //~ ERROR unexpected token: `)`


error[E0609]: no field `_0` on type `(u8, u8)`
   |
   |
LL |     offset_of!((u8, u8), _0); //~ ERROR no field `_0`

error[E0609]: no field `01` on type `(u8, u8)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:8:26
   |
   |
LL |     offset_of!((u8, u8), 01); //~ ERROR no field `01`


error[E0609]: no field `1e2` on type `(u8, u8)`
   |
   |
LL |     offset_of!((u8, u8), 1e2); //~ ERROR no field `1e2`


error[E0609]: no field `1_` on type `(u8, u8)`
   |
   |
LL |     offset_of!((u8, u8), 1_u8); //~ ERROR no field `1_`


error[E0609]: no field `1e2` on type `(u8, u8)`
   |
   |
LL |     builtin # offset_of((u8, u8), 1e2); //~ ERROR no field `1e2`


error[E0609]: no field `_0` on type `(u8, u8)`
   |
   |
LL |     builtin # offset_of((u8, u8), _0); //~ ERROR no field `_0`

error[E0609]: no field `01` on type `(u8, u8)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:18:35
   |
   |
LL |     builtin # offset_of((u8, u8), 01); //~ ERROR no field `01`


error[E0609]: no field `1_` on type `(u8, u8)`
   |
   |
LL |     builtin # offset_of((u8, u8), 1_u8); //~ ERROR no field `1_`

error[E0609]: no field `2` on type `(u8, u16)`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:31:47
   |
   |
LL |       offset_of!(((u8, u16), (u32, u16, u8)), 0.2); //~ ERROR no field `2`
   |  _____------------------------------------------^-
   | |     in this macro invocation
   | |     in this macro invocation
LL | |     offset_of!(((u8, u16), (u32, u16, u8)), 1.2);
LL | |     offset_of!(((u8, u16), (u32, u16, u8)), 1.2.0); //~ ERROR no field `0`
   |
   = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0609]: no field `0` on type `u8`
error[E0609]: no field `0` on type `u8`
##[error]  --> /checkout/tests/ui/offset-of/offset-of-tuple.rs:33:49
   |
LL |     offset_of!(((u8, u16), (u32, u16, u8)), 1.2.0); //~ ERROR no field `0`

error: aborting due to 32 previous errors

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


---- [ui] tests/ui/or-patterns/or-patterns-syntactic-fail-2018.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/or-patterns/or-patterns-syntactic-fail-2018.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/or-patterns/or-patterns-syntactic-fail-2018" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/or-patterns/or-patterns-syntactic-fail-2018/auxiliary" "--edition=2018"
stderr: none


---- [ui] tests/ui/parser/macro/macro-doc-comments-1.rs stdout ----
---- [ui] tests/ui/parser/macro/macro-doc-comments-1.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/parser/macro/macro-doc-comments-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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/macro/macro-doc-comments-1" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/macro/macro-doc-comments-1/auxiliary"
stderr: none


---- [ui] tests/ui/parser/macro/issue-33569.rs stdout ----
---- [ui] tests/ui/parser/macro/issue-33569.rs stdout ----
diff of stderr:

15    |
16 LL |     { $+ } => {
- 
- error: missing fragment specifier
-   --> $DIR/issue-33569.rs:2:8
21    |
21    |
- LL |     { $+ } => {
-    |
25    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
26    = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
27    = note: `#[deny(missing_fragment_specifier)]` on by default
---
To only update this specific test, also pass `--test-args parser/macro/issue-33569.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/parser/macro/issue-33569.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/macro/issue-33569" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/macro/issue-33569/auxiliary"
--- stderr -------------------------------
error: expected identifier, found `+`
##[error]  --> /checkout/tests/ui/parser/macro/issue-33569.rs:2:8
   |
   |
LL |     { $+ } => { //~ ERROR expected identifier, found `+`


error: expected one of: `*`, `+`, or `?`
   |
   |
LL |         $(x)(y) //~ ERROR expected one of: `*`, `+`, or `?`

error: missing fragment specifier
##[error]  --> /checkout/tests/ui/parser/macro/issue-33569.rs:2:8
   |
   |
LL |     { $+ } => { //~ ERROR expected identifier, found `+`
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
   = note: `#[deny(missing_fragment_specifier)]` on by default
---
---- [ui] tests/ui/parser/macro/macro-doc-comments-2.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/parser/macro/macro-doc-comments-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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/macro/macro-doc-comments-2" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/parser/macro/macro-doc-comments-2/auxiliary"
stderr: none


---- [ui] tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs stdout ----
---- [ui] tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs stdout ----
diff of stderr:

131    |
132    = note: only supported directly in conditions of `if` and `while` expressions
- error: no rules expected the token `let`
-   --> $DIR/feature-gate.rs:70:15
-    |
- LL |     macro_rules! use_expr {
- LL |     macro_rules! use_expr {
-    |     --------------------- when calling this macro
- ...
- LL |     use_expr!(let 0 = 1);
-    |               ^^^ no rules expected this token in macro call
- note: while trying to match meta-variable `$e:expr`
-   --> $DIR/feature-gate.rs:53:10
-    |
- LL |         ($e:expr) => {
- LL |         ($e:expr) => {
-    |          ^^^^^^^
- 
149 error[E0658]: `if let` guards are experimental
150   --> $DIR/feature-gate.rs:7:12
151    |

262    = help: add `#![feature(let_chains)]` to the crate attributes to enable
263    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
- error: aborting due to 23 previous errors
+ error: aborting due to 22 previous errors
266 
267 For more information about this error, try `rustc --explain E0658`.
---
To only update this specific test, also pass `--test-args rfcs/rfc-2294-if-let-guard/feature-gate.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2294-if-let-guard/feature-gate" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2294-if-let-guard/feature-gate/auxiliary"
--- stderr -------------------------------
error: expected expression, found `let` statement
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:10:16
   |
   |
LL |         () if (let 0 = 1) => {}
   |
   |
   = note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
   |
   |
LL |         () if (let 0 = 1) => {}

error: expected expression, found `let` statement
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:13:18
   |
   |
LL |         () if (((let 0 = 1))) => {}
   |
   |
   = note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
   |
   |
LL |         () if (((let 0 = 1))) => {}

error: expected expression, found `let` statement
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:24:16
   |
   |
LL |         () if (let 0 = 1) && true => {}
   |
   |
   = note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
   |
   |
LL |         () if (let 0 = 1) && true => {}

error: expected expression, found `let` statement
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:27:24
   |
   |
LL |         () if true && (let 0 = 1) => {}
   |
   |
   = note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
   |
   |
LL |         () if true && (let 0 = 1) => {}

error: expected expression, found `let` statement
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:30:16
   |
   |
LL |         () if (let 0 = 1) && (let 0 = 1) => {}
   |
   |
   = note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
   |
   |
LL |         () if (let 0 = 1) && (let 0 = 1) => {}

error: expected expression, found `let` statement
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:30:31
   |
   |
LL |         () if (let 0 = 1) && (let 0 = 1) => {}
   |
   |
   = note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
   |
   |
LL |         () if (let 0 = 1) && (let 0 = 1) => {}

error: expected expression, found `let` statement
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:34:42
   |
   |
LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
   |
   |
   = note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
   |
   |
LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}

error: expected expression, found `let` statement
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:34:55
   |
   |
LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
   |
   |
   = note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
   |
   |
LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}

error: expected expression, found `let` statement
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:34:68
   |
   |
LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
   |
   |
   = note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
   |
   |
LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}

error: expected expression, found `let` statement
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:60:16
   |
   |
LL |     use_expr!((let 0 = 1 && 0 == 0));
   |
   |
   = note: only supported directly in conditions of `if` and `while` expressions
error: expected expression, found `let` statement
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:62:16
   |
   |
LL |     use_expr!((let 0 = 1));
   |
   |
   = note: only supported directly in conditions of `if` and `while` expressions
error[E0658]: `if let` guards are experimental
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:7:12
   |
   |
LL |         () if let 0 = 1 => {}
   |
   = note: see issue #51114 <https://github.com/rust-lang/rust/issues/51114> for more information
   = note: see issue #51114 <https://github.com/rust-lang/rust/issues/51114> for more information
   = help: add `#![feature(if_let_guard)]` 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: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
error[E0658]: `if let` guards are experimental
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:16:12
   |
   |
LL |         () if true && let 0 = 1 => {}
   |
   = note: see issue #51114 <https://github.com/rust-lang/rust/issues/51114> for more information
   = note: see issue #51114 <https://github.com/rust-lang/rust/issues/51114> for more information
   = help: add `#![feature(if_let_guard)]` 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: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
error[E0658]: `if let` guards are experimental
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:20:12
   |
   |
LL |         () if let 0 = 1 && true => {}
   |
   = note: see issue #51114 <https://github.com/rust-lang/rust/issues/51114> for more information
   = note: see issue #51114 <https://github.com/rust-lang/rust/issues/51114> for more information
   = help: add `#![feature(if_let_guard)]` 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: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
error[E0658]: `if let` guards are experimental
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:34:12
   |
   |
LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
   |
   = note: see issue #51114 <https://github.com/rust-lang/rust/issues/51114> for more information
   = note: see issue #51114 <https://github.com/rust-lang/rust/issues/51114> for more information
   = help: add `#![feature(if_let_guard)]` 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: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
error[E0658]: `if let` guards are experimental
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:43:12
   |
   |
LL |         () if let Range { start: _, end: _ } = (true..true) && false => {}
   |
   = note: see issue #51114 <https://github.com/rust-lang/rust/issues/51114> for more information
   = note: see issue #51114 <https://github.com/rust-lang/rust/issues/51114> for more information
   = help: add `#![feature(if_let_guard)]` 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: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
error[E0658]: `if let` guards are experimental
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:66:12
   |
   |
LL |         () if let 0 = 1 => {}
   |
   = note: see issue #51114 <https://github.com/rust-lang/rust/issues/51114> for more information
   = note: see issue #51114 <https://github.com/rust-lang/rust/issues/51114> for more information
   = help: add `#![feature(if_let_guard)]` 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: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are unstable
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:16:23
   |
   |
LL |         () if true && let 0 = 1 => {}
   |
   = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `let` expressions in this position are unstable
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:20:15
   |
   |
LL |         () if let 0 = 1 && true => {}
   |
   = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `let` expressions in this position are unstable
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:34:15
   |
   |
LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
   |
   = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `let` expressions in this position are unstable
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:34:28
   |
   |
LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
   |
   = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `let` expressions in this position are unstable
##[error]  --> /checkout/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs:43:15
   |
   |
LL |         () if let Range { start: _, end: _ } = (true..true) && false => {}
   |
   = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error: aborting due to 22 previous errors

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


---- [ui] tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs stdout ----
diff of stderr:

14    |
15    = note: only supported directly in conditions of `if` and `while` expressions
- error: no rules expected the token `let`
-   --> $DIR/feature-gate.rs:56:15
-    |
- LL |     macro_rules! use_expr {
- LL |     macro_rules! use_expr {
-    |     --------------------- when calling this macro
- ...
- LL |     use_expr!(let 0 = 1);
-    |               ^^^ no rules expected this token in macro call
- note: while trying to match meta-variable `$e:expr`
-   --> $DIR/feature-gate.rs:49:10
-    |
- LL |         ($e:expr) => {
- LL |         ($e:expr) => {
-    |          ^^^^^^^
- 
32 error[E0658]: `let` expressions in this position are unstable
33   --> $DIR/feature-gate.rs:14:16
34    |

109    = help: add `#![feature(let_chains)]` to the crate attributes to enable
110    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
- error: aborting due to 11 previous errors
+ error: aborting due to 10 previous errors
113 
114 For more information about this error, try `rustc --explain E0658`.
---
To only update this specific test, also pass `--test-args rfcs/rfc-2497-if-let-chains/feature-gate.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2497-if-let-chains/feature-gate" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2497-if-let-chains/feature-gate/auxiliary"
--- stderr -------------------------------
error: expected expression, found `let` statement
##[error]  --> /checkout/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs:54:20
   |
   |
LL |     #[cfg(FALSE)] (let 0 = 1);
   |
   |
   = note: only supported directly in conditions of `if` and `while` expressions
error: expected expression, found `let` statement
##[error]  --> /checkout/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs:45:17
   |
   |
LL |     noop_expr!((let 0 = 1));
   |
   |
   = note: only supported directly in conditions of `if` and `while` expressions
error[E0658]: `let` expressions in this position are unstable
##[error]  --> /checkout/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs:14:16
   |
   |
LL |     if true && let 0 = 1 {}
   |
   = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `let` expressions in this position are unstable
##[error]  --> /checkout/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs:17:8
   |
   |
LL |     if let 0 = 1 && true {}
   |
   = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `let` expressions in this position are unstable
##[error]  --> /checkout/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs:20:8
   |
   |
LL |     if let Range { start: _, end: _ } = (true..true) && false {}
   |
   = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `let` expressions in this position are unstable
##[error]  --> /checkout/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs:23:8
   |
   |
LL |     if let 1 = 1 && let true = { true } && false {
   |
   = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `let` expressions in this position are unstable
##[error]  --> /checkout/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs:23:21
   |
   |
LL |     if let 1 = 1 && let true = { true } && false {
   |
   = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `let` expressions in this position are unstable
##[error]  --> /checkout/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs:32:19
   |
   |
LL |     while true && let 0 = 1 {}
   |
   = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `let` expressions in this position are unstable
##[error]  --> /checkout/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs:35:11
   |
   |
LL |     while let 0 = 1 && true {}
   |
   = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `let` expressions in this position are unstable
##[error]  --> /checkout/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs:38:11
   |
   |
LL |     while let Range { start: _, end: _ } = (true..true) && false {}
   |
   = note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = help: add `#![feature(let_chains)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error: aborting due to 10 previous errors

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


---- [ui] tests/ui/underscore-ident-matcher.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/underscore-ident-matcher.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/underscore-ident-matcher" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/underscore-ident-matcher/auxiliary"
stderr: none



matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 25, 2024
cleanup dependence of `ExtCtxt` in transcribe when macro expansion

part of rust-lang#125356
We can remove `transcribe`’s dependence on `ExtCtxt` to facilitate subsequent work (such as moving macro expansion into the incremental compilation system)

r? `@petrochenkov`
Thanks for the reviewing!
fmease added a commit to fmease/rust that referenced this pull request May 26, 2024
cleanup dependence of `ExtCtxt` in transcribe when macro expansion

part of rust-lang#125356
We can remove `transcribe`’s dependence on `ExtCtxt` to facilitate subsequent work (such as moving macro expansion into the incremental compilation system)

r? ``@petrochenkov``
Thanks for the reviewing!
jhpratt added a commit to jhpratt/rust that referenced this pull request May 26, 2024
cleanup dependence of `ExtCtxt` in transcribe when macro expansion

part of rust-lang#125356
We can remove `transcribe`’s dependence on `ExtCtxt` to facilitate subsequent work (such as moving macro expansion into the incremental compilation system)

r? `@petrochenkov`
Thanks for the reviewing!
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 26, 2024
cleanup dependence of `ExtCtxt` in transcribe when macro expansion

part of rust-lang#125356
We can remove `transcribe`’s dependence on `ExtCtxt` to facilitate subsequent work (such as moving macro expansion into the incremental compilation system)

r? ``@petrochenkov``
Thanks for the reviewing!
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 26, 2024
cleanup dependence of `ExtCtxt` in transcribe when macro expansion

part of rust-lang#125356
We can remove `transcribe`’s dependence on `ExtCtxt` to facilitate subsequent work (such as moving macro expansion into the incremental compilation system)

r? ```@petrochenkov```
Thanks for the reviewing!
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 26, 2024
cleanup dependence of `ExtCtxt` in transcribe when macro expansion

part of rust-lang#125356
We can remove `transcribe`’s dependence on `ExtCtxt` to facilitate subsequent work (such as moving macro expansion into the incremental compilation system)

r? ````@petrochenkov````
Thanks for the reviewing!
bors added a commit to rust-lang-ci/rust that referenced this pull request May 26, 2024
cleanup dependence of `ExtCtxt` in transcribe when macro expansion

part of rust-lang#125356
We can remove `transcribe`’s dependence on `ExtCtxt` to facilitate subsequent work (such as moving macro expansion into the incremental compilation system)

r? `@petrochenkov`
Thanks for the reviewing!
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request May 26, 2024
cleanup dependence of `ExtCtxt` in transcribe when macro expansion

part of rust-lang#125356
We can remove `transcribe`’s dependence on `ExtCtxt` to facilitate subsequent work (such as moving macro expansion into the incremental compilation system)

r? `@petrochenkov`
Thanks for the reviewing!
jhpratt added a commit to jhpratt/rust that referenced this pull request May 26, 2024
cleanup dependence of `ExtCtxt` in transcribe when macro expansion

part of rust-lang#125356
We can remove `transcribe`’s dependence on `ExtCtxt` to facilitate subsequent work (such as moving macro expansion into the incremental compilation system)

r? ``@petrochenkov``
Thanks for the reviewing!
Comment on lines +861 to +866
pub macro_map: RwLock<
FxHashMap<
LocalExpnId,
(TokenStream, Span, Lrc<dyn TcxMacroExpander + sync::DynSync + sync::DynSend>),
>,
>,
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not be public, but instead have a set of functions that ensure it can only be added to. It's also not safe for incremental (if macro expansions adds entries here, and the macro expansion query is not invoked again, but the result loaded from cache, the entries here won't get re-added)

@@ -115,6 +118,12 @@ rustc_queries! {
desc { "triggering a delayed bug for testing incremental" }
}

query expand_legacy_bang(key: (LocalExpnId, LocalExpnId)) -> Result<(&'tcx TokenStream, usize), CanRetry> {
Copy link
Contributor

Choose a reason for hiding this comment

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

these IDs are very easily going to change. Is there no better identifier? I guess the query is already eval_always, but it doesn't seem quite right. Intuitively I would have assumed some stable identifier for a macro and a TokenStream as input, which is that not possible?

Copy link
Member Author

@SparrowLii SparrowLii May 27, 2024

Choose a reason for hiding this comment

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

Thanks!

Do you mean using the macro's DefId and input TokenStream as identifier? I also think this is good, but TokenStream may contain NonTerminal, which is not hashable during the macro expansion stage. Unless we implement Hash for all ast stuffs.

Copy link
Member Author

Choose a reason for hiding this comment

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

By the way, why are LocalExpnIds easier to change than DefIds?

Copy link
Member

Choose a reason for hiding this comment

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

The StableHash impl on DefId doesn't actually hash the raw indices inside the DefId, but instead hashes the DefPathHash which is derived from the DefPath. The latter only changes when you rename items or their parent modules or when you have multiple items with the same name nested inside a single item. I believe the LocalExpnId contains that it is the Nth expansion in the current compilation session, which depends on both expansion order and all code that is expanded before the current macro expansion.

Copy link
Contributor

Choose a reason for hiding this comment

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

I also think this is good, but TokenStream may contain NonTerminal, which is not hashable during the macro expansion stage

I was unable to find NonTerminal. Also TokenTree implements HashStable, so it should be possible to stable-hash TokenStream, too, as it's just a wrapper around Lrc<Vec<TokenTree>>.

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI, nonterminals are currently being removed in #124141.
After that token streams will no longer contain pieces of AST.

Copy link
Contributor

Choose a reason for hiding this comment

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

There's analogue of DefPathHash for expansion ids called ExpnHash.
It was introduced in #87044 and #86676 (you may be interested in reading those threads).

This hash is stable in the sense that it is suitable for working with multiple compilations, but it is probably less resistant to small changes in code than DefPathHash (#86676 (comment)).
Although it may be more resistant now than back in 2021 because spans going into the incremental system are item-relative now.

Getting performance improvements from incremental expansion reuse may require using some other more change-resistant hashing scheme.

Copy link
Member

Choose a reason for hiding this comment

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

Although it may be more resistant now than back in 2021 because spans going into the incremental system are item-relative now.

Only starting from HIR, right? Macro expansion is before HIR lowering.

Getting performance improvements from incremental expansion reuse may require using some other more change-resistant hashing scheme.

An option is a stencil mechanism like in Cranelift. Basically you split both the macro expansion input into a stencil and stencil parameters. Any external reference which doesn't affect macro expansion (like spans assuming no unstable features to introspect spans are used) are stored in the stencil parameters and the stencil refers to them by an index into the stencil parameters. And after macro expansion you combine the expansion result and the stencil parameters again to get a regular TokenStream. Only the stencil needs to be hashed. If an external reference changes, the stencil parameters will change too, but the offset into the stencil parameters as stored in the stencil itself remains the same, so the cache will not be invalidated.

https://docs.rs/cranelift-codegen/latest/cranelift_codegen/ir/function/struct.FunctionParameters.html

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather use LocalExpnId here, or at least leave a fixme.

Making LocalExpnId as stable as DefId (or almost) is a long term goal, and the signature should use it when we reach that state.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 27, 2024
cleanup dependence of `ExtCtxt` in transcribe when macro expansion

part of rust-lang#125356
We can remove `transcribe`’s dependence on `ExtCtxt` to facilitate subsequent work (such as moving macro expansion into the incremental compilation system)

r? ```@petrochenkov```
Thanks for the reviewing!
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 27, 2024
Rollup merge of rust-lang#125530 - SparrowLii:expand2, r=petrochenkov

cleanup dependence of `ExtCtxt` in transcribe when macro expansion

part of rust-lang#125356
We can remove `transcribe`’s dependence on `ExtCtxt` to facilitate subsequent work (such as moving macro expansion into the incremental compilation system)

r? ```@petrochenkov```
Thanks for the reviewing!
@bors
Copy link
Contributor

bors commented May 27, 2024

☔ The latest upstream changes (presumably #125611) made this pull request unmergeable. Please resolve the merge conflicts.

@futile
Copy link
Contributor

futile commented Jul 31, 2024

Hi, wanted to ask if you could use any kind of help with this PR, don't want to take away any work of course! :) I'm looking to help enable proc-macro caching, and this looks like it's doing half the required work already, thanks a lot! 👍

@futile
Copy link
Contributor

futile commented Aug 2, 2024

Hey, I went ahead and did a rebase of these commits onto current master.

I opened it as a PR to your fork: SparrowLii#1

Hope this helps!

@futile
Copy link
Contributor

futile commented Aug 3, 2024

I got the itch to try figuring out what caused the remaining errors, which turned into a solution for them that should further/finish the changes from this PR.

I hope that is ok! This is the new PR, which is based on the changes from here: #128605

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 6, 2024
Make declarative macro expansion a part of query system (cont. of rust-lang#125356)

This is a continuation of the effort to make declarative macro expansion a part of the query system from rust-lang#125356 by `@SparrowLii.`

#### Description from that PR:

> This is an attempt to make the macro expansion a part of incremental compilation.
>
> Processing of procedural macros is difficult since they may involve interactions with the external environment. Declaring macros is a good start.
>
> **It is not yet possible to test the effect of this PR on incremental compilation since the new query is declared as eval_always.**

#### Status of this PR:

* It is rebased against a much more recent `master` commit
* It contains the original commits from rust-lang#125356 (in a rebased form)
* It adds the missing implementation for retrying macro matching that provides (better) error diagnostics
  * This was done by refactoring `rustc_expand::mbe::diagnostics::failed_to_match_macro()` to only require a `ParseSess` instead of an `ExtCtxt`. Otherwise, `ExtCtxt` would need to be in the interface of `TcxMacroExpander`, which is not possible, because `ExtCtxt` is part of `rustc_expand`, which depends on the crate that contains `TcxMacroExpander`, `rustc_middle`, and thus would introduce a circular dependency.
  * This refactoring moved the retrying down into the `impl TcxMacroExpander for MacroRulesMacroExpander` (this is just a change compared to the original PR, otherwise not important to know).
* This PR passes `./x test tests/ui`, which produced errors before that were all due to the missing implementation of retry macro matching.
* This PR does **not** yet contain changes for the open discussions from rust-lang#125356. I wanted to fix the tests first before tackling them, and I also need to figure out what the best solutions for them are. I'd welcome any help/support with this, e.g., opening up a corresponding discussion on this PR with a summary/the final decided fix if available :)

In general, I'm new to working on rustc, so would be thankful for a bit more background/explanations in discussions and comments :) Thanks! :)

(tangentially relevant: rust-lang#99515)
@SparrowLii
Copy link
Member Author

SparrowLii commented Aug 7, 2024

@futile Thank you very much for your work. I can't spend much time on continuing the incremental compilation work for the time being due to some other work. Feel free to close #125356 if your work can replace it. (Notify me or @petrochenkov )

(I was waiting for #124141 to be finished. According to oli's opinion, using TokenStream as the query input parameter may be a better way.)

@petrochenkov
Copy link
Contributor

I'll close this in favor of the more complete version (#128747) then.

@futile
Copy link
Contributor

futile commented Aug 7, 2024

@futile Thank you very much for your work. I can't spend much time on continuing the incremental compilation work for the time being due to some other work. Feel free to close #125356 if your work can replace it. (Notify me or @petrochenkov )

(I was waiting for #124141 to be finished. According to oli's opinion, using TokenStream as the query input parameter may be a better way.)

Nice to hear back from you, and thanks! :)

Yeah, it seems like waiting for #124141 should definitely make this easier. My attempt in #128747 to use TokenStream::flattened() instead seemed to work, but two examples in the perf-run failed to build with related errors, so seems it doesn't quite work in practice.

Anyway, thanks a lot for your work, you already did most of it, and I was able to learn a lot through it! :)

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.

10 participants