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

use parallel front end(-Zthreads=2) in ui tests #129799

Closed
wants to merge 4 commits into from

Conversation

SparrowLii
Copy link
Member

@SparrowLii SparrowLii commented Aug 31, 2024

use parallel front end(-Zthreads=2) in ui tests
Test the functionality of the parallel frontend to support stabilization

@rustbot
Copy link
Collaborator

rustbot commented Aug 31, 2024

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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 A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. labels Aug 31, 2024
@rustbot
Copy link
Collaborator

rustbot commented Aug 31, 2024

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@matthiaskrgr
Copy link
Member

Due to the nature of parallel compiler bugs not being reliably reproducible most of the time, I don't think we will ever be able to turn this on in ci permanently, as a default at least.

What will happen is that we run into weird one-in-50 edge cases where tests fail or ICEs happen on seemingly unrelated PRs or random targets, while the pr that introduced the bug passed in ci by pure luck.

@SparrowLii
Copy link
Member Author

SparrowLii commented Aug 31, 2024

Makes sense. The biggest value of this PR may be to find bugs caused by parallel front end through UI testing.

We found a deadlock bug in tests/ui/type/type-recursive.rs and some ICE in other cases for example

@Kobzol
Copy link
Contributor

Kobzol commented Aug 31, 2024

We could add a special CI job that enables more threads, as a sort of a fuzzer, and allow it to fail (or just run it on a different rustc fork, for example).

@the8472
Copy link
Member

the8472 commented Aug 31, 2024

You should check the walltime impact of running UI tests locally. They don't run under a jobserver, so it'll likely end up oversubscribing the CPU cores.

OTOH UI tests are tiny, so I wonder how much of a chance it even gets at running multiple threads.

@rustbot
Copy link
Collaborator

rustbot commented Sep 2, 2024

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git pull --rebase https://github.com/rust-lang/rust.git master
$ git push --force-with-lease

The following commits are merge commits:

@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 Sep 2, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
------
 > importing cache manifest from ghcr.io/rust-lang/rust-ci-cache:20d3b4d4a2629cbf7865cdbf92fe47512a7c96658c24253a045ff38e8075cd7fb37ca6fcadfa6e6d093333943ad24f6fc4f163ec5b74fd940de9d5bb03eb4d3b:
------
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-17]
---
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-17', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--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-17/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id            := 99999999
---
error: /checkout/tests/ui/async-await/mutually-recursive-async-impl-trait-type.rs:5: expected error not found: recursion in an async fn

error: 1 unexpected errors found, 1 expected errors not found
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/async-await/mutually-recursive-async-impl-trait-type.rs" "-Zthreads=2" "-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/async-await/mutually-recursive-async-impl-trait-type" "-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/async-await/mutually-recursive-async-impl-trait-type/auxiliary" "--edition=2018"
--- unexpected errors (from JSON output) ---
ERROR     line   9: 9:1: 9:17: recursion in an async fn requires boxing [E0733]
---
--- not found errors (from test file) ---
---
To only update this specific test, also pass `--test-args consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.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/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.rs" "-Zthreads=2" "-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/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout" "-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/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout/auxiliary"
--- stderr -------------------------------
error[E0080]: evaluation of constant value failed
##[error]  --> /checkout/tests/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.rs:19:5
   |
---

error[E0080]: evaluation of constant value failed
##[error]  --> /checkout/tests/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.rs:25:5
   |
LL |     intrinsics::const_deallocate(ptr, 4, 3);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid align passed to `const_deallocate`: 3 is not a power of 2
error: aborting due to 4 previous errors

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


---- [ui] tests/ui/consts/const-eval/raw-bytes.rs stdout ----
diff of 64bit.stderr:

211   --> $DIR/raw-bytes.rs:108:1
212    |
213 LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
-    | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC3<imm>, but expected a function pointer
215    |
216    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
217    = note: the raw bytes of the constant (size: 8, align: 8) {
385   --> $DIR/raw-bytes.rs:177:1
386    |
386    |
387 LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC17<imm>, but expected a vtable pointer
389    |
390    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
391    = note: the raw bytes of the constant (size: 16, align: 8) {
451   --> $DIR/raw-bytes.rs:199:1
452    |
452    |
453 LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC27<imm>, but expected a vtable pointer
455    |
456    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
457    = note: the raw bytes of the constant (size: 16, align: 8) {

The actual 64bit.stderr differed from the expected 64bit.stderr.
Actual 64bit.stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/raw-bytes/raw-bytes.64bit.stderr
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args consts/const-eval/raw-bytes.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/consts/const-eval/raw-bytes.rs" "-Zthreads=2" "-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/consts/const-eval/raw-bytes" "-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/consts/const-eval/raw-bytes/auxiliary"
--- stderr -------------------------------
error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:150:1
   |
   |
LL | const MYSTR_NO_INIT_ISSUE83182: &MyStr = unsafe { mem::transmute::<&[_], _>(&[&()]) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered a pointer, but expected a string
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾─────alloc8<imm>─────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
   = help: this code performed an operation that depends on the underlying bytes representing a pointer
   = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported

error[E0080]: it is undefined behavior to use this value
error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:154:1
   |
LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc12<imm>─────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:21:1
   |
   |
LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
   | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x0000000000000001, but expected a valid enum tag
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
           }

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:29:1
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:29:1
   |
LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
   | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x0000000000000000, but expected a valid enum tag
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
           }

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:43:1
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:43:1
   |
LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered an uninhabited enum variant
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 1, align: 1) {
           }

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:45:1
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:45:1
   |
LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered an uninhabited enum variant
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 1, align: 1) {
           }

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:51:1
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:51:1
   |
LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) }));
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 4) {
               78 00 00 00 ff ff ff ff                         │ x.......

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:56:1
   |
   |
LL | const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
           }

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:59:1
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:59:1
   |
LL | const NULL_U8: NonZero<u8> = unsafe { mem::transmute(0u8) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 1, align: 1) {
           }

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:61:1
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:61:1
   |
LL | const NULL_USIZE: NonZero<usize> = unsafe { mem::transmute(0usize) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
           }

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:67:1
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:67:1
   |
LL | const BAD_RANGE1: RestrictedRange1 = unsafe { RestrictedRange1(42) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 42, but expected something in the range 10..=30
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 4, align: 4) {
               2a 00 00 00                                     │ *...

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:73:1
   |
   |
LL | const BAD_RANGE2: RestrictedRange2 = unsafe { RestrictedRange2(20) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 20, but expected something less or equal to 10, or greater or equal to 30
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 4, align: 4) {
           }

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:76:1
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:76:1
   |
LL | const NULL_FAT_PTR: NonNull<dyn Send> = unsafe {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               00 00 00 00 00 00 00 00 ╾───────alloc39───────╼ │ ........╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:84:1
   |
   |
LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
   | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
               ╾────alloc46<imm>─────╼                         │ ╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:88:1
   |
   |
LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
               ╾────alloc50<imm>─────╼                         │ ╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:92:1
   |
   |
LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
   | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
           }

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:95:1
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:95:1
   |
LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
           }

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:98:1
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:98:1
   |
LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (0x539[noalloc] has no provenance)
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
           }

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:101:1
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:101:1
   |
LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (0x539[noalloc] has no provenance)
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
           }

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:104:1
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:104:1
   |
LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
   | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a function pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
           }

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:106:1
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:106:1
   |
LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0xd[noalloc], but expected a function pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
           }

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:108:1
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:108:1
   |
LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
   | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered alloc66<imm>, but expected a function pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
               ╾────alloc66<imm>─────╼                         │ ╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:156:1
   |
   |
LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc73<imm>─────╼ ff ff ff ff ff ff ff 7f │ ╾──────╼........

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:159:1
   |
   |
LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc78<imm>─────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:114:1
   |
   |
LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
   | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
           }

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:162:1
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:162:1
   |
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
               ╾────alloc84<imm>─────╼                         │ ╾──────╼

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:162:40
   |
   |
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:139:1
   |
   |
LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc87<imm>─────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:141:1
   |
   |
LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc92<imm>─────╼ ff ff ff ff ff ff ff ff │ ╾──────╼........

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:168:1
   |
   |
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
               ╾────alloc100<imm>────╼                         │ ╾──────╼

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:168:42
   |
   |
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:143:1
   |
   |
LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc103<imm>────╼ ff ff ff ff ff ff ff ff │ ╾──────╼........

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:172:1
   |
   |
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
               ╾────alloc110<imm>────╼                         │ ╾──────╼

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:172:42
   |
   |
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:146:1
   |
   |
LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
   | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized memory, but expected a string
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc114<imm>────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:177:1
   |
   |
LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered alloc120<imm>, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc118<imm>────╼ ╾────alloc120<imm>────╼ │ ╾──────╼╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:148:1
   |
   |
LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized memory, but expected a string
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc127<imm>────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:181:1
   |
   |
LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered alloc133<imm>, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc131<imm>────╼ ╾────alloc133<imm>────╼ │ ╾──────╼╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:205:1
   |
   |
LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 1]) }; //~ ERROR undefined behavior
   | ^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a value of the never type `!`
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
           }

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:206:1
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:206:1
   |
LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 42]) }; //~ ERROR undefined behavior
   | ^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a value of the never type `!`
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               01 00 00 00 00 00 00 00 2a 00 00 00 00 00 00 00 │ ........*.......

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:185:1
   |
   |
LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0x4[noalloc], but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc141<imm>────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/raw-bytes.rs:188:1
   |
   |
LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered alloc150<imm>, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc147<imm>────╼ ╾────alloc150<imm>────╼ │ ╾──────╼╾──────╼

error[E0080]: it is undefined behavior to use this value
---
diff of 64bit.stderr:

13   --> $DIR/ub-incorrect-vtable.rs:23:1
14    |
15 LL | const INVALID_VTABLE_SIZE: &dyn Trait =
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC3<imm>, but expected a vtable pointer
17    |
18    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
19    = note: the raw bytes of the constant (size: 16, align: 8) {

-                ╾ALLOC2<imm>╼ ╾ALLOC3<imm>╼ │ ╾──────╼╾──────╼
22 
23 error[E0080]: it is undefined behavior to use this value

35   --> $DIR/ub-incorrect-vtable.rs:38:1
35   --> $DIR/ub-incorrect-vtable.rs:38:1
36    |
37 LL | const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> =
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC7<imm>, but expected a vtable pointer
39    |
40    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
41    = note: the raw bytes of the constant (size: 16, align: 8) {
61    |
61    |
62    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
63    = note: the raw bytes of the constant (size: 16, align: 8) {
-                ╾ALLOC10<imm>╼ ╾ALLOC11╼ │ ╾──────╼╾──────╼
66 
67 error: aborting due to 6 previous errors



The actual 64bit.stderr differed from the expected 64bit.stderr.
Actual 64bit.stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/ub-incorrect-vtable/ub-incorrect-vtable.64bit.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args consts/const-eval/ub-incorrect-vtable.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/consts/const-eval/ub-incorrect-vtable.rs" "-Zthreads=2" "-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/consts/const-eval/ub-incorrect-vtable" "-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/consts/const-eval/ub-incorrect-vtable/auxiliary"
--- stderr -------------------------------
error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-incorrect-vtable.rs:18:1
   |
   |
LL | const INVALID_VTABLE_ALIGNMENT: &dyn Trait =
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered alloc5<imm>, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾─────alloc3<imm>─────╼ ╾─────alloc5<imm>─────╼ │ ╾──────╼╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-incorrect-vtable.rs:91:1
   |
   |
LL | const G: Wide = unsafe { Transmute { t: FOO }.u };
   | ^^^^^^^^^^^^^ constructing invalid value at .1: encountered a dangling reference (going beyond the bounds of its allocation)
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾─────alloc9<imm>─────╼ ╾───────alloc10───────╼ │ ╾──────╼╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-incorrect-vtable.rs:33:1
   |
   |
LL | const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> =
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered alloc18<imm>, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc15<imm>─────╼ ╾────alloc18<imm>─────╼ │ ╾──────╼╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-incorrect-vtable.rs:23:1
   |
   |
LL | const INVALID_VTABLE_SIZE: &dyn Trait =
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered alloc27<imm>, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc25<imm>─────╼ ╾────alloc27<imm>─────╼ │ ╾──────╼╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-incorrect-vtable.rs:44:1
   |
   |
LL | const INVALID_VTABLE_UB: W<&dyn Trait> =
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered alloc34<imm>, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc32<imm>─────╼ ╾────alloc34<imm>─────╼ │ ╾──────╼╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-incorrect-vtable.rs:38:1
   |
   |
LL | const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> =
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered alloc40<imm>, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc38<imm>─────╼ ╾────alloc40<imm>─────╼ │ ╾──────╼╾──────╼

error: aborting due to 6 previous errors

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

189   --> $DIR/ub-wide-ptr.rs:114:1
190    |
191 LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC12<imm>, but expected a vtable pointer
193    |
194    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
195    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
222   --> $DIR/ub-wide-ptr.rs:125:1
223    |
223    |
224 LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC17<imm>, but expected a vtable pointer
226    |
227    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
228    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
233   --> $DIR/ub-wide-ptr.rs:128:1
234    |
234    |
235 LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC19<imm>, but expected a vtable pointer
237    |
238    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
239    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
244   --> $DIR/ub-wide-ptr.rs:131:1
245    |
245    |
246 LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC21<imm>, but expected a vtable pointer
248    |
249    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
250    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
255   --> $DIR/ub-wide-ptr.rs:134:1
256    |
256    |
257 LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC23<imm>, but expected a vtable pointer
259    |
260    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
261    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
288   --> $DIR/ub-wide-ptr.rs:147:1
289    |
289    |
290 LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC28<imm>, but expected a vtable pointer
292    |
293    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
294    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {

The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/ub-wide-ptr/ub-wide-ptr.stderr
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args consts/const-eval/ub-wide-ptr.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/consts/const-eval/ub-wide-ptr.rs" "-Zthreads=2" "-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/consts/const-eval/ub-wide-ptr" "-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/consts/const-eval/ub-wide-ptr/auxiliary"
--- stderr -------------------------------
error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:39:1
   |
   |
LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾─────alloc9<imm>─────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:41:1
   |
   |
LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc15<imm>─────╼ ff ff ff ff ff ff ff ff │ ╾──────╼........

error[E0080]: evaluation of constant value failed
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:44:1
   |
   |
LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
   = help: this code performed an operation that depends on the underlying bytes representing a pointer
   = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported

error[E0080]: evaluation of constant value failed
error[E0080]: evaluation of constant value failed
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:47:1
   |
LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
   = help: this code performed an operation that depends on the underlying bytes representing a pointer
   = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported

error[E0080]: it is undefined behavior to use this value
error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:49:1
   |
LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc35<imm>─────╼ ff ff ff ff ff ff ff ff │ ╾──────╼........

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:53:1
   |
   |
LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
   | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized memory, but expected a string
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc41<imm>─────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:56:1
   |
   |
LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized memory, but expected a string
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc46<imm>─────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........

error[E0080]: evaluation of constant value failed
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:63:1
   |
   |
LL | const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:70:1
   |
   |
LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc60<imm>─────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:73:1
   |
   |
LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc66<imm>─────╼ ff ff ff ff ff ff ff 7f │ ╾──────╼........

error[E0080]: evaluation of constant value failed
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:76:1
   |
   |
LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
   = help: this code performed an operation that depends on the underlying bytes representing a pointer
   = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported

error[E0080]: it is undefined behavior to use this value
error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:79:1
   |
LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc78<imm>─────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........

error[E0080]: evaluation of constant value failed
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:82:1
   |
   |
LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
   = help: this code performed an operation that depends on the underlying bytes representing a pointer
   = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported

error[E0080]: it is undefined behavior to use this value
error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:86:1
   |
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
               ╾────alloc91<imm>─────╼                         │ ╾──────╼

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:86:40
   |
   |
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];

error[E0080]: evaluation of constant value failed
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:105:1
   |
   |
LL | const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:93:1
   |
   |
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
               ╾────alloc109<imm>────╼                         │ ╾──────╼

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:93:42
   |
   |
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:114:1
   |
   |
LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered alloc114<imm>, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc112<imm>────╼ ╾────alloc114<imm>────╼ │ ╾──────╼╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:97:1
   |
   |
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
               ╾────alloc122<imm>────╼                         │ ╾──────╼

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:97:42
   |
   |
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:118:1
   |
   |
LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered alloc142<imm>, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc138<imm>────╼ ╾────alloc142<imm>────╼ │ ╾──────╼╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:134:1
   |
   |
LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered alloc144<imm>, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc136<imm>────╼ ╾────alloc144<imm>────╼ │ ╾──────╼╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:122:1
   |
   |
LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0x4[noalloc], but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc152<imm>────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:139:1
   |
   |
LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc158<imm>────╼ ╾──────alloc160───────╼ │ ╾──────╼╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:144:1
   |
   |
LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc164<imm>────╼ 00 00 00 00 00 00 00 00 │ ╾──────╼........

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:125:1
   |
   |
LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered alloc170<imm>, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc166<imm>────╼ ╾────alloc170<imm>────╼ │ ╾──────╼╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:128:1
   |
   |
LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered alloc177<imm>, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc175<imm>────╼ ╾────alloc177<imm>────╼ │ ╾──────╼╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:147:1
   |
   |
LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered alloc184<imm>, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc182<imm>────╼ ╾────alloc184<imm>────╼ │ ╾──────╼╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:131:1
   |
   |
LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered alloc191<imm>, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc189<imm>────╼ ╾────alloc191<imm>────╼ │ ╾──────╼╾──────╼

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:155:1
   |
   |
LL | static mut RAW_TRAIT_OBJ_VTABLE_NULL_THROUGH_REF: *const dyn Trait = unsafe {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc200<imm>────╼ 00 00 00 00 00 00 00 00 │ ╾──────╼........

error[E0080]: it is undefined behavior to use this value
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:160:1
   |
   |
LL | static mut RAW_TRAIT_OBJ_VTABLE_INVALID_THROUGH_REF: *const dyn Trait = unsafe {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered alloc212<imm>, but expected a vtable pointer
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 16, align: 8) {
               ╾────alloc210<imm>────╼ ╾────alloc212<imm>────╼ │ ╾──────╼╾──────╼

error: aborting due to 29 previous errors

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

92 error[E0080]: evaluation of constant value failed
93   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
94    |
-    = note: out-of-bounds pointer arithmetic: expected a pointer to the end of $BYTES bytes of memory, but got ALLOC3-0x2 which points to before the beginning of the allocation
97 note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
98   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL

105 error[E0080]: evaluation of constant value failed
105 error[E0080]: evaluation of constant value failed
106   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
107    |
-    = note: out-of-bounds pointer arithmetic: expected a pointer to 1 byte of memory, but got ALLOC4 which is at or beyond the end of the allocation of size $BYTES bytes
110 note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
111   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/offset_ub/offset_ub.stderr
To only update this specific test, also pass `--test-args consts/offset_ub.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/consts/offset_ub.rs" "-Zthreads=2" "-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/consts/offset_ub" "-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/consts/offset_ub/auxiliary"
--- stderr -------------------------------
error[E0080]: evaluation of constant value failed
##[error]  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
   |
   |
   = note: out-of-bounds pointer arithmetic: expected a pointer to the end of 1 byte of memory, but got alloc5 which is at the beginning of the allocation
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
note: inside `BEFORE_START`
  --> /checkout/tests/ui/consts/offset_ub.rs:8:46
  --> /checkout/tests/ui/consts/offset_ub.rs:8:46
   |
LL | pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1) }; //~NOTE

error[E0080]: evaluation of constant value failed
##[error]  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
   |
   |
   = note: out-of-bounds pointer arithmetic: expected a pointer to 2 bytes of memory, but got alloc9 which is only 1 byte from the end of the allocation
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
note: inside `AFTER_END`
  --> /checkout/tests/ui/consts/offset_ub.rs:9:43
  --> /checkout/tests/ui/consts/offset_ub.rs:9:43
   |
LL | pub const AFTER_END: *const u8 = unsafe { (&0u8 as *const u8).offset(2) }; //~NOTE

error[E0080]: evaluation of constant value failed
##[error]  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
   |
   |
   = note: out-of-bounds pointer arithmetic: expected a pointer to 101 bytes of memory, but got alloc13 which is only 100 bytes from the end of the allocation
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
note: inside `AFTER_ARRAY`
  --> /checkout/tests/ui/consts/offset_ub.rs:10:45
  --> /checkout/tests/ui/consts/offset_ub.rs:10:45
   |
LL | pub const AFTER_ARRAY: *const u8 = unsafe { [0u8; 100].as_ptr().offset(101) }; //~NOTE

error[E0080]: evaluation of constant value failed
##[error]  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
   |
   |
   = note: overflowing pointer arithmetic: the total offset in bytes does not fit in an `isize`
note: inside `std::ptr::const_ptr::<impl *const u16>::offset`
  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
note: inside `OVERFLOW`
  --> /checkout/tests/ui/consts/offset_ub.rs:12:43
  --> /checkout/tests/ui/consts/offset_ub.rs:12:43
   |
LL | pub const OVERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MAX) }; //~NOTE

error[E0080]: evaluation of constant value failed
##[error]  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
   |
   |
   = note: overflowing pointer arithmetic: the total offset in bytes does not fit in an `isize`
note: inside `std::ptr::const_ptr::<impl *const u16>::offset`
  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
note: inside `UNDERFLOW`
  --> /checkout/tests/ui/consts/offset_ub.rs:13:44
  --> /checkout/tests/ui/consts/offset_ub.rs:13:44
   |
LL | pub const UNDERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MIN) }; //~NOTE

error[E0080]: evaluation of constant value failed
##[error]  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
   |
   |
   = note: out-of-bounds pointer arithmetic: expected a pointer to 2 bytes of memory, but got 0xffffffffffffffff[noalloc] which is a dangling pointer (it has no provenance)
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
note: inside `OVERFLOW_ADDRESS_SPACE`
  --> /checkout/tests/ui/consts/offset_ub.rs:14:56
  --> /checkout/tests/ui/consts/offset_ub.rs:14:56
   |
LL | pub const OVERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (usize::MAX as *const u8).offset(2) }; //~NOTE

error[E0080]: evaluation of constant value failed
##[error]  --> /rustc/FAKE_PREFIX/library/core/src/ptr/mut_ptr.rs:413:18
   |
   |
   = note: out-of-bounds pointer arithmetic: expected a pointer to 4 bytes of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
note: inside `std::ptr::mut_ptr::<impl *mut u8>::offset`
  --> /rustc/FAKE_PREFIX/library/core/src/ptr/mut_ptr.rs:413:18
note: inside `DANGLING`
  --> /checkout/tests/ui/consts/offset_ub.rs:19:42
  --> /checkout/tests/ui/consts/offset_ub.rs:19:42
   |
LL | pub const DANGLING: *const u8 = unsafe { ptr::NonNull::<u8>::dangling().as_ptr().offset(4) }; //~NOTE

error[E0080]: evaluation of constant value failed
##[error]  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
   |
   |
   = note: out-of-bounds pointer arithmetic: expected a pointer to the end of 9223372036854775808 bytes of memory, but got 0xffffffffffffffff[noalloc] which is a dangling pointer (it has no provenance)
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
note: inside `UNDERFLOW_ABS`
   |
   |
LL | pub const UNDERFLOW_ABS: *const u8 = unsafe { (usize::MAX as *const u8).offset(isize::MIN) }; //~NOTE

error[E0080]: evaluation of constant value failed
##[error]  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
   |
   |
   = note: out-of-bounds pointer arithmetic: expected a pointer to 1 byte of memory, but got alloc53 which is at or beyond the end of the allocation of size 0 bytes
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
note: inside `ZERO_SIZED_ALLOC`
  --> /checkout/tests/ui/consts/offset_ub.rs:18:50
  --> /checkout/tests/ui/consts/offset_ub.rs:18:50
   |
LL | pub const ZERO_SIZED_ALLOC: *const u8 = unsafe { [0u8; 0].as_ptr().offset(1) }; //~NOTE

error[E0080]: evaluation of constant value failed
##[error]  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
   |
   |
   = note: out-of-bounds pointer arithmetic: expected a pointer to the end of 2 bytes of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
note: inside `UNDERFLOW_ADDRESS_SPACE`
  --> /checkout/tests/ui/consts/offset_ub.rs:15:57
  --> /checkout/tests/ui/consts/offset_ub.rs:15:57
   |
LL | pub const UNDERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (1 as *const u8).offset(-2) }; //~NOTE

error[E0080]: evaluation of constant value failed
##[error]  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
   |
   |
   = note: out-of-bounds pointer arithmetic: expected a pointer to the end of 2 bytes of memory, but got alloc58-0x2 which points to before the beginning of the allocation
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
  --> /rustc/FAKE_PREFIX/library/core/src/ptr/const_ptr.rs:396:18
note: inside `NEGATIVE_OFFSET`
  --> /checkout/tests/ui/consts/offset_ub.rs:16:49
  --> /checkout/tests/ui/consts/offset_ub.rs:16:49
   |
LL | pub const NEGATIVE_OFFSET: *const u8 = unsafe { [0u8; 1].as_ptr().wrapping_offset(-2).offset(-2) }; //~NOTE

error: aborting due to 11 previous errors

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

- error[E0391]: cycle detected when computing the super predicates of `T1`
2   --> $DIR/issue-12511.rs:1:12
3    |
4 LL | trait T1 : T2 {
5    |            ^^
6    |
6    |
- note: ...which requires computing the super predicates of `T2`...
9    |
9    |
10 LL | trait T2 : T1 {
11    |            ^^
11    |            ^^
-    = note: ...which again requires computing the super predicates of `T1`, completing the cycle
- note: cycle used when checking that `T1` is well-formed
15    |
15    |
- LL | / trait T1 : T2 {
18 LL | | }
19    | |_^
19    | |_^
20    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information

The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/cycle-trait/issue-12511/issue-12511.stderr
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args cycle-trait/issue-12511.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/cycle-trait/issue-12511.rs" "-Zthreads=2" "-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/cycle-trait/issue-12511" "-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/cycle-trait/issue-12511/auxiliary"
--- stderr -------------------------------
error[E0391]: cycle detected when computing the super predicates of `T2`
##[error]  --> /checkout/tests/ui/cycle-trait/issue-12511.rs:5:12
   |
   |
LL | trait T2 : T1 {
   |
   |
note: ...which requires computing the super predicates of `T1`...
   |
   |
LL | trait T1 : T2 {
   |            ^^
   = note: ...which again requires computing the super predicates of `T2`, completing the cycle
note: cycle used when checking that `T2` is well-formed
   |
   |
LL | / trait T2 : T1 {
   | |_^
   | |_^
   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0391`.
------------------------------------------
---
4 LL | trait Foo {

5    | ^^^^^^^^^
6    |
- note: ...which requires computing type of `<impl at $DIR/unknown-lifetime-ice-119827.rs:8:1: 8:26>`...
8   --> $DIR/unknown-lifetime-ice-119827.rs:8:1
10 LL | impl Foo for Box<dyn Foo> {}

11    | ^^^^^^^^^^^^^^^^^^^^^^^^^
11    | ^^^^^^^^^^^^^^^^^^^^^^^^^
-    = note: ...which again requires finding trait impls of `Foo`, completing the cycle
- note: cycle used when checking that `Foo` is well-formed
14   --> $DIR/unknown-lifetime-ice-119827.rs:1:1
16 LL | trait Foo {


The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/generic-associated-types/unknown-lifetime-ice-119827/unknown-lifetime-ice-119827.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args generic-associated-types/unknown-lifetime-ice-119827.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/generic-associated-types/unknown-lifetime-ice-119827.rs" "-Zthreads=2" "-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/generic-associated-types/unknown-lifetime-ice-119827" "-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/generic-associated-types/unknown-lifetime-ice-119827/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0391]: cycle detected when computing type of `<impl at /checkout/tests/ui/generic-associated-types/unknown-lifetime-ice-119827.rs:8:1: 8:26>`
   |
LL | impl Foo for Box<dyn Foo> {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   |
note: ...which requires finding trait impls of `Foo`...
   |
LL | trait Foo {
   | ^^^^^^^^^
   | ^^^^^^^^^
   = note: ...which again requires computing type of `<impl at /checkout/tests/ui/generic-associated-types/unknown-lifetime-ice-119827.rs:8:1: 8:26>`, completing the cycle
note: cycle used when checking that `<impl at /checkout/tests/ui/generic-associated-types/unknown-lifetime-ice-119827.rs:8:1: 8:26>` is well-formed
   |
LL | impl Foo for Box<dyn Foo> {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^
   | ^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0391`.
------------------------------------------
---
4 LL | trait T1 = T2;

5    |            ^^
6    |
- note: ...which requires computing the super predicates of `T2`...
9    |
10 LL | trait T2 = T3;

14    |
14    |
15 LL | trait T3 = T1 + T3;
16    |            ^^
-    = note: ...which again requires computing the super predicates of `T1`, completing the cycle
18    = note: trait aliases cannot be recursive
- note: cycle used when checking that `T1` is well-formed
21    |
22 LL | trait T1 = T2;
23    | ^^^^^^^^^^^^^^

---
To only update this specific test, also pass `--test-args infinite/infinite-trait-alias-recursion.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/infinite/infinite-trait-alias-recursion.rs" "-Zthreads=2" "-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/infinite/infinite-trait-alias-recursion" "-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/infinite/infinite-trait-alias-recursion/auxiliary"
--- stderr -------------------------------
error[E0391]: cycle detected when computing the super predicates of `T2`
##[error]  --> /checkout/tests/ui/infinite/infinite-trait-alias-recursion.rs:6:12
   |
   |
LL | trait T2 = T3;
   |            ^^
   |
note: ...which requires computing the super predicates of `T3`...
   |
   |
LL | trait T3 = T1 + T3;
   |            ^^
note: ...which requires computing the super predicates of `T1`...
   |
LL | trait T1 = T2;
   |            ^^
   |            ^^
   = note: ...which again requires computing the super predicates of `T2`, completing the cycle
   = note: trait aliases cannot be recursive
note: cycle used when checking that `T2` is well-formed
   |
LL | trait T2 = T3;
   | ^^^^^^^^^^^^^^
   | ^^^^^^^^^^^^^^
   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0391`.
------------------------------------------
---
4 LL | type X1 = X2;

5    |           ^^
6    |
- note: ...which requires expanding type alias `X2`...
9    |
10 LL | type X2 = X3;

14    |
14    |
15 LL | type X3 = X1;
16    |           ^^
-    = note: ...which again requires expanding type alias `X1`, completing the cycle
18    = note: type aliases cannot be recursive
19    = help: consider using a struct, enum, or union instead to break the cycle
20    = help: see <https://doc.rust-lang.org/reference/types.html#recursive-types> for more information

- note: cycle used when checking that `X1` is well-formed
23    |
24 LL | type X1 = X2;
25    | ^^^^^^^

---
To only update this specific test, also pass `--test-args infinite/infinite-type-alias-mutual-recursion.rs`

error in revision `gated`: 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/infinite/infinite-type-alias-mutual-recursion.rs" "-Zthreads=2" "-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" "gated" "--check-cfg" "cfg(FALSE,feature,gated)" "--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/infinite/infinite-type-alias-mutual-recursion.gated" "-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/infinite/infinite-type-alias-mutual-recursion.gated/auxiliary"
--- stderr -------------------------------
error[E0391]: cycle detected when expanding type alias `X2`
##[error]  --> /checkout/tests/ui/infinite/infinite-type-alias-mutual-recursion.rs:9:11
   |
   |
LL | type X2 = X3;
   |           ^^
   |
note: ...which requires expanding type alias `X3`...
   |
LL | type X3 = X1;
   |           ^^
   |           ^^
note: ...which requires expanding type alias `X1`...
   |
LL | type X1 = X2;
   |           ^^
   |           ^^
   = note: ...which again requires expanding type alias `X2`, completing the cycle
   = note: type aliases cannot be recursive
   = help: consider using a struct, enum, or union instead to break the cycle
   = help: see <https://doc.rust-lang.org/reference/types.html#recursive-types> for more information
note: cycle used when checking that `X2` is well-formed
   |
LL | type X2 = X3;
   | ^^^^^^^
   | ^^^^^^^
   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to 1 previous error

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


---- [ui] tests/ui/invalid-compile-flags/fuel.rs#incremental stdout ----

error in revision `incremental`: error pattern 'optimization fuel is incompatible with incremental compilation' not found!
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/invalid-compile-flags/fuel.rs" "-Zthreads=2" "-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" "incremental" "--check-cfg" "cfg(FALSE,incremental,threads)" "-C" "incremental=/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/invalid-compile-flags/fuel.incremental/fuel.inc" "-Z" "incremental-verify-ich" "--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/invalid-compile-flags/fuel.incremental" "-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/invalid-compile-flags/fuel.incremental/auxiliary" "-Zprint-fuel=a"
--- stderr -------------------------------
error: optimization fuel is incompatible with multiple threads
------------------------------------------



---- [ui] tests/ui/issues/issue-34373.rs stdout ----
diff of stderr:

- error[E0391]: cycle detected when computing type of `Foo::T`
2   --> $DIR/issue-34373.rs:7:30
3    |
4 LL | pub struct Foo<T = Box<Trait<DefaultFoo>>>;
5    |                              ^^^^^^^^^^
6    |
6    |
- note: ...which requires expanding type alias `DefaultFoo`...
9    |
10 LL | type DefaultFoo = Foo;

11    |                   ^^^
11    |                   ^^^
-    = note: ...which again requires computing type of `Foo::T`, completing the cycle
- note: cycle used when checking that `Foo` is well-formed
15    |
15    |
16 LL | pub struct Foo<T = Box<Trait<DefaultFoo>>>;
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
20 error[E0038]: the trait `Trait` cannot be made into an object


The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-34373/issue-34373.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args issues/issue-34373.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-34373.rs" "-Zthreads=2" "-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-34373" "-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-34373/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0391]: cycle detected when expanding type alias `DefaultFoo`
   |
LL | type DefaultFoo = Foo;
   |                   ^^^
   |
   |
note: ...which requires computing type of `Foo::T`...
   |
   |
LL | pub struct Foo<T = Box<Trait<DefaultFoo>>>;  //~ ERROR cycle detected
   |                              ^^^^^^^^^^
   = note: ...which again requires expanding type alias `DefaultFoo`, completing the cycle
note: cycle used when checking that `DefaultFoo` is well-formed
   |
LL | type DefaultFoo = Foo;
   | ^^^^^^^^^^^^^^^
   | ^^^^^^^^^^^^^^^
   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error[E0038]: the trait `Trait` cannot be made into an object
##[error]  --> /checkout/tests/ui/issues/issue-34373.rs:7:24
   |
   |
LL | pub struct Foo<T = Box<Trait<DefaultFoo>>>;  //~ ERROR cycle detected
   |                        ^^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
  --> /checkout/tests/ui/issues/issue-34373.rs:4:8
   |
LL | trait Trait<T> {
LL | trait Trait<T> {
   |       ----- this trait cannot be made into an object...
LL |     fn foo(_: T) {}
   |        ^^^ ...because associated function `foo` has no `self` parameter
help: consider turning `foo` into a method by giving it a `&self` argument
LL |     fn foo(&self, _: T) {}
   |            ++++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
   |
   |
LL |     fn foo(_: T) where Self: Sized {}

error[E0392]: type parameter `T` is never used
##[error]  --> /checkout/tests/ui/issues/issue-34373.rs:7:16
   |
   |
LL | pub struct Foo<T = Box<Trait<DefaultFoo>>>;  //~ ERROR cycle detected
   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^ unused type parameter
   |
   = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
   = help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0038, E0391, E0392.
For more information about an error, try `rustc --explain E0038`.
---

9    |
10 LL | const A: i32 = B;
11    |                ^
- note: ...which requires simplifying constant for the type system `B`...
14    |
14    |
15 LL | const B: i32 = A;
19    |
19    |
20 LL | const B: i32 = A;
21    |                ^
-    = note: ...which again requires simplifying constant for the type system `A`, completing the cycle
23    = note: cycle used when running analysis passes on this crate
24    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/recursion/issue-23302-3/issue-23302-3.stderr
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/recursion/issue-23302-3/issue-23302-3.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args recursion/issue-23302-3.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/recursion/issue-23302-3.rs" "-Zthreads=2" "-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/recursion/issue-23302-3" "-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/recursion/issue-23302-3/auxiliary"
--- stderr -------------------------------
error[E0391]: cycle detected when simplifying constant for the type system `B`
##[error]  --> /checkout/tests/ui/recursion/issue-23302-3.rs:3:1
   |
   |
LL | const B: i32 = A;
   |
   |
note: ...which requires const-evaluating + checking `B`...
   |
   |
LL | const B: i32 = A;
   |                ^
note: ...which requires simplifying constant for the type system `A`...
   |
   |
LL | const A: i32 = B; //~ ERROR cycle detected
   | ^^^^^^^^^^^^
note: ...which requires const-evaluating + checking `A`...
   |
   |
LL | const A: i32 = B; //~ ERROR cycle detected
   |                ^
   = note: ...which again requires simplifying constant for the type system `B`, completing the cycle
   = note: cycle used when running analysis passes on this crate
   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: aborting due to 1 previous error

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


---- [ui] tests/ui/type-alias-impl-trait/in-where-clause.rs stdout ----
diff of stderr:

- error[E0391]: cycle detected when computing type of `Bar::{opaque#0}`
3    |
4 LL | type Bar = impl Sized;

5    |            ^^^^^^^^^^
5    |            ^^^^^^^^^^
6    |
- note: ...which requires computing type of opaque `Bar::{opaque#0}`...
9    |
10 LL | type Bar = impl Sized;

17 LL | |     Bar: Send,
17 LL | |     Bar: Send,
18    | |______________^
19    = note: ...which requires revealing opaque types in `[Binder { value: TraitPredicate(<Bar as core::marker::Send>, polarity:Positive), bound_vars: [] }]`...
-    = note: ...which again requires computing type of `Bar::{opaque#0}`, completing the cycle
- note: cycle used when checking that `Bar::{opaque#0}` is well-formed
23    |
24 LL | type Bar = impl Sized;



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/type-alias-impl-trait/in-where-clause/in-where-clause.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/in-where-clause.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/in-where-clause.rs" "-Zthreads=2" "-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/in-where-clause" "-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/in-where-clause/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0391]: cycle detected when computing type of opaque `Bar::{opaque#0}`
   |
LL | type Bar = impl Sized;
   |            ^^^^^^^^^^
   |
   |
note: ...which requires type-checking `foo`...
   |
LL | / fn foo() -> Bar
LL | | where
LL | |     Bar: Send,
LL | |     Bar: Send,
   | |______________^
   = note: ...which requires revealing opaque types in `[Binder { value: TraitPredicate(<Bar as core::marker::Send>, polarity:Positive), bound_vars: [] }]`...
note: ...which requires computing type of `Bar::{opaque#0}`...
   |
LL | type Bar = impl Sized;
   |            ^^^^^^^^^^
   |            ^^^^^^^^^^
   = note: ...which again requires computing type of opaque `Bar::{opaque#0}`, completing the cycle
   = note: cycle used when evaluating trait selection obligation `Bar: core::marker::Send`
   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error[E0283]: type annotations needed: cannot satisfy `Bar: Send`
##[error]  --> /checkout/tests/ui/type-alias-impl-trait/in-where-clause.rs:12:9
   |
   |
LL |     [0; 1 + 2]
   |
   = note: cannot satisfy `Bar: Send`
note: required by a bound in `foo`
  --> /checkout/tests/ui/type-alias-impl-trait/in-where-clause.rs:10:10
---

---- [ui] tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.rs stdout ----
diff of stderr:

25 LL | trait Bar<const M: dyn Foo<2>> {}
27 
- error[E0391]: cycle detected when computing type of `Foo::N`
29   --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:2:11
30    |
30    |
31 LL | trait Foo<const N: Bar<2>> {
32    |           ^^^^^^^^^^^^^^^
33    |
33    |
- note: ...which requires computing type of `Bar::M`...
36    |
36    |
37 LL | trait Bar<const M: Foo<2>> {}
38    |           ^^^^^^^^^^^^^^^
38    |           ^^^^^^^^^^^^^^^
-    = note: ...which again requires computing type of `Foo::N`, completing the cycle
- note: cycle used when computing explicit predicates of trait `Foo`
42    |
42    |
43 LL | trait Foo<const N: Bar<2>> {


45    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
47 error[E0038]: the trait `Foo` cannot be made into an object
-   --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:2:24
49    |
49    |
50 LL | trait Foo<const N: Bar<2>> {
-    |                        ^ `Foo` cannot be made into an object
53 note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
54   --> $DIR/ice-hir-wf-check-anon-const-issue-122989.rs:8:8

106    |
---
To only update this specific test, also pass `--test-args wf/ice-hir-wf-check-anon-const-issue-122989.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/wf/ice-hir-wf-check-anon-const-issue-122989.rs" "-Zthreads=2" "-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/wf/ice-hir-wf-check-anon-const-issue-122989" "-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/wf/ice-hir-wf-check-anon-const-issue-122989/auxiliary"
--- stderr -------------------------------
warning: trait objects without an explicit `dyn` are deprecated
##[warning]  --> /checkout/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.rs:11:20
   |
   |
LL | trait Bar<const M: Foo<2>> {}
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
   = note: `#[warn(bare_trait_objects)]` on by default
   = note: `#[warn(bare_trait_objects)]` on by default
help: if this is an object-safe trait, use `dyn`
   |
LL | trait Bar<const M: dyn Foo<2>> {}

warning: trait objects without an explicit `dyn` are deprecated
##[warning]  --> /checkout/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.rs:2:20
   |
   |
LL | trait Foo<const N: Bar<2>> {
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: if this is an object-safe trait, use `dyn`
help: if this is an object-safe trait, use `dyn`
   |
LL | trait Foo<const N: dyn Bar<2>> {


error[E0391]: cycle detected when computing type of `Bar::M`
   |
   |
LL | trait Bar<const M: Foo<2>> {}
   |
   |
note: ...which requires computing type of `Foo::N`...
   |
   |
LL | trait Foo<const N: Bar<2>> {
   |           ^^^^^^^^^^^^^^^
   = note: ...which again requires computing type of `Bar::M`, completing the cycle
note: cycle used when computing explicit predicates of trait `Bar`
   |
   |
LL | trait Bar<const M: Foo<2>> {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information

error: `(dyn Bar<2> + 'static)` is forbidden as the type of a const generic parameter
   |
   |
LL | trait Foo<const N: Bar<2>> {
   |
   = note: the only supported types are integers, `bool` and `char`

error[E0038]: the trait `Foo` cannot be made into an object
error[E0038]: the trait `Foo` cannot be made into an object
##[error]  --> /checkout/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.rs:11:11
   |
LL | trait Bar<const M: Foo<2>> {}
   |           ^^^^^^^^^^^^^^^ `Foo` cannot be made into an object
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
  --> /checkout/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122989.rs:8:8
   |
   |
LL | trait Foo<const N: Bar<2>> {
...
LL |     fn func() {}
LL |     fn func() {}
   |        ^^^^ ...because associated function `func` has no `self` parameter
help: consider turning `func` into a method by giving it a `&self` argument
LL |     fn func(&self) {}
   |             +++++
   |             +++++
help: alternatively, consider constraining `func` so it does not apply to trait objects
   |
LL |     fn func() where Self: Sized {}


error: `(dyn Foo<2> + 'static)` is forbidden as the type of a const generic parameter
   |
   |
LL | trait Bar<const M: Foo<2>> {}
   |
   = note: the only supported types are integers, `bool` and `char`

error: aborting due to 4 previous errors; 2 warnings emitted

@bors
Copy link
Contributor

bors commented Sep 10, 2024

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

@SparrowLii SparrowLii marked this pull request as draft September 11, 2024 00:41
@SparrowLii
Copy link
Member Author

The main value of this PR draft is to find potential bugs, which has been completed and this PR is closed.

@SparrowLii SparrowLii closed this Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc 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. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants