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

Deduplicate some error+lint diagnostic structs #132164

Closed
wants to merge 2 commits into from

Conversation

fmease
Copy link
Member

@fmease fmease commented Oct 25, 2024

The first commit consolidates pairs of diagnostic structs that essentially represent the same diagnostic but were separated because one "cannot really" derive both Diagnostic and LintDiagnostic at the same time. Well, it's possible but only if you don't use #[primary_span] (see #125169). So, in this PR we don't (and use Diag::with_span in the non-lint case) contrary to 775527e from #125208.

Deduplicates: TyParamFirstLocal{,Lint}, TyParamSome{,Lint}, SelfCtorFromOuterItem{,Lint}, ConflictingRepr{,Lint}.
Doesn't deduplicate BuiltinEllipsisInclusiveRangePatterns{,Lint} because it looks a bit more involved (tho I haven't really tried).

The second commit isn't really serious. I should probably just drop it, it's not worth it (DRY fallacy).


This PR is a vibes check, I'm fine with closing it if you don't like it.

@fmease fmease added the C-cleanup Category: PRs that clean code up or issues documenting cleanup. label Oct 25, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 25, 2024

r? @petrochenkov

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

Use r? to explicitly pick a reviewer

@rustbot rustbot added 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 Oct 25, 2024
@fmease fmease force-pushed the dedup-err-lint-diags branch from a7aee53 to 1523b04 Compare October 25, 2024 23:31
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
------
 > importing cache manifest from ghcr.io/rust-lang/rust-ci-cache:c32c805632780b5c1de330e3f44561b336c2efe163bc0990acb392390157a8e1d9f855d75914a239aa40c49d77f4a837247d05d2f8d46f554b98e1f46712a3e3:
------
##[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-18]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
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-18', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--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', '--set', 'rust.lld=false', '--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-18/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
diff of stderr:

2   --> $DIR/coherence-all-remote.rs:6:6
3    |
4 LL | impl<T> Remote1<T> for isize { }
-    |      ^ type parameter `T` must be used as the type parameter for some local type
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
8    = note: only traits defined in the current crate can be implemented for a type parameter



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 coherence/coherence-all-remote.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/coherence/coherence-all-remote.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/coherence/coherence-all-remote" "-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/coherence/coherence-all-remote/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
   |
   |
LL | impl<T> Remote1<T> for isize { }
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter

---
diff of stderr:

2   --> $DIR/coherence-bigint-param.rs:8:6
3    |
4 LL | impl<T> Remote1<BigInt> for T { }
-    |      ^ type parameter `T` must be covered by another type when it appears before the first local type (`BigInt`)
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
8    = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last

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 coherence/coherence-bigint-param.rs`
To only update this specific test, also pass `--test-args coherence/coherence-bigint-param.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/coherence/coherence-bigint-param.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/coherence/coherence-bigint-param" "-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/coherence/coherence-bigint-param/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`BigInt`)
   |
   |
LL | impl<T> Remote1<BigInt> for T { }
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last
error: aborting due to 1 previous error

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

2   --> $DIR/coherence-cross-crate-conflict.rs:9:6
3    |
4 LL | impl<A> Foo for A {
-    |      ^ type parameter `A` must be used as the type parameter for some local type
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
8    = note: only traits defined in the current crate can be implemented for a type parameter



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 coherence/coherence-cross-crate-conflict.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/coherence/coherence-cross-crate-conflict.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/coherence/coherence-cross-crate-conflict" "-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/coherence/coherence-cross-crate-conflict/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `A` must be used as the type parameter for some local type (e.g., `MyStruct<A>`)
   |
   |
LL | impl<A> Foo for A { //~ ERROR E0210
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter

---
To only update this specific test, also pass `--test-args coherence/coherence-lone-type-parameter.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/coherence/coherence-lone-type-parameter.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/coherence/coherence-lone-type-parameter" "-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/coherence/coherence-lone-type-parameter/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
   |
LL | impl<T> Remote for T { }
   |      ^
   |
---
------------------------------------------


---- [ui] tests/ui/coherence/impl[t]-foreign[foreign]-for-fundamental[t].rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/coherence/impl[t]-foreign[foreign]-for-fundamental[t]/impl[t]-foreign[foreign]-for-fundamental[t].stderr"

2   --> $DIR/impl[t]-foreign[foreign]-for-fundamental[t].rs:10:6
3    |
3    |
4 LL | impl<T> Remote1<u32> for Box<T> {
-    |      ^ type parameter `T` must be used as the type parameter for some local type
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
8    = note: only traits defined in the current crate can be implemented for a type parameter


11   --> $DIR/impl[t]-foreign[foreign]-for-fundamental[t].rs:14:10
12    |
13 LL | impl<'a, T> Remote1<u32> for &'a T {
-    |          ^ type parameter `T` must be used as the type parameter for some local type
15    |
16    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
17    = note: only traits defined in the current crate can be implemented for a type parameter



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 coherence/impl[t]-foreign[foreign]-for-fundamental[t].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/coherence/impl[t]-foreign[foreign]-for-fundamental[t].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/coherence/impl[t]-foreign[foreign]-for-fundamental[t]" "-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/coherence/impl[t]-foreign[foreign]-for-fundamental[t]/auxiliary" "--crate-name=test"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
##[error]  --> /checkout/tests/ui/coherence/impl[t]-foreign[foreign]-for-fundamental[t].rs:10:6
   |
LL | impl<T> Remote1<u32> for Box<T> {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter


error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
##[error]  --> /checkout/tests/ui/coherence/impl[t]-foreign[foreign]-for-fundamental[t].rs:14:10
   |
LL | impl<'a, T> Remote1<u32> for &'a T {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter


error: aborting due to 2 previous errors

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


---- [ui] tests/ui/coherence/impl[t]-foreign-for-fundamental[t].rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/coherence/impl[t]-foreign-for-fundamental[t]/impl[t]-foreign-for-fundamental[t].stderr"

2   --> $DIR/impl[t]-foreign-for-fundamental[t].rs:10:6
3    |
4 LL | impl<T> Remote for Box<T> {
---
To only update this specific test, also pass `--test-args coherence/impl[t]-foreign-for-fundamental[t].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/coherence/impl[t]-foreign-for-fundamental[t].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/coherence/impl[t]-foreign-for-fundamental[t]" "-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/coherence/impl[t]-foreign-for-fundamental[t]/auxiliary" "--crate-name=test"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
##[error]  --> /checkout/tests/ui/coherence/impl[t]-foreign-for-fundamental[t].rs:10:6
LL | impl<T> Remote for Box<T> {
   |      ^
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
---
------------------------------------------


---- [ui] tests/ui/coherence/impl[t]-foreign[foreign]-for-t.rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/coherence/impl[t]-foreign[foreign]-for-t/impl[t]-foreign[foreign]-for-t.stderr"

2   --> $DIR/impl[t]-foreign[foreign]-for-t.rs:10:6
3    |
3    |
4 LL | impl<T> Remote1<u32> for T {
-    |      ^ type parameter `T` must be used as the type parameter for some local type
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
8    = note: only traits defined in the current crate can be implemented for a type parameter



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 coherence/impl[t]-foreign[foreign]-for-t.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/coherence/impl[t]-foreign[foreign]-for-t.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/coherence/impl[t]-foreign[foreign]-for-t" "-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/coherence/impl[t]-foreign[foreign]-for-t/auxiliary" "--crate-name=test"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
   |
   |
LL | impl<T> Remote1<u32> for T {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter

---
diff of stderr:

2   --> $DIR/impl[t]-foreign[fundamental[t]]-for-foreign.rs:10:6
3    |
4 LL | impl<T> Remote1<Box<T>> for u32 {
-    |      ^ type parameter `T` must be used as the type parameter for some local type
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
8    = note: only traits defined in the current crate can be implemented for a type parameter


11   --> $DIR/impl[t]-foreign[fundamental[t]]-for-foreign.rs:14:10
12    |
13 LL | impl<'a, T> Remote1<&'a T> for u32 {
-    |          ^ type parameter `T` must be used as the type parameter for some local type
15    |
16    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
17    = note: only traits defined in the current crate can be implemented for a type parameter



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 coherence/impl[t]-foreign[fundamental[t]]-for-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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coherence/impl[t]-foreign[fundamental[t]]-for-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/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/coherence/impl[t]-foreign[fundamental[t]]-for-foreign" "-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/coherence/impl[t]-foreign[fundamental[t]]-for-foreign/auxiliary" "--crate-name=test"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
   |
   |
LL | impl<T> Remote1<Box<T>> for u32 {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter


error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
   |
   |
LL | impl<'a, T> Remote1<&'a T> for u32 {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter


error: aborting due to 2 previous errors

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


---- [ui] tests/ui/coherence/impl[t]-foreign[fundamental[t]]-for-fundamental[t].rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-fundamental[t]/impl[t]-foreign[fundamental[t]]-for-fundamental[t].stderr"

2   --> $DIR/impl[t]-foreign[fundamental[t]]-for-fundamental[t].rs:10:10
3    |
3    |
4 LL | impl<'a, T> Remote1<Box<T>> for &'a T {
-    |          ^ type parameter `T` must be used as the type parameter for some local type
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
8    = note: only traits defined in the current crate can be implemented for a type parameter


11   --> $DIR/impl[t]-foreign[fundamental[t]]-for-fundamental[t].rs:13:10
12    |
13 LL | impl<'a, T> Remote1<&'a T> for Box<T> {
-    |          ^ type parameter `T` must be used as the type parameter for some local type
15    |
16    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
17    = note: only traits defined in the current crate can be implemented for a type parameter



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 coherence/impl[t]-foreign[fundamental[t]]-for-fundamental[t].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/coherence/impl[t]-foreign[fundamental[t]]-for-fundamental[t].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/coherence/impl[t]-foreign[fundamental[t]]-for-fundamental[t]" "-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/coherence/impl[t]-foreign[fundamental[t]]-for-fundamental[t]/auxiliary" "--crate-name=test"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
##[error]  --> /checkout/tests/ui/coherence/impl[t]-foreign[fundamental[t]]-for-fundamental[t].rs:10:10
   |
LL | impl<'a, T> Remote1<Box<T>> for &'a T {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter


error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
##[error]  --> /checkout/tests/ui/coherence/impl[t]-foreign[fundamental[t]]-for-fundamental[t].rs:13:10
   |
LL | impl<'a, T> Remote1<&'a T> for Box<T> {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter


error: aborting due to 2 previous errors

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


---- [ui] tests/ui/coherence/impl[t]-foreign[fundamental[t]]-for-t.rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-t/impl[t]-foreign[fundamental[t]]-for-t.stderr"

2   --> $DIR/impl[t]-foreign[fundamental[t]]-for-t.rs:10:6
3    |
3    |
4 LL | impl<T> Remote1<Box<T>> for T {
-    |      ^ type parameter `T` must be used as the type parameter for some local type
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
8    = note: only traits defined in the current crate can be implemented for a type parameter


11   --> $DIR/impl[t]-foreign[fundamental[t]]-for-t.rs:13:10
12    |
13 LL | impl<'a, T> Remote1<&'a T> for T {
-    |          ^ type parameter `T` must be used as the type parameter for some local type
15    |
16    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
17    = note: only traits defined in the current crate can be implemented for a type parameter



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 coherence/impl[t]-foreign[fundamental[t]]-for-t.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/coherence/impl[t]-foreign[fundamental[t]]-for-t.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/coherence/impl[t]-foreign[fundamental[t]]-for-t" "-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/coherence/impl[t]-foreign[fundamental[t]]-for-t/auxiliary" "--crate-name=test"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
   |
   |
LL | impl<T> Remote1<Box<T>> for T {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter


error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
   |
   |
LL | impl<'a, T> Remote1<&'a T> for T {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter

---
diff of stderr:

2   --> $DIR/impl[t]-foreign[fundamental[t]_local]-for-foreign.rs:10:6
3    |
4 LL | impl<T> Remote2<Box<T>, Local> for u32 {
-    |      ^ type parameter `T` must be covered by another type when it appears before the first local type (`Local`)
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
8    = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last
11   --> $DIR/impl[t]-foreign[fundamental[t]_local]-for-foreign.rs:14:10
12    |
12    |
13 LL | impl<'a, T> Remote2<&'a T, Local> for u32 {
-    |          ^ type parameter `T` must be covered by another type when it appears before the first local type (`Local`)
15    |
16    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
16    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
17    = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last

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 coherence/impl[t]-foreign[fundamental[t]_local]-for-foreign.rs`
To only update this specific test, also pass `--test-args coherence/impl[t]-foreign[fundamental[t]_local]-for-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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coherence/impl[t]-foreign[fundamental[t]_local]-for-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/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/coherence/impl[t]-foreign[fundamental[t]_local]-for-foreign" "-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/coherence/impl[t]-foreign[fundamental[t]_local]-for-foreign/auxiliary" "--crate-name=test"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Local`)
   |
   |
LL | impl<T> Remote2<Box<T>, Local> for u32 {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last

error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Local`)
   |
   |
LL | impl<'a, T> Remote2<&'a T, Local> for u32 {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last
error: aborting due to 2 previous errors

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

2   --> $DIR/impl[t]-foreign[t]-for-foreign.rs:10:6
3    |
4 LL | impl<T> Remote1<T> for u32 {
-    |      ^ type parameter `T` must be used as the type parameter for some local type
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
8    = note: only traits defined in the current crate can be implemented for a type parameter



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 coherence/impl[t]-foreign[t]-for-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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coherence/impl[t]-foreign[t]-for-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/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/coherence/impl[t]-foreign[t]-for-foreign" "-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/coherence/impl[t]-foreign[t]-for-foreign/auxiliary" "--crate-name=test"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
   |
   |
LL | impl<T> Remote1<T> for u32 {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter

---
diff of stderr:

2   --> $DIR/impl[t]-foreign[t]-for-fundamental.rs:10:6
3    |
4 LL | impl<T> Remote1<T> for Box<T> {
-    |      ^ type parameter `T` must be used as the type parameter for some local type
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
8    = note: only traits defined in the current crate can be implemented for a type parameter


11   --> $DIR/impl[t]-foreign[t]-for-fundamental.rs:14:13
12    |
13 LL | impl<'a, A, B> Remote1<A> for &'a B {
-    |             ^ type parameter `B` must be used as the type parameter for some local type
15    |
16    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
17    = note: only traits defined in the current crate can be implemented for a type parameter



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 coherence/impl[t]-foreign[t]-for-fundamental.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/coherence/impl[t]-foreign[t]-for-fundamental.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/coherence/impl[t]-foreign[t]-for-fundamental" "-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/coherence/impl[t]-foreign[t]-for-fundamental/auxiliary" "--crate-name=test"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
   |
   |
LL | impl<T> Remote1<T> for Box<T> {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter


error[E0210]: type parameter `B` must be used as the type parameter for some local type (e.g., `MyStruct<B>`)
   |
   |
LL | impl<'a, A, B> Remote1<A> for &'a B {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter


error: aborting due to 2 previous errors

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


---- [ui] tests/ui/coherence/impl[t]-foreign[local]-for-fundamental[t].rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/coherence/impl[t]-foreign[local]-for-fundamental[t]/impl[t]-foreign[local]-for-fundamental[t].stderr"

2   --> $DIR/impl[t]-foreign[local]-for-fundamental[t].rs:10:6
3    |
3    |
4 LL | impl<T> Remote1<Local> for Box<T> {
-    |      ^ type parameter `T` must be covered by another type when it appears before the first local type (`Local`)
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
8    = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last
11   --> $DIR/impl[t]-foreign[local]-for-fundamental[t].rs:14:6
12    |
12    |
13 LL | impl<T> Remote1<Local> for &T {
-    |      ^ type parameter `T` must be covered by another type when it appears before the first local type (`Local`)
15    |
16    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
16    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
17    = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last

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 coherence/impl[t]-foreign[local]-for-fundamental[t].rs`
To only update this specific test, also pass `--test-args coherence/impl[t]-foreign[local]-for-fundamental[t].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/coherence/impl[t]-foreign[local]-for-fundamental[t].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/coherence/impl[t]-foreign[local]-for-fundamental[t]" "-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/coherence/impl[t]-foreign[local]-for-fundamental[t]/auxiliary" "--crate-name=test"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Local`)
##[error]  --> /checkout/tests/ui/coherence/impl[t]-foreign[local]-for-fundamental[t].rs:10:6
   |
LL | impl<T> Remote1<Local> for Box<T> {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last

error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Local`)
##[error]  --> /checkout/tests/ui/coherence/impl[t]-foreign[local]-for-fundamental[t].rs:14:6
   |
LL | impl<T> Remote1<Local> for &T {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last
error: aborting due to 2 previous errors

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


---- [ui] tests/ui/coherence/impl[t]-foreign[t]-for-t.rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/coherence/impl[t]-foreign[t]-for-t/impl[t]-foreign[t]-for-t.stderr"

2   --> $DIR/impl[t]-foreign[t]-for-t.rs:10:6
3    |
3    |
4 LL | impl<T> Remote1<T> for T {
-    |      ^ type parameter `T` must be used as the type parameter for some local type
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
8    = note: only traits defined in the current crate can be implemented for a type parameter



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 coherence/impl[t]-foreign[t]-for-t.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/coherence/impl[t]-foreign[t]-for-t.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/coherence/impl[t]-foreign[t]-for-t" "-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/coherence/impl[t]-foreign[t]-for-t/auxiliary" "--crate-name=test"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
   |
   |
LL | impl<T> Remote1<T> for T {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter


error: aborting due to 1 previous error

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


---- [ui] tests/ui/coherence/impl[t]-foreign[local]-for-t.rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/coherence/impl[t]-foreign[local]-for-t/impl[t]-foreign[local]-for-t.stderr"

2   --> $DIR/impl[t]-foreign[local]-for-t.rs:10:6
3    |
3    |
4 LL | impl<T> Remote1<Local> for T {
-    |      ^ type parameter `T` must be covered by another type when it appears before the first local type (`Local`)
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
8    = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last

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 coherence/impl[t]-foreign[local]-for-t.rs`
To only update this specific test, also pass `--test-args coherence/impl[t]-foreign[local]-for-t.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/coherence/impl[t]-foreign[local]-for-t.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/coherence/impl[t]-foreign[local]-for-t" "-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/coherence/impl[t]-foreign[local]-for-t/auxiliary" "--crate-name=test"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Local`)
   |
   |
LL | impl<T> Remote1<Local> for T {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last
error: aborting due to 1 previous error

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

2   --> $DIR/orphan-check-diagnostics.rs:11:6
3    |
4 LL | impl<T> RemoteTrait for T where T: LocalTrait {}
-    |      ^ type parameter `T` must be used as the type parameter for some local type
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
8    = note: only traits defined in the current crate can be implemented for a type parameter



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 coherence/orphan-check-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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coherence/orphan-check-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/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/coherence/orphan-check-diagnostics" "-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/coherence/orphan-check-diagnostics/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
   |
   |
LL | impl<T> RemoteTrait for T where T: LocalTrait {}
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter

---
diff of stderr:

2   --> $DIR/orphan-check-opaque-types-not-covering.rs:14:6
3    |
4 LL | impl<T> foreign::Trait0<Local, T, ()> for Identity<T> {}
-    |      ^ type parameter `T` must be covered by another type when it appears before the first local type (`Local`)
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
8    = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last
11   --> $DIR/orphan-check-opaque-types-not-covering.rs:23:6
12    |
12    |
13 LL | impl<T> foreign::Trait1<Local, T> for Opaque<T> {}
-    |      ^ type parameter `T` must be covered by another type when it appears before the first local type (`Local`)
15    |
16    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
16    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
17    = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last

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 coherence/orphan-check-opaque-types-not-covering.rs`
To only update this specific test, also pass `--test-args coherence/orphan-check-opaque-types-not-covering.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/coherence/orphan-check-opaque-types-not-covering.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/coherence/orphan-check-opaque-types-not-covering" "-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/coherence/orphan-check-opaque-types-not-covering/auxiliary" "--edition=2021" "--extern" "foreign=/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/coherence/orphan-check-opaque-types-not-covering/auxiliary/libparametrized_trait.so"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Local`)
   |
   |
LL | impl<T> foreign::Trait0<Local, T, ()> for Identity<T> {}
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last

error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Local`)
   |
   |
LL | impl<T> foreign::Trait1<Local, T> for Opaque<T> {}
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last
error: aborting due to 2 previous errors

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

2   --> $DIR/orphan-check-weak-aliases-not-covering.rs:13:6
3    |
4 LL | impl<T> foreign::Trait1<Local, T> for Identity<T> {}
-    |      ^ type parameter `T` must be covered by another type when it appears before the first local type (`Local`)
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
8    = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last

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 coherence/orphan-check-weak-aliases-not-covering.rs`
To only update this specific test, also pass `--test-args coherence/orphan-check-weak-aliases-not-covering.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/coherence/orphan-check-weak-aliases-not-covering.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/coherence/orphan-check-weak-aliases-not-covering" "-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/coherence/orphan-check-weak-aliases-not-covering/auxiliary" "--edition=2021" "--extern" "foreign=/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/coherence/orphan-check-weak-aliases-not-covering/auxiliary/libparametrized_trait.so"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Local`)
   |
   |
LL | impl<T> foreign::Trait1<Local, T> for Identity<T> {}
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
   = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last
error: aborting due to 1 previous error

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

2   --> $DIR/issue-28981.rs:5:6
3    |
4 LL | impl<Foo> Deref for Foo { }
-    |      ^^^ type parameter `Foo` must be used as the type parameter for some local type
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
8    = note: only traits defined in the current crate can be implemented for a type parameter



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 error-codes/e0119/issue-28981.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/error-codes/e0119/issue-28981.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/error-codes/e0119/issue-28981" "-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/error-codes/e0119/issue-28981/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `Foo` must be used as the type parameter for some local type (e.g., `MyStruct<Foo>`)
   |
   |
LL | impl<Foo> Deref for Foo { } //~ ERROR must be used
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter

---
diff of stderr:

2   --> $DIR/issue-41974.rs:7:6
3    |
4 LL | impl<T> Drop for T where T: A {
-    |      ^ type parameter `T` must be used as the type parameter for some local type
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
8    = note: only traits defined in the current crate can be implemented for a type parameter



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 issues/issue-41974.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/issues/issue-41974.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-41974" "-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-41974/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
   |
   |
LL | impl<T> Drop for T where T: A {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter


error[E0120]: the `Drop` trait may only be implemented for local structs, enums, and unions
   |
   |
LL | impl<T> Drop for T where T: A {
   |                  ^ must be a struct, enum, or union in the current crate
error: aborting due to 2 previous errors

Some errors have detailed explanations: E0120, E0210.
For more information about an error, try `rustc --explain E0120`.
---

1 error[E0401]: can't reference `Self` constructor from outer item
2   --> $DIR/do-not-ice-on-note_and_explain.rs:6:13
3    |
- LL | impl<B> A<B> {
-    | ------------ the inner item doesn't inherit generics from this impl, so `Self` is invalid to reference
7 LL |             Self(1)
8    |             ^^^^ help: replace `Self` with the actual type: `A`
9 



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 malformed/do-not-ice-on-note_and_explain.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/malformed/do-not-ice-on-note_and_explain.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/malformed/do-not-ice-on-note_and_explain" "-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/malformed/do-not-ice-on-note_and_explain/auxiliary"
--- stderr -------------------------------
error[E0401]: can't reference `Self` constructor from outer item
##[error]  --> /checkout/tests/ui/malformed/do-not-ice-on-note_and_explain.rs:6:13
   |
---
3    |
- LL | impl<T> S0<T> {
-    | ------------- the inner item doesn't inherit generics from this impl, so `Self` is invalid to reference
- LL |     fn foo() {
7 LL |         const C: S0<i32> = Self(0);
8    |                            ^^^^ help: replace `Self` with the actual type: `S0`

10 error[E0401]: can't reference `Self` constructor from outer item
11   --> $DIR/self-ctor.rs:8:13
12    |
---
To only update this specific test, also pass `--test-args self/self-ctor.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/self/self-ctor.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/self/self-ctor" "-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/self/self-ctor/auxiliary"
--- stderr -------------------------------
error[E0401]: can't reference `Self` constructor from outer item
##[error]  --> /checkout/tests/ui/self/self-ctor.rs:5:28
   |
   |
LL |         const C: S0<i32> = Self(0);
   |                            ^^^^ help: replace `Self` with the actual type: `S0`
error[E0401]: can't reference `Self` constructor from outer item
##[error]  --> /checkout/tests/ui/self/self-ctor.rs:8:13
   |
LL |             Self(0)
---
------------------------------------------


---- [ui] tests/ui/specialization/issue-43037.rs#current stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/specialization/issue-43037.current/issue-43037.current.stderr"

2   --> $DIR/issue-43037.rs:19:6
3    |
3    |
4 LL | impl<T> From<<A<T> as Z>::Assoc> for T {}
-    |      ^ type parameter `T` must be used as the type parameter for some local type
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
8    = note: only traits defined in the current crate can be implemented for a type parameter



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 specialization/issue-43037.rs`

error in revision `current`: 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/specialization/issue-43037.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" "current" "--check-cfg" "cfg(FALSE,current,negative)" "--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/specialization/issue-43037.current" "-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/specialization/issue-43037.current/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
   |
   |
LL | impl<T> From<<A<T> as Z>::Assoc> for T {}
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter


error: aborting due to 1 previous error

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


---- [ui] tests/ui/specialization/issue-43037.rs#negative stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/specialization/issue-43037.negative/issue-43037.negative.stderr"

2   --> $DIR/issue-43037.rs:19:6
3    |
3    |
4 LL | impl<T> From<<A<T> as Z>::Assoc> for T {}
-    |      ^ type parameter `T` must be used as the type parameter for some local type
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
8    = note: only traits defined in the current crate can be implemented for a type parameter



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 specialization/issue-43037.rs`

error in revision `negative`: 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/specialization/issue-43037.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" "negative" "--check-cfg" "cfg(FALSE,current,negative)" "--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/specialization/issue-43037.negative" "-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/specialization/issue-43037.negative/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
   |
   |
LL | impl<T> From<<A<T> as Z>::Assoc> for T {}
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter

---
diff of stderr:

11   --> $DIR/generics-default-stability-where.rs:7:6
12    |
13 LL | impl<T> Trait3<usize> for T where T: Trait2<usize> {
-    |      ^ type parameter `T` must be used as the type parameter for some local type
15    |
16    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
17    = note: only traits defined in the current crate can be implemented for a type parameter



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 stability-attribute/generics-default-stability-where.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/stability-attribute/generics-default-stability-where.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/stability-attribute/generics-default-stability-where" "-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/stability-attribute/generics-default-stability-where/auxiliary"
--- stderr -------------------------------
error[E0658]: use of unstable library feature 'unstable_default'
##[error]  --> /checkout/tests/ui/stability-attribute/generics-default-stability-where.rs:7:45
   |
   |
LL | impl<T> Trait3<usize> for T where T: Trait2<usize> { //~ ERROR use of unstable library feature 'unstable_default'
   |
   = help: add `#![feature(unstable_default)]` to the crate attributes to enable
   = help: add `#![feature(unstable_default)]` 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[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
   |
   |
LL | impl<T> Trait3<usize> for T where T: Trait2<usize> { //~ ERROR use of unstable library feature 'unstable_default'
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter

---
To only update this specific test, also pass `--test-args traits/const-traits/ice-119717-constant-lifetime.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/traits/const-traits/ice-119717-constant-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/traits/const-traits/ice-119717-constant-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/traits/const-traits/ice-119717-constant-lifetime/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error: using `#![feature(effects)]` without enabling next trait solver globally
   = note: the next trait solver must be enabled globally for the effects feature to work correctly
   = help: use `-Znext-solver` to enable


error: const `impl` for trait `FromResidual` which is not marked with `#[const_trait]`
   |
LL | impl<T> const FromResidual for T {
   |               ^^^^^^^^^^^^
   |
   |
   = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const`
   = note: adding a non-const method body in the future would be a breaking change

error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
   |
LL | impl<T> const FromResidual for T {
   |      ^
   |
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter

error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
##[error]  --> /checkout/tests/ui/traits/const-traits/ice-119717-constant-lifetime.rs:9:31
   |
LL |     fn from_residual(t: T) -> _ {
   |
help: try replacing `_` with the type in the corresponding trait method signature
   |
LL |     fn from_residual(t: T) -> T {
---
diff of stderr:

2   --> $DIR/incoherent-assoc-imp-trait.rs:10:6
3    |
4 LL | impl<F> FnOnce<()> for &F {
-    |      ^ type parameter `F` must be used as the type parameter for some local type
6    |
7    = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
8    = note: only traits defined in the current crate can be implemented for a type parameter



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 type-alias-impl-trait/incoherent-assoc-imp-trait.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/type-alias-impl-trait/incoherent-assoc-imp-trait.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/type-alias-impl-trait/incoherent-assoc-imp-trait" "-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/type-alias-impl-trait/incoherent-assoc-imp-trait/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0210]: type parameter `F` must be used as the type parameter for some local type (e.g., `MyStruct<F>`)
   |
   |
LL | impl<F> FnOnce<()> for &F {
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter

@fmease
Copy link
Member Author

fmease commented Oct 26, 2024

Nvm, this affects the primary span / label span. I think I know why

@fmease fmease closed this Oct 26, 2024
@fmease fmease deleted the dedup-err-lint-diags branch October 26, 2024 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants