Skip to content

Conversation

@osamakader
Copy link
Contributor

@osamakader osamakader commented Oct 24, 2025

Fixes #148070

@rustbot rustbot added 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. labels Oct 24, 2025
@rust-log-analyzer

This comment has been minimized.

When suggesting import corrections where the suggestion shares a prefix
with the original import (e.g., 'sync' -> 'std::sync'), the diagnostic
was incorrectly highlighting 'td::s' instead of 'std::'.

This was caused by the as_substr function in rustc_errors/src/lib.rs
using a flawed algorithm that didn't properly handle overlapping
prefix/suffix patterns.

The fix rewrites as_substr to:
- Try all possible prefix/suffix splits
- Select the split with the shortest insertion
- Use longer suffix as tiebreaker for better context

This not only fixes the reported bug but also improves highlighting
accuracy in 7 other diagnostic scenarios, making the '+' markers point
to the exact insertion location in all cases.

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
@osamakader osamakader force-pushed the fix-e0432-diagnostic-highlighting branch from 0da3425 to b2d2b36 Compare October 24, 2025 20:18
Comment on lines +306 to +308
// When the original string appears multiple times in the suggestion (e.g., "sync" in "std::sync"),
// the previous algorithm would incorrectly split it. We need to find the split that results in
// the shortest insertion, which is the most useful for diagnostics.
Copy link
Member

Choose a reason for hiding this comment

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

This is not a correct description of the problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can improve that.

@workingjubilee
Copy link
Member

Redundant with #148061

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
To only update this specific test, also pass `--test-args associated-item/associated-item-enum.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/associated-item/associated-item-enum.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/associated-item/associated-item-enum" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0599]: no variant or associated item named `mispellable` found for enum `Enum` in the current scope
##[error]  --> /checkout/tests/ui/associated-item/associated-item-enum.rs:17:11
   |
LL | enum Enum { Variant }
   | --------- variant or associated item `mispellable` not found for this enum
...
LL |     Enum::mispellable(); //~ ERROR no variant or associated item
   |           ^^^^^^^^^^^ variant or associated item not found in `Enum`
   |
help: there is an associated function `misspellable` with a similar name
   |
LL |     Enum::misspellable(); //~ ERROR no variant or associated item
---
   |
LL | enum Enum { Variant }
   | --------- variant or associated item `mispellable_trait` not found for this enum
...
LL |     Enum::mispellable_trait(); //~ ERROR no variant or associated item
   |           ^^^^^^^^^^^^^^^^^ variant or associated item not found in `Enum`
   |
help: there is an associated function `misspellable_trait` with a similar name
   |
LL |     Enum::misspellable_trait(); //~ ERROR no variant or associated item
   |             +

error[E0599]: no variant or associated item named `MISPELLABLE` found for enum `Enum` in the current scope
##[error]  --> /checkout/tests/ui/associated-item/associated-item-enum.rs:19:11
   |
LL | enum Enum { Variant }
   | --------- variant or associated item `MISPELLABLE` not found for this enum
...
LL |     Enum::MISPELLABLE; //~ ERROR no variant or associated item
   |           ^^^^^^^^^^^ variant or associated item not found in `Enum`
   |
help: there is an associated constant `MISSPELLABLE` with a similar name
   |
LL |     Enum::MISSPELLABLE; //~ ERROR no variant or associated item
---
To only update this specific test, also pass `--test-args error-codes/E0260.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/error-codes/E0260.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/error-codes/E0260" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0260]: the name `alloc` is defined multiple times
##[error]  --> /checkout/tests/ui/error-codes/E0260.rs:3:1
   |
---
To only update this specific test, also pass `--test-args error-emitter/trimmed_multiline_suggestion.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/error-emitter/trimmed_multiline_suggestion.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/error-emitter/trimmed_multiline_suggestion" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "ui-testing=no"
stdout: none
--- stderr -------------------------------
error[E0061]: this function takes 6 arguments but 5 arguments were supplied
##[error] --> /checkout/tests/ui/error-emitter/trimmed_multiline_suggestion.rs:6:5
  |
---
  |
note: function defined here
 --> /checkout/tests/ui/error-emitter/trimmed_multiline_suggestion.rs:2:4
  |
2 | fn function_with_lots_of_arguments(a: i32, b: char, c: i32, d: i32, e: i32, f: i32) {}
  |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^         -------
help: provide the argument
  |
6 |     function_with_lots_of_arguments(
7 ~         variable_name,
---
100 help: provide the argument
101    |
102 LL |     function_with_lots_of_arguments(
- LL |         variable_name,
- LL ~         /* char */,
105 LL ~         variable_name,
+ LL ~         /* char */,
106    |
107 
108 error: aborting due to 6 previous errors


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args fn/fn-arg-count-mismatch-diagnostics.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/fn/fn-arg-count-mismatch-diagnostics.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/fn/fn-arg-count-mismatch-diagnostics" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/fn/fn-arg-count-mismatch-diagnostics/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0061]: this function takes 2 arguments but 1 argument was supplied
##[error]  --> /checkout/tests/ui/fn/fn-arg-count-mismatch-diagnostics.rs:24:9
   |
LL |         <Self>::$method(8)
   |         ^^^^^^^^^^^^^^^--- argument #2 of type `u8` is missing
...
LL |         delegate_local!(foo);
   |         -------------------- in this macro invocation
   |
note: associated function defined here
  --> /checkout/tests/ui/fn/fn-arg-count-mismatch-diagnostics.rs:39:8
   |
LL |     fn foo(a: u8, b: u8) {}
   |        ^^^        -----
   = note: this error originates in the macro `delegate_local` (in Nightly builds, run with -Z macro-backtrace for more info)
help: provide the argument
   |
LL |         <Self>::$method(8, /* u8 */)
   |                          ++++++++++

error[E0061]: this function takes 2 arguments but 1 argument was supplied
##[error]  --> /checkout/tests/ui/fn/fn-arg-count-mismatch-diagnostics.rs:43:9
   |
---

error[E0061]: this function takes 2 arguments but 1 argument was supplied
##[error]  --> /checkout/tests/ui/fn/fn-arg-count-mismatch-diagnostics.rs:31:9
   |
LL |         <$from>::$method(8)
   |         ^^^^^^^^^^^^^^^^--- argument #2 of type `u8` is missing
...
LL |         delegate_from!(Bar, foo);
   |         ------------------------ in this macro invocation
   |
note: associated function defined here
  --> /checkout/tests/ui/fn/fn-arg-count-mismatch-diagnostics.rs:39:8
   |
LL |     fn foo(a: u8, b: u8) {}
   |        ^^^        -----
   = note: this error originates in the macro `delegate_from` (in Nightly builds, run with -Z macro-backtrace for more info)
help: provide the argument
   |
LL |         <$from>::$method(8, /* u8 */)
   |                           ++++++++++

error[E0061]: this function takes 4 arguments but 3 arguments were supplied
##[error]  --> /checkout/tests/ui/fn/fn-arg-count-mismatch-diagnostics.rs:52:5
   |
LL |     foo(1, 2, 3);
   |     ^^^--------- argument #4 of type `isize` is missing
   |
note: function defined here
  --> /checkout/tests/ui/fn/fn-arg-count-mismatch-diagnostics.rs:9:4
   |
LL | fn foo(a: isize, b: isize, c: isize, d: isize) {
   |    ^^^                               --------
help: provide the argument
   |
LL |     foo(1, 2, 3, /* isize */);
   |                +++++++++++++

error[E0061]: this function takes 6 arguments but 3 arguments were supplied
##[error]  --> /checkout/tests/ui/fn/fn-arg-count-mismatch-diagnostics.rs:54:5
   |
LL |     bar(1, 2, 3);
   |     ^^^--------- three arguments of type `i32`, `i32`, and `i32` are missing
   |
note: function defined here
  --> /checkout/tests/ui/fn/fn-arg-count-mismatch-diagnostics.rs:13:4
   |
LL | fn bar(a: i32, b: i32, c: i32, d: i32, e: i32, f: i32) {
   |    ^^^                         ------  ------  ------
help: provide the arguments
   |
LL |     bar(1, 2, 3, /* i32 */, /* i32 */, /* i32 */);
   |                +++++++++++++++++++++++++++++++++

error[E0061]: this function takes 6 arguments but 5 arguments were supplied
##[error]  --> /checkout/tests/ui/fn/fn-arg-count-mismatch-diagnostics.rs:58:5
   |
---
   |
note: function defined here
  --> /checkout/tests/ui/fn/fn-arg-count-mismatch-diagnostics.rs:49:4
   |
LL | fn function_with_lots_of_arguments(a: i32, b: char, c: i32, d: i32, e: i32, f: i32) {}
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^         -------
help: provide the argument
   |
LL |     function_with_lots_of_arguments(
LL ~         variable_name,
LL ~         /* char */,
   |

error: aborting due to 6 previous errors

For more information about this error, try `rustc --explain E0061`.
---
diff of stderr:

12 help: provide the argument
13    |
14 LL |     foo(1i32, /* u32 */, 2i32);
-    |               ++++++++++
+    |             +++++++++++
16 
17 error: aborting due to 1 previous error
18 
---
To only update this specific test, also pass `--test-args fn/param-mismatch-foreign.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/fn/param-mismatch-foreign.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/fn/param-mismatch-foreign" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0061]: this function takes 3 arguments but 2 arguments were supplied
##[error]  --> /checkout/tests/ui/fn/param-mismatch-foreign.rs:7:5
   |
LL |     foo(1i32, 2i32);
   |     ^^^       ---- argument #2 of type `u32` is missing
   |
note: function defined here
  --> /checkout/tests/ui/fn/param-mismatch-foreign.rs:2:8
   |
LL |     fn foo(x: i32, y: u32, z: i32);
   |        ^^^         -
help: provide the argument
   |
LL |     foo(1i32, /* u32 */, 2i32);
   |             +++++++++++

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0061`.
---
To only update this specific test, also pass `--test-args impl-trait/in-trait/refine-captures.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/impl-trait/in-trait/refine-captures.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/impl-trait/in-trait/refine-captures" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
warning: impl trait in impl method captures fewer lifetimes than in trait
##[warning]  --> /checkout/tests/ui/impl-trait/in-trait/refine-captures.rs:6:31
   |
LL |     fn test() -> impl Sized + use<> {}
   |                               ^^^^^
   |
   = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
   = note: we are soliciting feedback, see issue #121718 <https://github.com/rust-lang/rust/issues/121718> for more information
   = note: `#[warn(refining_impl_trait_internal)]` (part of `#[warn(refining_impl_trait)]`) on by default
help: modify the `use<..>` bound to capture the same lifetimes that the trait does
   |
LL |     fn test() -> impl Sized + use<'a> {}
   |                                   ++

---

error: `impl Trait` must mention all type parameters in scope in `use<...>`
##[error]  --> /checkout/tests/ui/impl-trait/in-trait/refine-captures.rs:30:18
   |
LL | impl<T> TypeParam<T> for u64 {
   |      - type parameter is implicitly captured by this `impl Trait`
LL |     fn test() -> impl Sized + use<> {}
   |                  ^^^^^^^^^^^^^^^^^^
   |
   = note: currently, all type parameters are required to be mentioned in the precise captures list
---
diff of stderr:

13 help: consider consuming the `Vec<i32>` when turning it into an `Iterator`
14    |
15 LL |     let mut x = vec![1].into_iter();
-    |                          +++++
+    |                         +++++
17 help: consider using a `let` binding to create a longer lived value
18    |
19 LL ~     let binding = vec![1];
---
To only update this specific test, also pass `--test-args lifetimes/borrowck-let-suggestion.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/lifetimes/borrowck-let-suggestion.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/lifetimes/borrowck-let-suggestion" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0716]: temporary value dropped while borrowed
##[error]  --> /checkout/tests/ui/lifetimes/borrowck-let-suggestion.rs:2:17
   |
LL |     let mut x = vec![1].iter();
   |                 ^^^^^^^       - temporary value is freed at the end of this statement
   |                 |
   |                 creates a temporary value which is freed while still in use
LL |     //~^ ERROR temporary value dropped while borrowed
LL |     x.use_mut();
   |     - borrow later used here
   |
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider consuming the `Vec<i32>` when turning it into an `Iterator`
   |
LL |     let mut x = vec![1].into_iter();
   |                         +++++
help: consider using a `let` binding to create a longer lived value
   |
LL ~     let binding = vec![1];
LL ~     let mut x = binding.iter();
   |

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0716`.
---
-    |            +
+    |           +
259 help: if this is intentional, prefix it with an underscore
260    |
261 LL |         _Batery => {}


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args or-patterns/binding-typo-2.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/or-patterns/binding-typo-2.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/or-patterns/binding-typo-2" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0408]: variable `Ban` is not bound in all patterns
##[error]  --> /checkout/tests/ui/or-patterns/binding-typo-2.rs:14:9
   |
LL |         (Foo, Bar) | (Ban, Foo) => {}
   |         ^^^^^^^^^^    --- variable not in all patterns
   |         |
   |         pattern doesn't bind `Ban`
   |
help: you might have meant to use the similarly named previously used binding `Bar`
   |
LL -         (Foo, Bar) | (Ban, Foo) => {}
LL +         (Foo, Bar) | (Bar, Foo) => {}
   |

error[E0408]: variable `Ban` is not bound in all patterns
##[error]  --> /checkout/tests/ui/or-patterns/binding-typo-2.rs:25:9
   |
LL |         (Foo, _) | (Ban, Foo) => {}
   |         ^^^^^^^^    --- variable not in all patterns
   |         |
   |         pattern doesn't bind `Ban`
   |
help: you might have meant to use the similarly named unit variant `Bar`
   |
LL -         (Foo, _) | (Ban, Foo) => {}
LL +         (Foo, _) | (Bar, Foo) => {}
   |

error[E0408]: variable `Non` is not bound in all patterns
##[error]  --> /checkout/tests/ui/or-patterns/binding-typo-2.rs:44:15
   |
---

error[E0408]: variable `Ban` is not bound in all patterns
##[error]  --> /checkout/tests/ui/or-patterns/binding-typo-2.rs:69:9
   |
LL |         (Foo, _) | (Ban, Foo) => {}
   |         ^^^^^^^^    --- variable not in all patterns
   |         |
   |         pattern doesn't bind `Ban`
   |
help: you might have meant to use the similarly named unit variant `Bar`
   |
LL -         (Foo, _) | (Ban, Foo) => {}
LL +         (Foo, _) | (Bar, Foo) => {}
   |
help: you might have meant to use the similarly named unit struct `Bay`
   |
LL -         (Foo, _) | (Ban, Foo) => {}
LL +         (Foo, _) | (Bay, Foo) => {}
   |
help: you might have meant to use the similarly named constant `Bat`
   |
LL -         (Foo, _) | (Ban, Foo) => {}
LL +         (Foo, _) | (Bat, Foo) => {}
   |

error[E0408]: variable `Ban` is not bound in all patterns
##[error]  --> /checkout/tests/ui/or-patterns/binding-typo-2.rs:86:9
   |
LL |         (Foo, _) | (Ban, Foo) => {}
   |         ^^^^^^^^    --- variable not in all patterns
   |         |
   |         pattern doesn't bind `Ban`
   |
help: you might have meant to use the similarly named unit variant `Bar`
   |
LL -         (Foo, _) | (Ban, Foo) => {}
LL +         (Foo, _) | (Bar, Foo) => {}
   |
help: you might have meant to use the similarly named constant `Bat`
   |
LL -         (Foo, _) | (Ban, Foo) => {}
LL +         (Foo, _) | (Bat, Foo) => {}
   |

error: unused variable: `Ban`
##[error]  --> /checkout/tests/ui/or-patterns/binding-typo-2.rs:14:23
   |
LL |         (Foo, Bar) | (Ban, Foo) => {}
   |                       ^^^
   |
note: the lint level is defined here
  --> /checkout/tests/ui/or-patterns/binding-typo-2.rs:2:9
   |
LL | #![deny(unused_variables)] //~ NOTE: the lint level is defined here
   |         ^^^^^^^^^^^^^^^^
help: you might have meant to pattern match on the similarly named variant `Bar`
   |
LL -         (Foo, Bar) | (Ban, Foo) => {}
LL +         (Foo, Bar) | (Lol::Bar, Foo) => {}
   |
help: if this is intentional, prefix it with an underscore
   |
LL |         (Foo, Bar) | (_Ban, Foo) => {}
   |                       +

error: unused variable: `Ban`
##[error]  --> /checkout/tests/ui/or-patterns/binding-typo-2.rs:25:21
   |
LL |         (Foo, _) | (Ban, Foo) => {}
   |                     ^^^
   |
help: you might have meant to pattern match on the similarly named variant `Bar`
   |
LL -         (Foo, _) | (Ban, Foo) => {}
LL +         (Foo, _) | (Lol::Bar, Foo) => {}
   |
help: if this is intentional, prefix it with an underscore
   |
LL |         (Foo, _) | (_Ban, Foo) => {}
   |                     +

error: unused variable: `Non`
##[error]  --> /checkout/tests/ui/or-patterns/binding-typo-2.rs:37:9
   |
---
LL +         std::prelude::v1::None => {}
   |
help: if this is intentional, prefix it with an underscore
   |
LL |         _Non => {}
   |         +

error: unused variable: `Non`
##[error]  --> /checkout/tests/ui/or-patterns/binding-typo-2.rs:44:9
   |
---
LL +         std::prelude::v1::None | None => {}
   |
help: if this is intentional, prefix it with an underscore
   |
LL |         _Non | None => {}
   |         +

error: unused variable: `Non`
##[error]  --> /checkout/tests/ui/or-patterns/binding-typo-2.rs:54:9
   |
---
LL +         std::prelude::v1::None | Some(_) => {}
   |
help: if this is intentional, prefix it with an underscore
   |
LL |         _Non | Some(_) => {}
   |         +

error: unused variable: `Ban`
##[error]  --> /checkout/tests/ui/or-patterns/binding-typo-2.rs:69:21
   |
LL |         (Foo, _) | (Ban, Foo) => {}
   |                     ^^^
   |
help: you might have meant to pattern match on the similarly named variant `Bar`
   |
LL -         (Foo, _) | (Ban, Foo) => {}
LL +         (Foo, _) | (Lol::Bar, Foo) => {}
   |
help: if this is intentional, prefix it with an underscore
   |
LL |         (Foo, _) | (_Ban, Foo) => {}
   |                     +

error: unused variable: `Ban`
##[error]  --> /checkout/tests/ui/or-patterns/binding-typo-2.rs:86:21
   |
LL |         (Foo, _) | (Ban, Foo) => {}
   |                     ^^^
   |
help: you might have meant to pattern match on the similarly named variant `Bar`
   |
LL -         (Foo, _) | (Ban, Foo) => {}
LL +         (Foo, _) | (Lol::Bar, Foo) => {}
   |
help: if this is intentional, prefix it with an underscore
   |
LL |         (Foo, _) | (_Ban, Foo) => {}
   |                     +

error: unused variable: `Ban`
##[error]  --> /checkout/tests/ui/or-patterns/binding-typo-2.rs:98:10
   |
LL |         (Ban, _) => {}
   |          ^^^
   |
help: you might have meant to pattern match on the similarly named variant `Bar`
   |
LL -         (Ban, _) => {}
LL +         (Lol::Bar, _) => {}
   |
help: if this is intentional, prefix it with an underscore
   |
LL |         (_Ban, _) => {}
   |          +

error: unused variable: `Ban`
##[error]  --> /checkout/tests/ui/or-patterns/binding-typo-2.rs:104:9
   |
LL |         Ban => {}
   |         ^^^
   |
help: you might have meant to pattern match on the similarly named struct `Bay`
   |
LL -         Ban => {}
LL +         Bay => {}
   |
help: if this is intentional, prefix it with an underscore
   |
LL |         _Ban => {}
   |         +

error: unused variable: `Batery`
##[error]  --> /checkout/tests/ui/or-patterns/binding-typo-2.rs:110:9
   |
LL |         Batery => {}
   |         ^^^^^^
   |
help: you might have meant to pattern match on the similarly named constant `Battery`
   |
LL |         Battery => {}
   |           +
help: if this is intentional, prefix it with an underscore
   |
LL |         _Batery => {}
   |         +

error: aborting due to 16 previous errors

For more information about this error, try `rustc --explain E0408`.
---
To only update this specific test, also pass `--test-args panic-handler/weak-lang-item.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/panic-handler/weak-lang-item.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/panic-handler/weak-lang-item" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/panic-handler/weak-lang-item/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0259]: the name `core` is defined multiple times
##[error]  --> /checkout/tests/ui/panic-handler/weak-lang-item.rs:7:1
   |
---
error: `#[panic_handler]` function required, but not found

error: unwinding panics are not supported without std
   |
   = help: using nightly cargo, use -Zbuild-std with panic="abort" to avoid unwinding
   = note: since the core library is usually precompiled with panic="unwind", rebuilding your crate with panic="abort" may not be enough to fix the problem

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0259`.
------------------------------------------
---
11 LL |         Foo::Bar => {}
-    |             +
+    |            +
13 
14 error: expected one of `!`, `(`, `...`, `..=`, `..`, `::`, `{`, or `|`, found `:`
15   --> $DIR/issue-87086-colon-path-sep.rs:23:17

22 help: maybe write a path separator here
23    |
24 LL |         qux::Foo::Bar => {}
-    |                  +
+    |                 +
26 
27 error: expected one of `@` or `|`, found `:`
28   --> $DIR/issue-87086-colon-path-sep.rs:29:12

35 help: maybe write a path separator here
36    |
37 LL |         qux::Foo::Baz => {}
-    |             +
+    |            +
39 
40 error: expected one of `@` or `|`, found `:`
41   --> $DIR/issue-87086-colon-path-sep.rs:35:12

61 help: maybe write a path separator here
62    |
63 LL |     if let Foo::Bar = f() {
-    |                +
+    |               +
65 
66 error: expected one of `@` or `|`, found `:`
67   --> $DIR/issue-87086-colon-path-sep.rs:48:16

100 help: maybe write a path separator here
101    |
102 LL |         Foo::Bar::Baz => {}
-    |             +
+    |            +
104 
105 error: expected one of `@` or `|`, found `:`
106   --> $DIR/issue-87086-colon-path-sep.rs:74:12

113 help: maybe write a path separator here
114    |
115 LL |         Foo::Bar => {}
---
To only update this specific test, also pass `--test-args parser/issues/issue-87086-colon-path-sep.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/parser/issues/issue-87086-colon-path-sep.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/parser/issues/issue-87086-colon-path-sep" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: expected one of `@` or `|`, found `:`
##[error]  --> /checkout/tests/ui/parser/issues/issue-87086-colon-path-sep.rs:17:12
   |
LL |         Foo:Bar => {}
   |            ^--- specifying the type of a pattern isn't supported
   |            |
   |            expected one of `@` or `|`
   |
help: maybe write a path separator here
   |
LL |         Foo::Bar => {}
   |            +

error: expected one of `!`, `(`, `...`, `..=`, `..`, `::`, `{`, or `|`, found `:`
##[error]  --> /checkout/tests/ui/parser/issues/issue-87086-colon-path-sep.rs:23:17
   |
LL |         qux::Foo:Bar => {}
   |                 ^--- specifying the type of a pattern isn't supported
   |                 |
   |                 expected one of 8 possible tokens
   |
help: maybe write a path separator here
   |
LL |         qux::Foo::Bar => {}
   |                 +

error: expected one of `@` or `|`, found `:`
##[error]  --> /checkout/tests/ui/parser/issues/issue-87086-colon-path-sep.rs:29:12
   |
LL |         qux:Foo::Baz => {}
   |            ^-------- specifying the type of a pattern isn't supported
   |            |
   |            expected one of `@` or `|`
   |
help: maybe write a path separator here
   |
LL |         qux::Foo::Baz => {}
   |            +

error: expected one of `@` or `|`, found `:`
##[error]  --> /checkout/tests/ui/parser/issues/issue-87086-colon-path-sep.rs:35:12
   |
LL |         qux: Foo::Baz if true => {}
   |            ^ -------- specifying the type of a pattern isn't supported
   |            |
   |            expected one of `@` or `|`
   |
help: maybe write a path separator here
   |
LL |         qux::Foo::Baz if true => {}
   |            ~~

error: expected one of `@` or `|`, found `:`
##[error]  --> /checkout/tests/ui/parser/issues/issue-87086-colon-path-sep.rs:40:15
   |
LL |     if let Foo:Bar = f() {
   |               ^--- specifying the type of a pattern isn't supported
   |               |
   |               expected one of `@` or `|`
   |
help: maybe write a path separator here
   |
LL |     if let Foo::Bar = f() {
   |               +

error: expected one of `@` or `|`, found `:`
##[error]  --> /checkout/tests/ui/parser/issues/issue-87086-colon-path-sep.rs:48:16
   |
LL |         ref qux: Foo::Baz => {}
   |                ^ -------- specifying the type of a pattern isn't supported
   |                |
   |                expected one of `@` or `|`
   |
help: maybe write a path separator here
   |
LL |         ref qux::Foo::Baz => {}
   |                ~~

error: expected one of `@` or `|`, found `:`
##[error]  --> /checkout/tests/ui/parser/issues/issue-87086-colon-path-sep.rs:57:16
   |
LL |         mut qux: Foo::Baz => {}
   |                ^ -------- specifying the type of a pattern isn't supported
   |                |
   |                expected one of `@` or `|`
   |
help: maybe write a path separator here
   |
LL |         mut qux::Foo::Baz => {}
   |                ~~

error: expected one of `@` or `|`, found `:`
##[error]  --> /checkout/tests/ui/parser/issues/issue-87086-colon-path-sep.rs:68:12
   |
LL |         Foo:Bar::Baz => {}
   |            ^-------- specifying the type of a pattern isn't supported
   |            |
   |            expected one of `@` or `|`
   |
help: maybe write a path separator here
   |
LL |         Foo::Bar::Baz => {}
   |            +

error: expected one of `@` or `|`, found `:`
##[error]  --> /checkout/tests/ui/parser/issues/issue-87086-colon-path-sep.rs:74:12
   |
LL |         Foo:Bar => {}
   |            ^--- specifying the type of a pattern isn't supported
   |            |
   |            expected one of `@` or `|`
   |
help: maybe write a path separator here
   |
LL |         Foo::Bar => {}
   |            +
---
diff of stderr:

7 help: maybe write a path separator here
8    |
9 LL |     let x = Tr<A, A::>;
-    |                     +
+    |                    +
11 
12 error: aborting due to 1 previous error
13 
---
To only update this specific test, also pass `--test-args parser/recover/turbofish-arg-with-stray-colon.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/parser/recover/turbofish-arg-with-stray-colon.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/parser/recover/turbofish-arg-with-stray-colon" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `,`
##[error]  --> /checkout/tests/ui/parser/recover/turbofish-arg-with-stray-colon.rs:2:17
   |
LL |     let x = Tr<A, A:>;
   |                 ^ expected one of 8 possible tokens
   |
help: maybe write a path separator here
   |
LL |     let x = Tr<A, A::>;
   |                    +

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

---
10 LL | use std::process::Command;
-    |                  +
+    |                 +
12 
13 error: expected `::`, found `:`
14   --> $DIR/use-colon-as-mod-sep.rs:5:8

20 help: use double colon
21    |
22 LL | use std::fs::File;
-    |         +
+    |        +
24 
25 error: expected `::`, found `:`
26   --> $DIR/use-colon-as-mod-sep.rs:7:8

32 help: use double colon
33    |
34 LL | use std::collections:HashMap;
-    |         +
+    |        +
36 
37 error: expected `::`, found `:`
38   --> $DIR/use-colon-as-mod-sep.rs:7:20

44 help: use double colon
45    |
46 LL | use std:collections::HashMap;
---
To only update this specific test, also pass `--test-args parser/use-colon-as-mod-sep.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/parser/use-colon-as-mod-sep.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/parser/use-colon-as-mod-sep" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: expected `::`, found `:`
##[error]  --> /checkout/tests/ui/parser/use-colon-as-mod-sep.rs:3:17
   |
LL | use std::process:Command;
   |                 ^
   |
   = note: import paths are delimited using `::`
help: use double colon
   |
LL | use std::process::Command;
   |                 +

error: expected `::`, found `:`
##[error]  --> /checkout/tests/ui/parser/use-colon-as-mod-sep.rs:5:8
   |
LL | use std:fs::File;
   |        ^
   |
   = note: import paths are delimited using `::`
help: use double colon
   |
LL | use std::fs::File;
   |        +

error: expected `::`, found `:`
##[error]  --> /checkout/tests/ui/parser/use-colon-as-mod-sep.rs:7:8
   |
LL | use std:collections:HashMap;
   |        ^
   |
   = note: import paths are delimited using `::`
help: use double colon
   |
LL | use std::collections:HashMap;
   |        +

error: expected `::`, found `:`
##[error]  --> /checkout/tests/ui/parser/use-colon-as-mod-sep.rs:7:20
   |
LL | use std:collections:HashMap;
   |                    ^
   |
   = note: import paths are delimited using `::`
help: use double colon
   |
---
diff of stderr:

12 help: the type can be constructed directly, because its fields are available from the current scope
13    |
14 LL |             let crate::Foo(x) = crate::my_mod::Foo(42);
-    |                                        ++++++++
+    |                                      ++++++++
16 
17 error[E0532]: cannot match against a tuple struct which contains private fields
18   --> $DIR/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs:12:17

28 help: the type can be constructed directly, because its fields are available from the current scope
29    |
30 LL |             let crate::my_mod::Foo(x) = crate::Foo(42);
-    |                        ++++++++
+    |                      ++++++++
32 
33 error: aborting due to 2 previous errors
34 
---
To only update this specific test, also pass `--test-args privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0423]: cannot initialize a tuple struct which contains private fields
##[error]  --> /checkout/tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs:12:33
   |
LL |             let crate::Foo(x) = crate::Foo(42);
   |                                 ^^^^^^^^^^
   |
note: the type is accessed through this re-export, but the type's constructor is not visible in this import's scope due to private fields
  --> /checkout/tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs:3:9
   |
LL | pub use my_mod::Foo;
   |         ^^^^^^^^^^^
help: the type can be constructed directly, because its fields are available from the current scope
   |
LL |             let crate::Foo(x) = crate::my_mod::Foo(42);
   |                                      ++++++++

error[E0532]: cannot match against a tuple struct which contains private fields
##[error]  --> /checkout/tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs:12:17
   |
LL |             let crate::Foo(x) = crate::Foo(42);
   |                 ^^^^^^^^^^
   |
note: the type is accessed through this re-export, but the type's constructor is not visible in this import's scope due to private fields
  --> /checkout/tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs:3:9
   |
LL | pub use my_mod::Foo;
   |         ^^^^^^^^^^^
help: the type can be constructed directly, because its fields are available from the current scope
   |
LL |             let crate::my_mod::Foo(x) = crate::Foo(42);
   |                      ++++++++

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0423, E0532.
---
To only update this specific test, also pass `--test-args resolve/resolve-conflict-extern-crate-vs-extern-crate.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0259]: the name `std` is defined multiple times
   |
   = note: `std` must be defined only once in the type namespace of this module
---
To only update this specific test, also pass `--test-args resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0425]: cannot find value `config` in this scope
##[error]  --> /checkout/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:7:16
   |
LL |     config: String,
   |     ------ a field by that name exists in `Self`
...
LL |         Self { config } //~ ERROR cannot find value `config` in this scope
   |                ^^^^^^ help: a local variable with a similar name exists: `cofig`

error[E0425]: cannot find value `config` in this scope
##[error]  --> /checkout/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:11:20
   |
LL |     config: String,
   |     ------ a field by that name exists in `Self`
...
LL |         println!("{config}"); //~ ERROR cannot find value `config` in this scope
   |                    ^^^^^^ help: a local variable with a similar name exists: `cofig`

error[E0425]: cannot find value `config` in this scope
##[error]  --> /checkout/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:15:20
   |
LL |         println!("{config}"); //~ ERROR cannot find value `config` in this scope
   |                    ^^^^^^ help: a local variable with a similar name exists: `cofig`
   |
   = help: you might have meant to use the available field in a format string: `"{}", self.config`

error[E0425]: cannot find value `bah` in this scope
##[error]  --> /checkout/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:33:9
   |
LL |         bah;
   |         ^^^
...
---

error[E0412]: cannot find type `Baz` in this scope
##[error]  --> /checkout/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:37:18
   |
LL |         let foo: Baz = "".to_string();
   |                  ^^^
...
LL | type Bar = String;
   | ------------------ similarly named type alias `Bar` defined here
   |
help: you might have meant to use the associated type
   |
LL |         let foo: Self::Baz = "".to_string();
   |                  ++++++
help: a type alias with a similar name exists
   |
LL -         let foo: Baz = "".to_string();
LL +         let foo: Bar = "".to_string();
   |

error[E0425]: cannot find function `baz` in this scope
##[error]  --> /checkout/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:31:9
   |
---
---- [ui] tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/self/arbitrary_self_types_not_allow_call_with_no_deref/arbitrary_self_types_not_allow_call_with_no_deref.stderr`
diff of stderr:

14 help: there is a method `frobnicate_cpp_ref` with a similar name
15    |
16 LL |     foo_cpp_ref.frobnicate_cpp_ref();
-    |                            ++++
+    |                           ++++
18 
19 error[E0599]: no method named `frobnicate_self` found for struct `CppRef<T>` in the current scope
20   --> $DIR/arbitrary_self_types_not_allow_call_with_no_deref.rs:32:17


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

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/self/arbitrary_self_types_not_allow_call_with_no_deref" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0599]: no method named `frobnicate_ref` found for struct `CppRef<T>` in the current scope
##[error]  --> /checkout/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.rs:29:17
   |
LL | struct CppRef<T>(T);
   | ---------------- method `frobnicate_ref` not found for this struct
...
LL |     foo_cpp_ref.frobnicate_ref();
   |                 ^^^^^^^^^^^^^^
   |
help: one of the expressions' fields has a method of the same name
   |
LL |     foo_cpp_ref.0.frobnicate_ref();
   |                 ++
help: there is a method `frobnicate_cpp_ref` with a similar name
   |
LL |     foo_cpp_ref.frobnicate_cpp_ref();
   |                           ++++

error[E0599]: no method named `frobnicate_self` found for struct `CppRef<T>` in the current scope
##[error]  --> /checkout/tests/ui/self/arbitrary_self_types_not_allow_call_with_no_deref.rs:32:17
   |
LL | struct CppRef<T>(T);
   | ---------------- method `frobnicate_self` not found for this struct
...
LL |     foo_cpp_ref.frobnicate_self(); // would desugar to `Foo::frobnicate_self(*foo_cpp_ref)`
   |                 ^^^^^^^^^^^^^^^
   |
help: one of the expressions' fields has a method of the same name
   |
LL |     foo_cpp_ref.0.frobnicate_self(); // would desugar to `Foo::frobnicate_self(*foo_cpp_ref)`
   |                 ++
help: there is a method `frobnicate_cpp_ref` with a similar name
   |
LL -     foo_cpp_ref.frobnicate_self(); // would desugar to `Foo::frobnicate_self(*foo_cpp_ref)`
LL +     foo_cpp_ref.frobnicate_cpp_ref(); // would desugar to `Foo::frobnicate_self(*foo_cpp_ref)`
   |

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0599`.
---
To only update this specific test, also pass `--test-args span/missing-unit-argument.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/span/missing-unit-argument.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/span/missing-unit-argument" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0061]: this enum variant takes 1 argument but 0 arguments were supplied
##[error]  --> /checkout/tests/ui/span/missing-unit-argument.rs:11:33
   |
LL |     let _: Result<(), String> = Ok(); //~ ERROR this enum variant takes
   |                                 ^^-- argument #1 of type `()` is missing
   |
note: tuple variant defined here
  --> /rustc/FAKE_PREFIX/library/core/src/result.rs:561:5
help: provide the argument
   |
LL |     let _: Result<(), String> = Ok(()); //~ ERROR this enum variant takes
   |                                    ++

error[E0061]: this function takes 2 arguments but 0 arguments were supplied
##[error]  --> /checkout/tests/ui/span/missing-unit-argument.rs:12:5
   |
LL |     foo(); //~ ERROR function takes
   |     ^^^-- two arguments of type `()` and `()` are missing
   |
note: function defined here
  --> /checkout/tests/ui/span/missing-unit-argument.rs:1:4
   |
LL | fn foo(():(), ():()) {}
   |    ^^^ -----  -----
help: provide the arguments
   |
LL |     foo((), ()); //~ ERROR function takes
   |         ++++++

error[E0061]: this function takes 2 arguments but 1 argument was supplied
##[error]  --> /checkout/tests/ui/span/missing-unit-argument.rs:13:5
   |
LL |     foo(()); //~ ERROR function takes
   |     ^^^---- argument #2 of type `()` is missing
   |
note: function defined here
  --> /checkout/tests/ui/span/missing-unit-argument.rs:1:4
   |
LL | fn foo(():(), ():()) {}
   |    ^^^        -----
help: provide the argument
   |
LL |     foo((), ()); //~ ERROR function takes
   |         +++

error[E0061]: this function takes 1 argument but 0 arguments were supplied
##[error]  --> /checkout/tests/ui/span/missing-unit-argument.rs:14:5
   |
LL |     bar(); //~ ERROR function takes
   |     ^^^-- argument #1 of type `()` is missing
   |
note: function defined here
  --> /checkout/tests/ui/span/missing-unit-argument.rs:2:4
   |
LL | fn bar(():()) {}
   |    ^^^ -----
help: provide the argument
   |
LL |     bar(()); //~ ERROR function takes
   |         ++

error[E0061]: this method takes 1 argument but 0 arguments were supplied
##[error]  --> /checkout/tests/ui/span/missing-unit-argument.rs:15:7
   |
LL |     S.baz(); //~ ERROR this method takes
   |       ^^^-- argument #1 of type `()` is missing
   |
note: method defined here
  --> /checkout/tests/ui/span/missing-unit-argument.rs:6:8
   |
LL |     fn baz(self, (): ()) { }
   |        ^^^       ------
help: provide the argument
   |
LL |     S.baz(()); //~ ERROR this method takes
   |           ++

error[E0061]: this method takes 1 argument but 0 arguments were supplied
##[error]  --> /checkout/tests/ui/span/missing-unit-argument.rs:16:7
   |
LL |     S.generic::<()>(); //~ ERROR this method takes
   |       ^^^^^^^^^^^^^-- argument #1 of type `()` is missing
   |
note: method defined here
  --> /checkout/tests/ui/span/missing-unit-argument.rs:7:8
   |
LL |     fn generic<T>(self, _: T) { }
   |        ^^^^^^^          ----
help: provide the argument
   |
LL |     S.generic::<()>(()); //~ ERROR this method takes
   |                     ++

error: aborting due to 6 previous errors

For more information about this error, try `rustc --explain E0061`.
---
To only update this specific test, also pass `--test-args structs/struct-fields-hints-no-dupe.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/structs/struct-fields-hints-no-dupe.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/structs/struct-fields-hints-no-dupe" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0560]: struct `A` has no field named `bar`
##[error]  --> /checkout/tests/ui/structs/struct-fields-hints-no-dupe.rs:10:9
   |
---
To only update this specific test, also pass `--test-args test-attrs/inaccessible-test-modules.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/test-attrs/inaccessible-test-modules.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/test-attrs/inaccessible-test-modules" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--test"
stdout: none
--- stderr -------------------------------
error[E0432]: unresolved import `main`
##[error]  --> /checkout/tests/ui/test-attrs/inaccessible-test-modules.rs:5:5
   |
LL | use main as x; //~ ERROR unresolved import `main`
   |     ^^^^^^^^^ no `main` in the root

error[E0432]: unresolved import `test`
##[error]  --> /checkout/tests/ui/test-attrs/inaccessible-test-modules.rs:6:5
   |
LL | use test as y; //~ ERROR unresolved import `test`
   |     ^^^^^^^^^ no `test` in the root
   |
help: consider importing this module instead
   |
LL | use test::test as y; //~ ERROR unresolved import `test`
   |     ++++++

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0432`.
---
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/typeck/issue-13853-5/issue-13853-5.stderr`
diff of stderr:

25    |
26 LL |     fn deserialize_token<D: Deserializer<'a>>(_x: D, _y: &'a str) -> &'a str {
27 LL ~         _y
- LL ~
29    |
30 
31 error: aborting due to 3 previous errors


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

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/typeck/issue-13853-5.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/typeck/issue-13853-5" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0195]: lifetime parameters or bounds on associated function `deserialize_token` do not match the trait declaration
##[error]  --> /checkout/tests/ui/typeck/issue-13853-5.rs:9:25
   |
LL |     fn deserialize_token<'a, D: Deserializer<'a>>(_: D, _: &'a str) -> Self;
   |                         ------------------------- lifetimes in impl do not match this associated function in trait
...
LL |     fn deserialize_token<D: Deserializer<'a>>(_x: D, _y: &'a str) -> &'a str {
   |                         ^^^^^^^^^^^^^^^^^^^^^ lifetimes do not match associated function in trait

error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
##[error]  --> /checkout/tests/ui/typeck/issue-13853-5.rs:7:10
   |
LL | impl<'a, T: Deserializable> Deserializable for &'a str {
   |          ^ unconstrained type parameter

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/typeck/issue-13853-5.rs:9:70
   |
LL |     fn deserialize_token<D: Deserializer<'a>>(_x: D, _y: &'a str) -> &'a str {
   |        -----------------                                             ^^^^^^^ expected `&str`, found `()`
   |        |
   |        implicitly returns `()` as its body has no tail or `return` expression
   |
help: consider returning the local binding `_y`
   |
LL |     fn deserialize_token<D: Deserializer<'a>>(_x: D, _y: &'a str) -> &'a str {
LL ~         _y
   |

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0195, E0207, E0308.

Comment on lines 10 to +11
LL | extern crate std as other_std;
| ++++++++++++
| +++++++++++++
Copy link
Member

Choose a reason for hiding this comment

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

This is like the linked issue but "from the other direction". So you just relocated the issue basically regressing this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, in this case the compiler suggests prepending "std as other_" to std to be "std as other_std", instead of appending "as other_std". Both result in same phrase. It's not a regression.

@osamakader
Copy link
Contributor Author

Redundant with #148061

I didn't know that there is another draft PR for that issue, please let me know whether I should close this one or improve 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.

Wrong highlighting in E0432 when import and suggestion share prefix

5 participants