Skip to content

TypeId implements_trait#151236

Closed
coolcatcoder wants to merge 2 commits intorust-lang:mainfrom
coolcatcoder:type_id_implements_trait
Closed

TypeId implements_trait#151236
coolcatcoder wants to merge 2 commits intorust-lang:mainfrom
coolcatcoder:type_id_implements_trait

Conversation

@coolcatcoder
Copy link

@coolcatcoder coolcatcoder commented Jan 17, 2026

This is for #146922.

It allows checking if a TypeId implements a trait.

(I've never used git from the terminal before, so that was a fun challenge. I hope I did everything correctly.)
(I haven't added any tests yet, I'll do that soon.)
(Zulip.)

@rustbot
Copy link
Collaborator

rustbot commented Jan 17, 2026

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

The reflection data structures are tied exactly to the implementation
in the compiler. Make sure to also adjust rustc_const_eval/src/const_eval/type_info.rs

cc @oli-obk

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 17, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 17, 2026

r? @chenyukang

rustbot has assigned @chenyukang.
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

@coolcatcoder
Copy link
Author

Also, because this pull request is pretty much just copying and pasting from vtable_for's implementation, should we de-duplicate the code by putting the implementation in one location that both intrinsics can call?

@rust-log-analyzer

This comment has been minimized.

@xonx4l
Copy link
Contributor

xonx4l commented Jan 17, 2026

Also, because this pull request is pretty much just copying and pasting from vtable_for's implementation, should we de-duplicate the code by putting the implementation in one location that both intrinsics can call?

Sure , This way it's easier to maintain.

@rustbot
Copy link
Collaborator

rustbot commented Jan 17, 2026

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

@SpriteOvO SpriteOvO added the F-type_info #![feature(type_info)] label Jan 17, 2026
@rustbot

This comment was marked as outdated.

@rustbot rustbot added O-unix Operating system: Unix-like T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Jan 17, 2026
@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 17, 2026
@coolcatcoder

This comment was marked as off-topic.

@coolcatcoder

This comment was marked as off-topic.

@coolcatcoder

This comment was marked as off-topic.

@coolcatcoder

This comment was marked as off-topic.

@SpriteOvO

This comment was marked as off-topic.

@coolcatcoder

This comment was marked as off-topic.

@SpriteOvO SpriteOvO force-pushed the type_id_implements_trait branch from f603826 to 2f97f63 Compare January 17, 2026 11:13
@rustbot rustbot removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. has-merge-commits PR has merge commits, merge with caution. labels Jan 17, 2026
@coolcatcoder
Copy link
Author

I know I need to update the 32 bit dump, but I'm not sure how.
If required I could try get the test running on my gps, but I'm hopeful there is an easier way.

@oli-obk
Copy link
Contributor

oli-obk commented Jan 30, 2026

You can cross compile tests to a 32 bit target. For me "i686-unknown-linux-gnu" works

@rust-bors

This comment has been minimized.

@coolcatcoder coolcatcoder force-pushed the type_id_implements_trait branch from 0dbd632 to d6a43ab Compare February 2, 2026 04:37
@rustbot
Copy link
Collaborator

rustbot commented Feb 2, 2026

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

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

@rustbot
Copy link
Collaborator

rustbot commented Feb 2, 2026

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred in need_type_info.rs

cc @lcnr

HIR ty lowering was modified

cc @fmease

⚠️ #[rustc_allow_const_fn_unstable] needs careful audit to avoid accidentally exposing unstable
implementation details on stable.

cc @rust-lang/wg-const-eval

stdarch is developed in its own repository. If possible, consider making this change to rust-lang/stdarch instead.

cc @Amanieu, @folkertdev, @sayantn

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann, @JonathanBrouwer

Portable SIMD is developed in its own repository. If possible, consider making this change to rust-lang/portable-simd instead.

cc @calebzulawski, @programmerjake

This PR changes rustc_public

cc @oli-obk, @celinval, @ouz-a, @makai410

The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.

cc @BoxyUwU, @jieyouxu, @Kobzol, @tshepang

rustc_macros::diagnostics was changed

cc @davidtwco, @TaKO8Ki, @JonathanBrouwer

Some changes occurred in compiler/rustc_hir/src/attrs

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred to constck

cc @fee1-dead

Some changes occurred in exhaustiveness checking

cc @Nadrieril

compiler-builtins is developed in its own repository. If possible, consider making this change to rust-lang/compiler-builtins instead.

cc @tgross35

changes to the core type system

cc @lcnr

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-compiler-builtins Area: compiler-builtins (https://github.com/rust-lang/compiler-builtins) A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic O-windows Operating system: Windows T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Feb 2, 2026
@coolcatcoder
Copy link
Author

coolcatcoder commented Feb 2, 2026

Oh goodness, by loading the backup, it thinks I've changed every file in rust.
I'm so sorry for the noise!

@coolcatcoder
Copy link
Author

Perhaps I should abandon this pull request...
I can write the code for it, but I just can't manage git.
Every attempt I make to learn, and to fix my mistakes, it always ends poorly.

@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)
test [ui] tests/ui/asm/aarch64/may_unwind.rs ... ok
test [ui] tests/ui/asm/aarch64/type-check-2.rs ... ok
test [ui] tests/ui/asm/aarch64/type-check-3.rs ... ok
test [ui] tests/ui/asm/aarch64/type-f16.rs ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#sf ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#hf ... ok
test [ui] tests/ui/asm/arm-low-dreg.rs ... ok
test [ui] tests/ui/asm/bad-template.rs#aarch64 ... ok
test [ui] tests/ui/asm/binary_asm_labels.rs ... ignored, only executed when the architecture is x86_64
test [ui] tests/ui/asm/aarch64/sym.rs ... ok
test [ui] tests/ui/asm/asm-with-nested-closure.rs ... ok
---
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#thin0 ... ok
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#fat3 ... ok
test [ui] tests/ui/extern/issue-80074.rs ... ok
test [ui] tests/ui/extern/issue-95829.rs ... ok
test [ui] tests/ui/extern/lgamma-linkage.rs ... ok
test [ui] tests/ui/extern/no-mangle-associated-fn.rs ... ok
test [ui] tests/ui/extern/not-in-block.rs ... ok
test [ui] tests/ui/extern/unsized-extern-derefmove.rs ... ok
test [ui] tests/ui/extern/windows-tcb-trash-13259.rs ... ok
test [ui] tests/ui/feature-gates/allow-features-empty.rs ... ok
---
test [ui] tests/ui/imports/ambiguous-4.rs ... ok
test [ui] tests/ui/imports/ambiguous-9.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-glob-vs-multiouter.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-no-implicit-prelude.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-globvsglob.rs ... ok
test [ui] tests/ui/imports/ambiguous-8.rs ... ok
test [ui] tests/ui/imports/ambiguous-glob-vs-expanded-extern.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-non-prelude-std-glob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-non-prelude-core-glob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-pick-std.rs ... ok
---
- error[E0507]: cannot move out of `y`, a captured variable in an `AsyncFn` closure
+ error[E0507]: cannot move out of `y` which is behind a shared reference
2   --> $DIR/move-from-async-fn-bound.rs:9:10
3    |
- LL |     let y = vec![format!("World")];
-    |         - captured outer variable
6 LL |     call(async || {
-    |          ^^^^^^^^
-    |          |
-    |          captured by this `AsyncFn` closure
-    |          `y` is moved here
+    |          ^^^^^^^^ `y` is moved here
11 LL |
12 LL |         y.into_iter();
13    |         -

15    |         variable moved due to use in coroutine
16    |         move occurs because `y` has type `Vec<String>`, which does not implement the `Copy` trait
17    |
- help: `AsyncFn` and `AsyncFnMut` closures require captured values to be able to be consumed multiple times, but `AsyncFnOnce` closures may consume them only once
-   --> $DIR/move-from-async-fn-bound.rs:5:27
-    |
- LL | fn call<F>(_: F) where F: AsyncFn() {}
-    |                           ^^^^^^^^^
23 help: consider cloning the value if the performance cost is acceptable
24    |
25 LL |         y.clone().into_iter();


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 async-await/async-closures/move-from-async-fn-bound.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/async-await/async-closures/move-from-async-fn-bound.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/async-await/async-closures/move-from-async-fn-bound" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2021"
stdout: none
--- stderr -------------------------------
error[E0507]: cannot move out of `y` which is behind a shared reference
##[error]  --> /checkout/tests/ui/async-await/async-closures/move-from-async-fn-bound.rs:9:10
   |
LL |     call(async || {
   |          ^^^^^^^^ `y` is moved here
LL |         //~^ ERROR cannot move out of `y`, a captured variable in an `AsyncFn` closure
LL |         y.into_iter();
   |         -
   |         |
   |         variable moved due to use in coroutine
   |         move occurs because `y` has type `Vec<String>`, which does not implement the `Copy` trait
   |
help: consider cloning the value if the performance cost is acceptable
   |
LL |         y.clone().into_iter();
   |          ++++++++
---
error: ui test did not emit an error
note: by default, ui tests are expected not to compile.
hint: use check-pass, build-pass, or run-pass directive to change this behavior.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coercion/closure-in-array.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/coercion/closure-in-array" "-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: none

---- [ui] tests/ui/coercion/closure-in-array.rs stdout end ----
---- [ui] tests/ui/coercion/coerce-many-with-ty-var.rs stdout ----

error: test compilation failed although it shouldn't!
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/coercion/coerce-many-with-ty-var.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)" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/coercion/coerce-many-with-ty-var/a" "-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[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/coercion/coerce-many-with-ty-var.rs:14:21
   |
LL |     let _: [_; 2] = [foo, bar];
   |            ------   ^^^^^^^^^^ expected `[fn() {foo}; 2]`, found `[fn(); 2]`
   |            |
   |            expected due to this
   |
   = note: expected array `[fn() {foo}; 2]`
              found array `[fn(); 2]`
   = help: consider casting the fn item to a fn pointer: `foo as fn()`

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/coercion/coerce-many-with-ty-var.rs:15:25
   |
LL |     infer_array_element([foo, bar]);
   |     ------------------- ^^^^^^^^^^ expected `[fn() {foo}; 2]`, found `[fn(); 2]`
   |     |
   |     arguments to this function are incorrect
   |
   = note: expected array `[fn() {foo}; 2]`
              found array `[fn(); 2]`
   = help: consider casting the fn item to a fn pointer: `foo as fn()`
note: function defined here
  --> /checkout/tests/ui/coercion/coerce-many-with-ty-var.rs:10:4
   |
LL | fn infer_array_element<T>(_: [T; 2]) {}
   |    ^^^^^^^^^^^^^^^^^^^    ---------

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0308`.
---
error: ui test did not emit an error
note: by default, ui tests are expected not to compile.
hint: use check-pass, build-pass, or run-pass directive to change this behavior.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/frontmatter/content-cr.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/frontmatter/content-cr" "-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: none

---- [ui] tests/ui/frontmatter/content-cr.rs stdout end ----
---- [ui] tests/ui/hygiene/unpretty-debug-lifetimes.rs stdout ----
Saved the actual stdout to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/hygiene/unpretty-debug-lifetimes/unpretty-debug-lifetimes.stdout`
diff of stdout:

17     */ {
18     ($f:ident<$a:lifetime>) => { fn $f<$a, 'a>() {} }
19 }
- fn f /* 0#0 */<'a /* 0#0 */, 'a /* 0#1 */>() {}
+ fn f /* 0#0 */<'a /* 3026 */, 'a /* 3026 */>() {}
21 
22 
23 /*

Note: some mismatched output was normalized before being compared
- fn f /* 920#0 */<'a /* 3026 */, 'a /* 3026 */>() {}
+ fn f /* 0#0 */<'a /* 3026 */, 'a /* 3026 */>() {}


The actual stdout differed from the expected stdout
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args hygiene/unpretty-debug-lifetimes.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/hygiene/unpretty-debug-lifetimes.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/hygiene/unpretty-debug-lifetimes" "-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" "-Zunpretty=expanded,hygiene"
--- stdout -------------------------------
//@ check-pass
//@ compile-flags: -Zunpretty=expanded,hygiene

// Regression test for lifetime hygiene annotations in -Zunpretty=expanded,hygiene
// Previously, lifetimes were missing the #N syntax context suffix.

// Don't break whenever Symbol numbering changes
//@ normalize-stdout: "\d+#" -> "0#"

#![feature /* 976#0 */(decl_macro)]
#![feature /* 976#0 */(no_core)]
#![no_core /* 1479#0 */]

macro lifetime_hygiene
    /*
    3025#0
    */ {
    ($f:ident<$a:lifetime>) => { fn $f<$a, 'a>() {} }
}
fn f /* 920#0 */<'a /* 3026 */, 'a /* 3026 */>() {}


/*
Expansions:
crate0::{{expn0}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Root
crate0::{{expn1}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "lifetime_hygiene")

SyntaxContexts:
#0: parent: #0, outer_mark: (crate0::{{expn0}}, Opaque)
#1: parent: #0, outer_mark: (crate0::{{expn1}}, Opaque)
*/
------------------------------------------
stderr: none

---- [ui] tests/ui/hygiene/unpretty-debug-lifetimes.rs stdout end ----
---- [ui] tests/ui/imports/ambiguous-reachable.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/imports/ambiguous-reachable.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" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/imports/ambiguous-reachable" "-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/imports/ambiguous-reachable/auxiliary" "--extern" "ambiguous_reachable_extern=/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/imports/ambiguous-reachable/auxiliary/libambiguous_reachable_extern.so"
stdout: none
--- stderr -------------------------------
error: missing optimized MIR for `ambiguous_reachable_extern::m1::generic::<u8>` in the crate `ambiguous_reachable_extern`
   |
note: missing optimized MIR for this item (was the crate `ambiguous_reachable_extern` compiled with `--emit=metadata`?)
  --> /checkout/tests/ui/imports/auxiliary/ambiguous-reachable-extern.rs:2:5
   |
LL |     pub fn generic<T>() {
   |     ^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error
---
To only update this specific test, also pass `--test-args let-else/let-else-break-help-issue-142602.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/let-else/let-else-break-help-issue-142602.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/let-else/let-else-break-help-issue-142602" "-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[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/let-else/let-else-break-help-issue-142602.rs:10:19
   |
LL |             break 3; //~ ERROR mismatched types
   |                   ^ expected `()`, found integer

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/let-else/let-else-break-help-issue-142602.rs:20:19
   |
LL |             break 3; //~ ERROR mismatched types
   |                   ^ expected `()`, found integer

error: aborting due to 2 previous errors

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

---- [ui] tests/ui/let-else/let-else-break-help-issue-142602.rs stdout end ----
---- [ui] tests/ui/lint/unused-parens-labeled-break-issue-143256.rs stdout ----

error: test compilation failed although it shouldn't!
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/lint/unused-parens-labeled-break-issue-143256.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/lint/unused-parens-labeled-break-issue-143256" "-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: unnecessary parentheses around `if` condition
##[error]  --> /checkout/tests/ui/lint/unused-parens-labeled-break-issue-143256.rs:12:16
   |
LL |             if (break 'outer i) {
   |                ^              ^
   |
note: the lint level is defined here
  --> /checkout/tests/ui/lint/unused-parens-labeled-break-issue-143256.rs:4:9
   |
LL | #![deny(unused_parens)]
   |         ^^^^^^^^^^^^^
help: remove these parentheses
   |
LL -             if (break 'outer i) {
LL +             if break 'outer i {
   |

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

---
13 help: use `let _ = ...` to ignore the resulting value
14    |
- LL |         let _ = error();
-    |         +++++++
+ LL |     let _ = let _ = foo!();
+    |             +++++++
17 
18 error: aborting due to 1 previous error
19 

Note: some mismatched output was normalized before being compared
- LL |     let _ = let _ = foo!(); //~ ERROR unused `Result` that must be used
+ LL |     let _ = let _ = foo!();
+    |             +++++++


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args lint/unused/lint-unsed-in-macro-issue-151269.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/lint/unused/lint-unsed-in-macro-issue-151269.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/lint/unused/lint-unsed-in-macro-issue-151269" "-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: unused `Result` that must be used
##[error]  --> /checkout/tests/ui/lint/unused/lint-unsed-in-macro-issue-151269.rs:14:13
   |
LL |     let _ = foo!(); //~ ERROR unused `Result` that must be used
   |             ^^^^^^
   |
   = note: this `Result` may be an `Err` variant, which should be handled
note: the lint level is defined here
  --> /checkout/tests/ui/lint/unused/lint-unsed-in-macro-issue-151269.rs:1:9
   |
LL | #![deny(unused_must_use)]
   |         ^^^^^^^^^^^^^^^
help: use `let _ = ...` to ignore the resulting value
   |
LL |     let _ = let _ = foo!(); //~ ERROR unused `Result` that must be used
   |             +++++++

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

---- [ui] tests/ui/lint/unused/lint-unsed-in-macro-issue-151269.rs stdout end ----
---- [ui] tests/ui/lint/unused/unused-allocation-box-ref-issue-151846.rs stdout ----

error: test compilation failed although it shouldn't!
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/lint/unused/unused-allocation-box-ref-issue-151846.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/lint/unused/unused-allocation-box-ref-issue-151846" "-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: unnecessary allocation, use `&` instead
##[error]  --> /checkout/tests/ui/lint/unused/unused-allocation-box-ref-issue-151846.rs:40:5
   |
LL |     Box::new(MyStruct).trait_takes_box_ref();
   |     ^^^^^^^^^^^^^^^^^^
   |
note: the lint level is defined here
  --> /checkout/tests/ui/lint/unused/unused-allocation-box-ref-issue-151846.rs:5:9
   |
LL | #![deny(unused_allocation)]
   |         ^^^^^^^^^^^^^^^^^

error: unnecessary allocation, use `&` instead
##[error]  --> /checkout/tests/ui/lint/unused/unused-allocation-box-ref-issue-151846.rs:41:5
   |
LL |     Box::new(MyStruct).inherent_takes_box_ref();
   |     ^^^^^^^^^^^^^^^^^^

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

---
- error: aborting due to 1 previous error
+ error[E0308]: mismatched types
+   --> $DIR/missing-let.rs:4:12
+    |
+ LL |         && Some(x) = x
+    |            ^^^^^^^ expected `bool`, found `Option<Option<{integer}>>`
+    |
+    = note: expected type `bool`
+               found enum `Option<Option<{integer}>>`
+ help: use `Option::is_some` to test if the `Option` has a value
+    |
+ LL |         && Some(x).is_some() = x
+    |                   ++++++++++
18 
+ error[E0308]: mismatched types
+   --> $DIR/missing-let.rs:3:8
+    |
---
19 

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/missing/missing-let.rs:4:12
- LL |         && Some(x) = x //~^ ERROR expected expression, found `let` statement
- LL |         && Some(x).is_some() = x //~^ ERROR expected expression, found `let` statement
-   --> /checkout/tests/ui/missing/missing-let.rs:3:8
- LL | |         && Some(x) = x //~^ ERROR expected expression, found `let` statement
+ error[E0308]: mismatched types
+   --> $DIR/missing-let.rs:4:12
+    |
+ LL |         && Some(x) = x
+    |            ^^^^^^^ expected `bool`, found `Option<Option<{integer}>>`
+    |
+    = note: expected type `bool`
+               found enum `Option<Option<{integer}>>`
+ help: use `Option::is_some` to test if the `Option` has a value
+    |
+ LL |         && Some(x).is_some() = x
+    |                   ++++++++++
+ error[E0308]: mismatched types
+   --> $DIR/missing-let.rs:3:8
+    |
+ LL |       if let Some(_) = x
---
To only update this specific test, also pass `--test-args missing/missing-let.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/missing/missing-let.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/missing/missing-let" "-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 expression, found `let` statement
##[error]  --> /checkout/tests/ui/missing/missing-let.rs:3:8
   |
LL |     if let Some(_) = x
   |        ^^^^^^^^^^^^^^^
   |
   = note: only supported directly in conditions of `if` and `while` expressions
help: you might have meant to continue the let-chain
   |
LL |         && let Some(x) = x //~^ ERROR expected expression, found `let` statement
   |            +++
help: you might have meant to compare for equality
   |
LL |         && Some(x) == x //~^ ERROR expected expression, found `let` statement
   |                     +

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/missing/missing-let.rs:4:12
   |
LL |         && Some(x) = x //~^ ERROR expected expression, found `let` statement
   |            ^^^^^^^ expected `bool`, found `Option<Option<{integer}>>`
   |
   = note: expected type `bool`
              found enum `Option<Option<{integer}>>`
help: use `Option::is_some` to test if the `Option` has a value
   |
LL |         && Some(x).is_some() = x //~^ ERROR expected expression, found `let` statement
   |                   ++++++++++

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/missing/missing-let.rs:3:8
   |
LL |       if let Some(_) = x
   |  ________^
LL | |         && Some(x) = x //~^ ERROR expected expression, found `let` statement
   | |______________________^ expected `bool`, found `()`

error: aborting due to 3 previous errors

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

---- [ui] tests/ui/missing/missing-let.rs stdout end ----
---- [ui] tests/ui/suggestions/derive-clone-already-present-issue-146515.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/suggestions/derive-clone-already-present-issue-146515/derive-clone-already-present-issue-146515.stderr`
diff of stderr:

15 LL |     x.clone()
16    |     ^
17    = help: `Clone` is not implemented because the trait bound `T: Clone` is not satisfied
---
To only update this specific test, also pass `--test-args suggestions/derive-clone-already-present-issue-146515.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/suggestions/derive-clone-already-present-issue-146515.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/suggestions/derive-clone-already-present-issue-146515" "-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[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/suggestions/derive-clone-already-present-issue-146515.rs:12:5
   |
LL | fn clone_me<T>(x: &ContainsRc<T>) -> ContainsRc<T> {
   |                                      ------------- expected `ContainsRc<T>` because of return type
LL |     //~^ NOTE expected `ContainsRc<T>` because of return type
LL |     x.clone()
   |     ^^^^^^^^^ expected `ContainsRc<T>`, found `&ContainsRc<T>`
   |
   = note: expected struct `ContainsRc<_>`
           found reference `&ContainsRc<_>`
note: `ContainsRc<T>` does not implement `Clone`, so `&ContainsRc<T>` was cloned instead
  --> /checkout/tests/ui/suggestions/derive-clone-already-present-issue-146515.rs:12:5
   |
LL |     x.clone()
   |     ^
   = help: `Clone` is not implemented because the trait bound `T: Clone` is not satisfied
help: consider annotating `ContainsRc<T>` with `#[derive(Clone)]`
---

2   --> $DIR/associated-item-unsatisfied-trait-bounds.rs:8:10
3    |
4 LL | struct Foo;
-    | ---------- function or associated item `bat` not found for this struct because `Foo` doesn't implement `Bar` or `Baz`
+    | ---------- function or associated item `bat` not found for this struct because it doesn't satisfy `Foo: Bar`, `Foo: Bat` or `Foo: Baz`
6 ...
7 LL |     Foo::bat(());
8    |          ^^^ function or associated item cannot be called on `Foo` due to unsatisfied trait bounds

9    |
- note: for `bat` to be available, `Foo` must implement `Bar` and `Baz`
+ note: the following trait bounds were not satisfied:
+       `&Foo: Bar`
+       `&Foo: Baz`
+       `&mut Foo: Bar`
+       `&mut Foo: Baz`
+       `Foo: Bar`
+       `Foo: Baz`
11   --> $DIR/associated-item-unsatisfied-trait-bounds.rs:5:38
12    |
13 LL | impl<T> Bat for T where T: 'static + Bar + Baz { fn bat(&self) { println!("generic bat"); } }


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 traits/associated-item-unsatisfied-trait-bounds.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/traits/associated-item-unsatisfied-trait-bounds.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/traits/associated-item-unsatisfied-trait-bounds" "-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]: the function or associated item `bat` exists for struct `Foo`, but its trait bounds were not satisfied
##[error]  --> /checkout/tests/ui/traits/associated-item-unsatisfied-trait-bounds.rs:8:10
   |
LL | struct Foo;
   | ---------- function or associated item `bat` not found for this struct because it doesn't satisfy `Foo: Bar`, `Foo: Bat` or `Foo: Baz`
...
LL |     Foo::bat(()); //~ ERROR E0599
   |          ^^^ function or associated item cannot be called on `Foo` due to unsatisfied trait bounds
   |
note: the following trait bounds were not satisfied:
      `&Foo: Bar`
      `&Foo: Baz`
      `&mut Foo: Bar`
      `&mut Foo: Baz`
      `Foo: Bar`
      `Foo: Baz`
  --> /checkout/tests/ui/traits/associated-item-unsatisfied-trait-bounds.rs:5:38
   |
LL | impl<T> Bat for T where T: 'static + Bar + Baz { fn bat(&self) { println!("generic bat"); } }
   |         ---     -                    ^^^   ^^^ unsatisfied trait bound introduced here
   |                                      |
   |                                      unsatisfied trait bound introduced here
note: the traits `Bar` and `Baz` must be implemented
  --> /checkout/tests/ui/traits/associated-item-unsatisfied-trait-bounds.rs:2:1
   |
LL | trait Bar {}
   | ^^^^^^^^^
LL | trait Baz {}
   | ^^^^^^^^^
   = help: items from traits can only be used if the trait is implemented and in scope
note: `Bat` defines an item `bat`, perhaps you need to implement it
  --> /checkout/tests/ui/traits/associated-item-unsatisfied-trait-bounds.rs:4:1
   |
LL | trait Bat { fn bat(&self); }
   | ^^^^^^^^^

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0599`.
---
+ 
+ error: cannot find attribute `rustc_non_const_trait_method` in this scope
+   --> $DIR/attr-gate.rs:2:7
6    |
-    = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
-    = note: the `#[rustc_non_const_trait_method]` attribute is an internal implementation detail that will never be stable
-    = note: `#[rustc_non_const_trait_method]` should only used by the standard library to mark trait methods as non-const to allow large traits an easier transition to const
+ LL |     #[rustc_non_const_trait_method]
+    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10 
- error: aborting due to 1 previous error
+ error: aborting due to 2 previous errors
12 
---
To only update this specific test, also pass `--test-args traits/const-traits/partial/attr-gate.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/const-traits/partial/attr-gate.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/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/traits/const-traits/partial/attr-gate" "-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: attributes starting with `rustc` are reserved for use by the `rustc` compiler
##[error]  --> /checkout/tests/ui/traits/const-traits/partial/attr-gate.rs:2:7
   |
---
-    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
+ LL |     #[rustc_non_const_trait_method]
+    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10 
- error[E0015]: cannot call non-const associated function `<T as A>::b` in constant functions
-   --> $DIR/no-const-callers.rs:26:5
+ error: cannot find attribute `rustc_non_const_trait_method` in this scope
+   --> $DIR/no-const-callers.rs:5:7
13    |
- LL |     T::b();
-    |     ^^^^^^
-    |
-    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
+ LL |     #[rustc_non_const_trait_method]
+    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18 
- error[E0015]: cannot call non-const associated function `<() as A>::b` in constant functions
-   --> $DIR/no-const-callers.rs:29:5
+ error[E0015]: cannot call non-const function `std::io::_print` in constant functions
+   --> $DIR/no-const-callers.rs:6:14
21    |
- LL |     <()>::b();
-    |     ^^^^^^^^^
+ LL |     fn b() { println!("hi"); }
+    |              ^^^^^^^^^^^^^^
24    |
+ note: function `_print` is not const
+   --> $SRC_DIR/std/src/io/stdio.rs:LL:COL
25    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
26 
- error[E0015]: cannot call non-const associated function `<u8 as A>::b` in constant functions
-   --> $DIR/no-const-callers.rs:32:5
+ error[E0015]: cannot call non-const function `std::io::_print` in constant functions
+   --> $DIR/no-const-callers.rs:15:14
29    |
- LL |     u8::b();
---
+ note: function `_print` is not const
+   --> $SRC_DIR/std/src/io/stdio.rs:LL:COL
33    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
34 
- error[E0015]: cannot call non-const associated function `<i8 as A>::b` in constant functions
-   --> $DIR/no-const-callers.rs:35:5
-    |
- LL |     i8::b();
-    |     ^^^^^^^
-    |
---
+ LL |     #[rustc_non_const_trait_method]
+    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ error[E0015]: cannot call non-const function `std::io::_print` in constant functions
+   --> $DIR/no-const-callers.rs:6:14
+ LL |     fn b() { println!("hi"); }
+    |              ^^^^^^^^^^^^^^
+ note: function `_print` is not const
+   --> $SRC_DIR/std/src/io/stdio.rs:LL:COL
+ error[E0015]: cannot call non-const function `std::io::_print` in constant functions
+   --> $DIR/no-const-callers.rs:15:14
---
To only update this specific test, also pass `--test-args traits/const-traits/partial/no-const-callers.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/traits/const-traits/partial/no-const-callers.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/traits/const-traits/partial/no-const-callers" "-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: attributes starting with `rustc` are reserved for use by the `rustc` compiler
##[error]  --> /checkout/tests/ui/traits/const-traits/partial/no-const-callers.rs:5:7
   |
---

error[E0015]: cannot call non-const function `std::io::_print` in constant functions
##[error]  --> /checkout/tests/ui/traits/const-traits/partial/no-const-callers.rs:6:14
   |
LL |     fn b() { println!("hi"); }
   |              ^^^^^^^^^^^^^^
   |
note: function `_print` is not const
  --> /rustc/FAKE_PREFIX/library/std/src/io/stdio.rs:1274:0
   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants

@RalfJung
Copy link
Member

RalfJung commented Feb 2, 2026

See https://rustc-dev-guide.rust-lang.org/git.html#rebasing for some help with rebasing.

@coolcatcoder
Copy link
Author

Anyone can feel free to try to recover this pull request.
Saving it is beyond my skill level at this point.
I'm just going to create a new branch, and start from the beginning, for what I believe is the third time.

@Kobzol
Copy link
Member

Kobzol commented Feb 2, 2026

Yeah, probably best to start over.

Next time, if you need to rebase over main, you can do something like this:

git fetch origin
git rebase origin/main

assuming that origin is the name of the remote that points to github.com/rust-lang/rust (you can check with git remote -v).

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 2, 2026

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

@9SonSteroids
Copy link

9SonSteroids commented Feb 2, 2026

Hey, I ported your code to support getting the vtable and it works! @coolcatcoder

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-compiler-builtins Area: compiler-builtins (https://github.com/rust-lang/compiler-builtins) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic F-type_info #![feature(type_info)] O-windows Operating system: Windows T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.