compiler: Do not ICE when union fields have invalid reprs
Surprising no one, the ICEs with the same message have the same root cause.
Invalid reprs can reach layout computation for various reasons. For instance, the compiler may want to use its layout computations to discern if a combination of layout-affecting attributes results in a valid type to begin with. Do not force these to be handled immediately, but delay the bug.
We're about to massively churn the internals of rustc_abi. To minimize the immediate and future impact on rust-analyzer, as a subtree that depends on this crate, grow some API on LayoutCalculatorError for serving their needs. This way they can just call functions on the type and don't have to inspect its innards.
- Closes #126966
- Closes #128870
For more on the "massively churn" part, see https://github.com/rust-lang/rust/issues/119183
r? @cjgillot
rustbot has assigned @cjgillot. 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
The job mingw-check failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
#16 3.174 Building wheels for collected packages: reuse
#16 3.175 Building wheel for reuse (pyproject.toml): started
#16 3.458 Building wheel for reuse (pyproject.toml): finished with status 'done'
#16 3.459 Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132720 sha256=026f3bb0f1aa8090b861fd0a0939cb1a782396d84c8aab7875096557d637a0f6
#16 3.459 Stored in directory: /tmp/pip-ephem-wheel-cache-o3i8sv2b/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#16 3.462 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#16 3.898 Successfully installed attrs-23.2.0 binaryornot-0.4.4 boolean-py-4.0 chardet-5.2.0 jinja2-3.1.4 license-expression-30.3.0 markupsafe-2.1.5 python-debian-0.1.49 reuse-4.0.3 tomlkit-0.13.0
#16 3.899 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#16 DONE 4.0s
---
|
117 | match err {
| ^^^ pattern `LayoutCalculatorError::ReprConflict` not covered
|
note: `LayoutCalculatorError<F>` defined here
|
43 | pub enum LayoutCalculatorError<F> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
...
59 | ReprConflict,
| ------------ not covered
= note: the matched value is of type `LayoutCalculatorError<F>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
120 ~ LayoutCalculatorError::SizeOverflow => LayoutError::SizeOverflow,
121 ~ LayoutCalculatorError::ReprConflict => todo!(),
Checking crc32fast v1.4.2
Checking libloading v0.8.5
For more information about this error, try `rustc --explain E0004`.
rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.
cc @rust-lang/rust-analyzer
The job mingw-check failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
#16 2.708 Building wheels for collected packages: reuse
#16 2.709 Building wheel for reuse (pyproject.toml): started
#16 2.955 Building wheel for reuse (pyproject.toml): finished with status 'done'
#16 2.957 Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132720 sha256=026f3bb0f1aa8090b861fd0a0939cb1a782396d84c8aab7875096557d637a0f6
#16 2.957 Stored in directory: /tmp/pip-ephem-wheel-cache-6a0cjpzs/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#16 2.959 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#16 3.350 Successfully installed attrs-23.2.0 binaryornot-0.4.4 boolean-py-4.0 chardet-5.2.0 jinja2-3.1.4 license-expression-30.3.0 markupsafe-2.1.5 python-debian-0.1.49 reuse-4.0.3 tomlkit-0.13.0
#16 3.350 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#16 DONE 3.4s
No idea why my brain insisted it wasn't fully imported.
The job mingw-check failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
#16 2.716 Building wheels for collected packages: reuse
#16 2.717 Building wheel for reuse (pyproject.toml): started
#16 2.962 Building wheel for reuse (pyproject.toml): finished with status 'done'
#16 2.963 Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132720 sha256=026f3bb0f1aa8090b861fd0a0939cb1a782396d84c8aab7875096557d637a0f6
#16 2.963 Stored in directory: /tmp/pip-ephem-wheel-cache-3lo2l4ic/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#16 2.966 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#16 3.361 Successfully installed attrs-23.2.0 binaryornot-0.4.4 boolean-py-4.0 chardet-5.2.0 jinja2-3.1.4 license-expression-30.3.0 markupsafe-2.1.5 python-debian-0.1.49 reuse-4.0.3 tomlkit-0.13.0
#16 3.362 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#16 DONE 3.5s
---
Checking process-wrap v8.0.2
Checking xshell v0.2.6
Checking scip v0.5.1
Checking toml v0.8.19
error[E0369]: binary operation `==` cannot be applied to type `&LayoutCalculatorError<()>`
|
73 | #[derive(Debug, PartialEq, Eq, Clone)]
| --------- in this derive macro expansion
...
---
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `LayoutCalculatorError<()>`
|
::: /checkout/library/core/src/cmp.rs:352:1
|
352 | pub macro Eq($item:item) {
| ------------ in this expansion of `#[derive(Eq)]`
note: required by a bound in `AssertParamIsEq`
--> /checkout/library/core/src/cmp.rs:363:31
|
|
363 | pub struct AssertParamIsEq<T: Eq + ?Sized> {
| ^^ required by this bound in `AssertParamIsEq`
Checking dirs v5.0.1
Checking lsp-server v0.7.7
Compiling proc-macro-srv v0.0.0 (/checkout/src/tools/rust-analyzer/crates/proc-macro-srv)
Checking miniz_oxide v0.7.4
huh, I thought ./x.py test rust-analyzer would've...
oddly ./x.py build rust-analyzer works but ./x.py test rust-analyzer doesn't.
I'll take it, I guess!
Yeah, the r-a test suite doesn't get run (and probably doesn't pass, I think there were some issues on i386).
The job x86_64-gnu-llvm-18 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
------
> importing cache manifest from ghcr.io/rust-lang/rust-ci-cache:c32c805632780b5c1de330e3f44561b336c2efe163bc0990acb392390157a8e1d9f855d75914a239aa40c49d77f4a837247d05d2f8d46f554b98e1f46712a3e3:
------
##[endgroup]
Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-18]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-18', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--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-18/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
........................................................................................ 8624/17825
..........................i............................................................i 8712/17825
i.ii........i....i...................................................................... 8800/17825
.............................i........i.....
[ui] tests/ui/layout/thaw-validate-invalid-enum.rs ... F
[ui] tests/ui/layout/thaw-transmute-invalid-enum.rs ... F
...................................... 8888/17825
........................................................................................ 8976/17825
........................................................................................ 9064/17825
---
.................................................
failures:
---- [ui] tests/ui/layout/thaw-validate-invalid-enum.rs stdout ----
error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
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/layout/thaw-validate-invalid-enum.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/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/layout/thaw-validate-invalid-enum" "-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/layout/thaw-validate-invalid-enum/auxiliary" "-Zvalidate-mir"
--- stderr -------------------------------
error[E0517]: attribute should be applied to a struct or union
error[E0517]: attribute should be applied to a struct or union
##[error] --> /checkout/tests/ui/layout/thaw-validate-invalid-enum.rs:4:8
LL | #[repr(packed)]
| ^^^^^^
LL | #[repr(u32)]
LL | / enum E {
LL | / enum E {
LL | | A,
LL | | B,
LL | | C,
LL | | }
| |_- not a struct or union
error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
##[error] --> /checkout/tests/ui/layout/thaw-validate-invalid-enum.rs:15:9
LL | e: E,
| ^^^^
|
|
= note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
help: wrap the field type in `ManuallyDrop<...>`
|
LL | e: std::mem::ManuallyDrop<E>,
| +++++++++++++++++++++++ +
thread 'rustc' panicked at compiler/rustc_ty_utils/src/layout_sanity_check.rs:79:9:
assertion `left == right` failed: alignment mismatch between ABI and layout in TyAndLayout {
ty: E,
layout: Layout {
layout: Layout {
size: Size(4 bytes),
align: AbiAndPrefAlign {
abi: Align(1 bytes),
pref: Align(8 bytes),
abi: Scalar(
Initialized {
value: Int(
I32,
---
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
size: Size(4 bytes),
align: AbiAndPrefAlign {
abi: Align(1 bytes),
pref: Align(1 bytes),
abi: Aggregate {
sized: true,
},
fields: Arbitrary {
---
max_repr_align: None,
unadjusted_abi_align: Align(1 bytes),
},
Layout {
size: Size(4 bytes),
align: AbiAndPrefAlign {
abi: Align(1 bytes),
pref: Align(1 bytes),
abi: Aggregate {
sized: true,
},
fields: Arbitrary {
---
max_repr_align: None,
unadjusted_abi_align: Align(1 bytes),
},
Layout {
size: Size(4 bytes),
align: AbiAndPrefAlign {
abi: Align(1 bytes),
pref: Align(1 bytes),
abi: Aggregate {
sized: true,
},
fields: Arbitrary {
---
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::assert_failed_inner
3: core::panicking::assert_failed::<rustc_abi::Align, rustc_abi::Align>
4: rustc_ty_utils::layout::layout_of
[... omitted 2 frames ...]
5: <rustc_middle::ty::layout::LayoutCx as rustc_middle::ty::layout::LayoutOf>::spanned_layout_of
6: <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}> as core::iter::traits::iterator::Iterator>::try_fold::<(), <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::try_fold<(), core::iter::traits::iterator::Iterator::try_for_each::call<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>, core::ops::control_flow::ControlFlow<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>, core::ops::control_flow::ControlFlow<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>::Break>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>::{closure#0}, core::ops::control_flow::ControlFlow<core::ops::control_flow::ControlFlow<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>
7: <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::next
8: <alloc::vec::Vec<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>, core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>>>>::from_iter
9: core::iter::adapters::try_process::<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}>>, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>, <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}> as core::iter::traits::iterator::Iterator>::try_collect<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>::{closure#0}, rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>
10: <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}> as core::iter::traits::iterator::Iterator>::try_fold::<(), <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::try_fold<(), core::iter::traits::iterator::Iterator::try_for_each::call<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>, core::ops::control_flow::ControlFlow<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>, core::ops::control_flow::ControlFlow<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>::Break>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>::{closure#0}, core::ops::control_flow::ControlFlow<core::ops::control_flow::ControlFlow<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>>
11: <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::next
12: <alloc::vec::Vec<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>, core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>>>>::from_iter
13: core::iter::adapters::try_process::<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}>>, rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>, <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}> as core::iter::traits::iterator::Iterator>::try_collect<rustc_index::vec::IndexVec<rustc_abi::layout::ty::VariantIdx, rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>::{closure#0}, rustc_index::vec::IndexVec<rustc_abi::layout::ty::VariantIdx, rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>
14: rustc_ty_utils::layout::layout_of_uncached
15: rustc_ty_utils::layout::layout_of
[... omitted 2 frames ...]
16: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::Ty>, rustc_middle::query::erase::Erased<[u8; 16]>>>
17: <rustc_mir_transform::remove_zsts::Replacer as rustc_middle::mir::visit::MutVisitor>::visit_var_debug_info
18: <rustc_mir_transform::remove_zsts::RemoveZsts as rustc_mir_transform::pass_manager::MirPass>::run_pass
20: rustc_mir_transform::optimized_mir
20: rustc_mir_transform::optimized_mir
[... omitted 2 frames ...]
21: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>>
22: <rustc_middle::ty::context::TyCtxt>::instance_mir
23: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_interface::passes::run_required_analyses::{closure#7}::{closure#0}>::{closure#0}>::{closure#0}::{closure#1}::{closure#0}>
24: <rustc_session::session::Session>::time::<(), rustc_interface::passes::run_required_analyses::{closure#7}>
25: rustc_interface::passes::analysis
[... omitted 2 frames ...]
27: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
28: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
29: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
note: please make sure that you have updated to the latest nightly
note: rustc 1.84.0-nightly (2f3d2da4c 2024-10-17) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0 -Z validate-mir
query stack during panic:
#0 [layout_of] computing layout of `E`
#1 [layout_of] computing layout of `main::InvalidTag`
#2 [optimized_mir] optimizing MIR for `main`
---
---- [ui] tests/ui/layout/thaw-transmute-invalid-enum.rs stdout ----
error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
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/layout/thaw-transmute-invalid-enum.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/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/layout/thaw-transmute-invalid-enum" "-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/layout/thaw-transmute-invalid-enum/auxiliary"
--- stderr -------------------------------
error[E0412]: cannot find type `Subset` in this scope
##[error] --> /checkout/tests/ui/layout/thaw-transmute-invalid-enum.rs:28:41
|
|
LL | assert::is_transmutable::<Superset, Subset>();
|
help: you might be missing a type parameter
|
|
LL | fn test<Subset>() {
error[E0601]: `main` function not found in crate `thaw_transmute_invalid_enum`
##[error] --> /checkout/tests/ui/layout/thaw-transmute-invalid-enum.rs:29:2
|
|
LL | }
| ^ consider adding a `main` function to `/checkout/tests/ui/layout/thaw-transmute-invalid-enum.rs`
error[E0517]: attribute should be applied to a struct or union
##[error] --> /checkout/tests/ui/layout/thaw-transmute-invalid-enum.rs:17:11
|
|
LL | #[repr(C, packed(2))]
LL | / enum OxFF {
LL | | V = 0xFF,
LL | | }
| |_- not a struct or union
---
LL | use std::mem::{Assume, TransmuteFrom};
| ^^^^^^
|
= note: see issue #99571 <https://github.com/rust-lang/rust/issues/99571> for more information
= help: add `#![feature(transmutability)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: use of unstable library feature 'transmutability'
##[error] --> /checkout/tests/ui/layout/thaw-transmute-invalid-enum.rs:3:28
|
LL | use std::mem::{Assume, TransmuteFrom};
LL | use std::mem::{Assume, TransmuteFrom};
| ^^^^^^^^^^^^^
|
= note: see issue #99571 <https://github.com/rust-lang/rust/issues/99571> for more information
= help: add `#![feature(transmutability)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: use of unstable library feature 'transmutability'
##[error] --> /checkout/tests/ui/layout/thaw-transmute-invalid-enum.rs:7:14
|
LL | Dst: TransmuteFrom<Src>,
LL | Dst: TransmuteFrom<Src>,
| ^^^^^^^^^^^^^^^^^^
|
= note: see issue #99571 <https://github.com/rust-lang/rust/issues/99571> for more information
= help: add `#![feature(transmutability)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
##[error] --> /checkout/tests/ui/layout/thaw-transmute-invalid-enum.rs:24:9
|
LL | a: Ox00,
|
|
= note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
help: wrap the field type in `ManuallyDrop<...>`
|
LL | a: std::mem::ManuallyDrop<Ox00>,
thread 'rustc' panicked at compiler/rustc_ty_utils/src/layout_sanity_check.rs:79:9:
assertion `left == right` failed: alignment mismatch between ABI and layout in TyAndLayout {
assertion `left == right` failed: alignment mismatch between ABI and layout in TyAndLayout {
ty: OxFF,
layout: Layout {
size: Size(4 bytes),
align: AbiAndPrefAlign {
abi: Align(2 bytes),
pref: Align(8 bytes),
abi: Scalar(
Initialized {
value: Int(
I32,
---
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
size: Size(4 bytes),
align: AbiAndPrefAlign {
abi: Align(2 bytes),
pref: Align(2 bytes),
abi: Aggregate {
sized: true,
},
fields: Arbitrary {
---
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::assert_failed_inner
3: core::panicking::assert_failed::<rustc_abi::Align, rustc_abi::Align>
4: rustc_ty_utils::layout::layout_of
[... omitted 2 frames ...]
5: <rustc_middle::ty::layout::LayoutCx as rustc_middle::ty::layout::LayoutOf>::spanned_layout_of
6: <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}> as core::iter::traits::iterator::Iterator>::try_fold::<(), <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::try_fold<(), core::iter::traits::iterator::Iterator::try_for_each::call<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>, core::ops::control_flow::ControlFlow<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>, core::ops::control_flow::ControlFlow<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>::Break>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>::{closure#0}, core::ops::control_flow::ControlFlow<core::ops::control_flow::ControlFlow<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>
7: <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::next
8: <alloc::vec::Vec<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>, core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>>>>::from_iter
9: core::iter::adapters::try_process::<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}>>, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>, <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}> as core::iter::traits::iterator::Iterator>::try_collect<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>::{closure#0}, rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>
10: <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}> as core::iter::traits::iterator::Iterator>::try_fold::<(), <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::try_fold<(), core::iter::traits::iterator::Iterator::try_for_each::call<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>, core::ops::control_flow::ControlFlow<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>, core::ops::control_flow::ControlFlow<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>::Break>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>::{closure#0}, core::ops::control_flow::ControlFlow<core::ops::control_flow::ControlFlow<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>>
11: <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::next
12: <alloc::vec::Vec<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>, core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>>>>::from_iter
13: core::iter::adapters::try_process::<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}>>, rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>, <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}> as core::iter::traits::iterator::Iterator>::try_collect<rustc_index::vec::IndexVec<rustc_abi::layout::ty::VariantIdx, rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>::{closure#0}, rustc_index::vec::IndexVec<rustc_abi::layout::ty::VariantIdx, rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>
14: rustc_ty_utils::layout::layout_of_uncached
15: rustc_ty_utils::layout::layout_of
[... omitted 2 frames ...]
16: rustc_transmute::layout::rustc::layout_of
17: <rustc_transmute::layout::tree::Tree<rustc_transmute::layout::rustc::Def, rustc_transmute::layout::rustc::Ref>>::from_ty
18: <rustc_transmute::maybe_transmutable::MaybeTransmutableQuery<rustc_middle::ty::Ty, rustc_middle::ty::context::TyCtxt>>::answer
19: <rustc_transmute::rustc::TransmuteTypeEnv>::is_transmutable
20: <rustc_trait_selection::traits::select::SelectionContext>::confirm_candidate
21: <rustc_trait_selection::traits::select::SelectionContext>::evaluation_probe::<<rustc_trait_selection::traits::select::SelectionContext>::evaluate_candidate::{closure#0}::{closure#0}>::{closure#0}
22: <rustc_infer::infer::InferCtxt>::probe::<core::result::Result<rustc_middle::traits::select::EvaluationResult, rustc_middle::traits::select::OverflowError>, <rustc_trait_selection::traits::select::SelectionContext>::evaluation_probe<<rustc_trait_selection::traits::select::SelectionContext>::evaluate_candidate::{closure#0}::{closure#0}>::{closure#0}>
24: <rustc_trait_selection::traits::select::SelectionContext>::evaluate_trait_predicate_recursively::{closure#0}::{closure#1}
25: <rustc_trait_selection::traits::select::SelectionContext>::evaluate_trait_predicate_recursively
26: <rustc_trait_selection::traits::select::SelectionContext>::evaluate_predicate_recursively
27: <rustc_trait_selection::traits::select::SelectionContext>::evaluation_probe::<<rustc_trait_selection::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>::{closure#0}
27: <rustc_trait_selection::traits::select::SelectionContext>::evaluation_probe::<<rustc_trait_selection::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>::{closure#0}
28: <rustc_infer::infer::InferCtxt>::probe::<core::result::Result<rustc_middle::traits::select::EvaluationResult, rustc_middle::traits::select::OverflowError>, <rustc_trait_selection::traits::select::SelectionContext>::evaluation_probe<<rustc_trait_selection::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>::{closure#0}>
29: rustc_traits::evaluate_obligation::evaluate_obligation
[... omitted 2 frames ...]
31: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation_no_overflow
31: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation_no_overflow
32: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
33: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
34: <rustc_trait_selection::traits::fulfill::FulfillmentContext<rustc_trait_selection::traits::FulfillmentError> as rustc_infer::traits::engine::TraitEngine<rustc_trait_selection::traits::FulfillmentError>>::select_where_possible
35: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
36: <rustc_hir_typeck::fn_ctxt::FnCtxt>::confirm_builtin_call
37: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
38: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
39: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation
40: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
41: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
42: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
43: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation
44: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
45: rustc_hir_typeck::check::check_fn
46: rustc_hir_typeck::typeck
[... omitted 2 frames ...]
47: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_hir_analysis::check_crate::{closure#4}>::{closure#0}
48: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_hir_analysis::check_crate::{closure#4}>::{closure#0}>::{closure#0}::{closure#0}::{closure#0}>
50: rustc_interface::passes::analysis
50: rustc_interface::passes::analysis
[... omitted 2 frames ...]
52: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
53: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
54: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
note: please make sure that you have updated to the latest nightly
note: rustc 1.84.0-nightly (2f3d2da4c 2024-10-17) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
#0 [layout_of] computing layout of `OxFF`
#1 [layout_of] computing layout of `test::Superset`
#1 [layout_of] computing layout of `test::Superset`
#2 [evaluate_obligation] evaluating trait selection obligation `{type error}: core::mem::transmutability::TransmuteFrom<test::Superset, core::mem::transmutability::Assume { alignment: false, lifetimes: false, safety: false, validity: false }>`
#3 [typeck] type-checking `test`
end of query stack
error: aborting due to 7 previous errors
Some errors have detailed explanations: E0412, E0517, E0601, E0658, E0740.
Some errors have detailed explanations: E0412, E0517, E0601, E0658, E0740.
For more information about an error, try `rustc --explain E0412`.
------------------------------------------
failures:
[ui] tests/ui/layout/thaw-validate-invalid-enum.rs
[ui] tests/ui/layout/thaw-transmute-invalid-enum.rs
test result: FAILED. 17649 passed; 2 failed; 174 ignored; 0 measured; 0 filtered out; finished in 166.07s
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
Build completed unsuccessfully in 0:17:35
The job x86_64-gnu-llvm-18 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
------
> importing cache manifest from ghcr.io/rust-lang/rust-ci-cache:c32c805632780b5c1de330e3f44561b336c2efe163bc0990acb392390157a8e1d9f855d75914a239aa40c49d77f4a837247d05d2f8d46f554b98e1f46712a3e3:
------
##[endgroup]
Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-18]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-18', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--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-18/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
........................................................................................ 8624/17825
..........................i............................................................i 8712/17825
i.ii........i....i...................................................................... 8800/17825
.............................i........i........
[ui] tests/ui/layout/thaw-validate-invalid-enum.rs ... F
[ui] tests/ui/layout/thaw-transmute-invalid-enum.rs ... F
...................................... 8888/17825
........................................................................................ 8976/17825
........................................................................................ 9064/17825
---
.................................................
failures:
---- [ui] tests/ui/layout/thaw-validate-invalid-enum.rs stdout ----
error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
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/layout/thaw-validate-invalid-enum.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/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/layout/thaw-validate-invalid-enum" "-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/layout/thaw-validate-invalid-enum/auxiliary" "-Zvalidate-mir"
--- stderr -------------------------------
error[E0517]: attribute should be applied to a struct or union
error[E0517]: attribute should be applied to a struct or union
##[error] --> /checkout/tests/ui/layout/thaw-validate-invalid-enum.rs:3:8
|
LL | #[repr(packed)] //~ ERROR: attribute should be applied to a struct
LL | #[repr(u32)]
LL | / enum E {
LL | | A,
LL | | B,
LL | | B,
LL | | C,
LL | | }
| |_- not a struct or union
error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
##[error] --> /checkout/tests/ui/layout/thaw-validate-invalid-enum.rs:14:9
|
LL | e: E, //~ ERROR: field must implement `Copy`
|
|
= note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
help: wrap the field type in `ManuallyDrop<...>`
|
LL | e: std::mem::ManuallyDrop<E>, //~ ERROR: field must implement `Copy`
| +++++++++++++++++++++++ +
thread 'rustc' panicked at compiler/rustc_ty_utils/src/layout_sanity_check.rs:79:9:
assertion `left == right` failed: alignment mismatch between ABI and layout in TyAndLayout {
ty: E,
layout: Layout {
layout: Layout {
size: Size(4 bytes),
align: AbiAndPrefAlign {
abi: Align(1 bytes),
pref: Align(8 bytes),
abi: Scalar(
Initialized {
value: Int(
I32,
---
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
size: Size(4 bytes),
align: AbiAndPrefAlign {
abi: Align(1 bytes),
pref: Align(1 bytes),
abi: Aggregate {
sized: true,
},
fields: Arbitrary {
---
max_repr_align: None,
unadjusted_abi_align: Align(1 bytes),
},
Layout {
size: Size(4 bytes),
align: AbiAndPrefAlign {
abi: Align(1 bytes),
pref: Align(1 bytes),
abi: Aggregate {
sized: true,
},
fields: Arbitrary {
---
max_repr_align: None,
unadjusted_abi_align: Align(1 bytes),
},
Layout {
size: Size(4 bytes),
align: AbiAndPrefAlign {
abi: Align(1 bytes),
pref: Align(1 bytes),
abi: Aggregate {
sized: true,
},
fields: Arbitrary {
---
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::assert_failed_inner
3: core::panicking::assert_failed::<rustc_abi::Align, rustc_abi::Align>
4: rustc_ty_utils::layout::layout_of
[... omitted 2 frames ...]
5: <rustc_middle::ty::layout::LayoutCx as rustc_middle::ty::layout::LayoutOf>::spanned_layout_of
6: <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}> as core::iter::traits::iterator::Iterator>::try_fold::<(), <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::try_fold<(), core::iter::traits::iterator::Iterator::try_for_each::call<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>, core::ops::control_flow::ControlFlow<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>, core::ops::control_flow::ControlFlow<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>::Break>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>::{closure#0}, core::ops::control_flow::ControlFlow<core::ops::control_flow::ControlFlow<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>
7: <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::next
8: <alloc::vec::Vec<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>, core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>>>>::from_iter
9: core::iter::adapters::try_process::<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}>>, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>, <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}> as core::iter::traits::iterator::Iterator>::try_collect<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>::{closure#0}, rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>
10: <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}> as core::iter::traits::iterator::Iterator>::try_fold::<(), <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::try_fold<(), core::iter::traits::iterator::Iterator::try_for_each::call<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>, core::ops::control_flow::ControlFlow<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>, core::ops::control_flow::ControlFlow<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>::Break>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>::{closure#0}, core::ops::control_flow::ControlFlow<core::ops::control_flow::ControlFlow<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>>
11: <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::next
12: <alloc::vec::Vec<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>, core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>>>>::from_iter
13: core::iter::adapters::try_process::<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}>>, rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>, <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}> as core::iter::traits::iterator::Iterator>::try_collect<rustc_index::vec::IndexVec<rustc_abi::layout::ty::VariantIdx, rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>::{closure#0}, rustc_index::vec::IndexVec<rustc_abi::layout::ty::VariantIdx, rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>
14: rustc_ty_utils::layout::layout_of_uncached
15: rustc_ty_utils::layout::layout_of
[... omitted 2 frames ...]
16: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::Ty>, rustc_middle::query::erase::Erased<[u8; 16]>>>
17: <rustc_mir_transform::remove_zsts::Replacer as rustc_middle::mir::visit::MutVisitor>::visit_var_debug_info
18: <rustc_mir_transform::remove_zsts::RemoveZsts as rustc_mir_transform::pass_manager::MirPass>::run_pass
20: rustc_mir_transform::optimized_mir
20: rustc_mir_transform::optimized_mir
[... omitted 2 frames ...]
21: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>>
22: <rustc_middle::ty::context::TyCtxt>::instance_mir
23: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_interface::passes::run_required_analyses::{closure#7}::{closure#0}>::{closure#0}>::{closure#0}::{closure#1}::{closure#0}>
24: <rustc_session::session::Session>::time::<(), rustc_interface::passes::run_required_analyses::{closure#7}>
25: rustc_interface::passes::analysis
[... omitted 2 frames ...]
27: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
28: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
29: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
note: please make sure that you have updated to the latest nightly
note: rustc 1.84.0-nightly (6a546fbd6 2024-10-17) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0 -Z validate-mir
query stack during panic:
#0 [layout_of] computing layout of `E`
#1 [layout_of] computing layout of `main::InvalidTag`
#2 [optimized_mir] optimizing MIR for `main`
---
---- [ui] tests/ui/layout/thaw-transmute-invalid-enum.rs stdout ----
error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
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/layout/thaw-transmute-invalid-enum.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/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/layout/thaw-transmute-invalid-enum" "-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/layout/thaw-transmute-invalid-enum/auxiliary"
--- stderr -------------------------------
error[E0412]: cannot find type `Subset` in this scope
##[error] --> /checkout/tests/ui/layout/thaw-transmute-invalid-enum.rs:32:41
|
|
LL | assert::is_transmutable::<Superset, Subset>(); //~ ERROR: cannot find type `Subset`
|
help: you might be missing a type parameter
|
|
LL | fn test<Subset>() {
error[E0517]: attribute should be applied to a struct or union
##[error] --> /checkout/tests/ui/layout/thaw-transmute-invalid-enum.rs:21:11
|
|
LL | #[repr(C, packed(2))] //~ ERROR: attribute should be applied to a struct
LL | / enum OxFF {
LL | | V = 0xFF,
LL | | }
| |_- not a struct or union
---
LL | use std::mem::{Assume, TransmuteFrom};
| ^^^^^^
|
= note: see issue #99571 <https://github.com/rust-lang/rust/issues/99571> for more information
= help: add `#![feature(transmutability)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: use of unstable library feature 'transmutability'
##[error] --> /checkout/tests/ui/layout/thaw-transmute-invalid-enum.rs:4:28
|
LL | use std::mem::{Assume, TransmuteFrom};
LL | use std::mem::{Assume, TransmuteFrom};
| ^^^^^^^^^^^^^
|
= note: see issue #99571 <https://github.com/rust-lang/rust/issues/99571> for more information
= help: add `#![feature(transmutability)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: use of unstable library feature 'transmutability'
##[error] --> /checkout/tests/ui/layout/thaw-transmute-invalid-enum.rs:10:14
|
|
LL | Dst: TransmuteFrom<Src>, //~ ERROR: use of unstable library feature 'transmutability'
|
= note: see issue #99571 <https://github.com/rust-lang/rust/issues/99571> for more information
= help: add `#![feature(transmutability)]` to the crate attributes to enable
= help: add `#![feature(transmutability)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
##[error] --> /checkout/tests/ui/layout/thaw-transmute-invalid-enum.rs:28:9
|
LL | a: Ox00, //~ ERROR: field must implement `Copy`
|
|
= note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
help: wrap the field type in `ManuallyDrop<...>`
|
LL | a: std::mem::ManuallyDrop<Ox00>, //~ ERROR: field must implement `Copy`
thread 'rustc' panicked at compiler/rustc_ty_utils/src/layout_sanity_check.rs:79:9:
assertion `left == right` failed: alignment mismatch between ABI and layout in TyAndLayout {
assertion `left == right` failed: alignment mismatch between ABI and layout in TyAndLayout {
ty: OxFF,
layout: Layout {
size: Size(4 bytes),
align: AbiAndPrefAlign {
abi: Align(2 bytes),
pref: Align(8 bytes),
abi: Scalar(
Initialized {
value: Int(
I32,
---
tag_encoding: Direct,
tag_field: 0,
variants: [
Layout {
size: Size(4 bytes),
align: AbiAndPrefAlign {
abi: Align(2 bytes),
pref: Align(2 bytes),
abi: Aggregate {
sized: true,
},
fields: Arbitrary {
---
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::assert_failed_inner
3: core::panicking::assert_failed::<rustc_abi::Align, rustc_abi::Align>
4: rustc_ty_utils::layout::layout_of
[... omitted 2 frames ...]
5: <rustc_middle::ty::layout::LayoutCx as rustc_middle::ty::layout::LayoutOf>::spanned_layout_of
6: <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}> as core::iter::traits::iterator::Iterator>::try_fold::<(), <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::try_fold<(), core::iter::traits::iterator::Iterator::try_for_each::call<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>, core::ops::control_flow::ControlFlow<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>, core::ops::control_flow::ControlFlow<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>::Break>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>::{closure#0}, core::ops::control_flow::ControlFlow<core::ops::control_flow::ControlFlow<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>
7: <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::next
8: <alloc::vec::Vec<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>, core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>>>>::from_iter
9: core::iter::adapters::try_process::<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}>>, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>, <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}::{closure#0}> as core::iter::traits::iterator::Iterator>::try_collect<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>::{closure#0}, rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>
10: <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}> as core::iter::traits::iterator::Iterator>::try_fold::<(), <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::try_fold<(), core::iter::traits::iterator::Iterator::try_for_each::call<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>, core::ops::control_flow::ControlFlow<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>, core::ops::control_flow::ControlFlow<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>::Break>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>::{closure#0}, core::ops::control_flow::ControlFlow<core::ops::control_flow::ControlFlow<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>>
11: <core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>> as core::iter::traits::iterator::Iterator>::next
12: <alloc::vec::Vec<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>, core::iter::adapters::GenericShunt<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>>>>::from_iter
13: core::iter::adapters::try_process::<core::iter::adapters::by_ref_sized::ByRefSized<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}>>, rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>, core::result::Result<core::convert::Infallible, &rustc_middle::ty::layout::LayoutError>, <core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, rustc_ty_utils::layout::layout_of_uncached::{closure#13}> as core::iter::traits::iterator::Iterator>::try_collect<rustc_index::vec::IndexVec<rustc_abi::layout::ty::VariantIdx, rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>::{closure#0}, rustc_index::vec::IndexVec<rustc_abi::layout::ty::VariantIdx, rustc_index::vec::IndexVec<rustc_abi::layout::ty::FieldIdx, rustc_abi::layout::ty::TyAndLayout<rustc_middle::ty::Ty>>>>
14: rustc_ty_utils::layout::layout_of_uncached
15: rustc_ty_utils::layout::layout_of
[... omitted 2 frames ...]
16: rustc_transmute::layout::rustc::layout_of
17: <rustc_transmute::layout::tree::Tree<rustc_transmute::layout::rustc::Def, rustc_transmute::layout::rustc::Ref>>::from_ty
18: <rustc_transmute::maybe_transmutable::MaybeTransmutableQuery<rustc_middle::ty::Ty, rustc_middle::ty::context::TyCtxt>>::answer
19: <rustc_transmute::rustc::TransmuteTypeEnv>::is_transmutable
20: <rustc_trait_selection::traits::select::SelectionContext>::confirm_candidate
21: <rustc_trait_selection::traits::select::SelectionContext>::evaluation_probe::<<rustc_trait_selection::traits::select::SelectionContext>::evaluate_candidate::{closure#0}::{closure#0}>::{closure#0}
22: <rustc_infer::infer::InferCtxt>::probe::<core::result::Result<rustc_middle::traits::select::EvaluationResult, rustc_middle::traits::select::OverflowError>, <rustc_trait_selection::traits::select::SelectionContext>::evaluation_probe<<rustc_trait_selection::traits::select::SelectionContext>::evaluate_candidate::{closure#0}::{closure#0}>::{closure#0}>
24: <rustc_trait_selection::traits::select::SelectionContext>::evaluate_trait_predicate_recursively::{closure#0}::{closure#1}
25: <rustc_trait_selection::traits::select::SelectionContext>::evaluate_trait_predicate_recursively
26: <rustc_trait_selection::traits::select::SelectionContext>::evaluate_predicate_recursively
27: <rustc_trait_selection::traits::select::SelectionContext>::evaluation_probe::<<rustc_trait_selection::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>::{closure#0}
27: <rustc_trait_selection::traits::select::SelectionContext>::evaluation_probe::<<rustc_trait_selection::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>::{closure#0}
28: <rustc_infer::infer::InferCtxt>::probe::<core::result::Result<rustc_middle::traits::select::EvaluationResult, rustc_middle::traits::select::OverflowError>, <rustc_trait_selection::traits::select::SelectionContext>::evaluation_probe<<rustc_trait_selection::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>::{closure#0}>
29: rustc_traits::evaluate_obligation::evaluate_obligation
[... omitted 2 frames ...]
31: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation_no_overflow
31: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation_no_overflow
32: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
33: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
34: <rustc_trait_selection::traits::fulfill::FulfillmentContext<rustc_trait_selection::traits::FulfillmentError> as rustc_infer::traits::engine::TraitEngine<rustc_trait_selection::traits::FulfillmentError>>::select_where_possible
35: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
36: <rustc_hir_typeck::fn_ctxt::FnCtxt>::confirm_builtin_call
37: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
38: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
39: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation
40: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
41: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
42: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
43: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation
44: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
45: rustc_hir_typeck::check::check_fn
46: rustc_hir_typeck::typeck
[... omitted 2 frames ...]
47: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_hir_analysis::check_crate::{closure#4}>::{closure#0}
48: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_data_structures::sync::parallel::enabled::par_for_each_in<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_hir_analysis::check_crate::{closure#4}>::{closure#0}>::{closure#0}::{closure#1}::{closure#0}>
50: rustc_interface::passes::analysis
50: rustc_interface::passes::analysis
[... omitted 2 frames ...]
52: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
53: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
54: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
note: please make sure that you have updated to the latest nightly
note: rustc 1.84.0-nightly (6a546fbd6 2024-10-17) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
#0 [layout_of] computing layout of `OxFF`
#1 [layout_of] computing layout of `test::Superset`
#1 [layout_of] computing layout of `test::Superset`
#2 [evaluate_obligation] evaluating trait selection obligation `{type error}: core::mem::transmutability::TransmuteFrom<test::Superset, core::mem::transmutability::Assume { alignment: false, lifetimes: false, safety: false, validity: false }>`
#3 [typeck] type-checking `test`
end of query stack
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0412, E0517, E0658, E0740.
Some errors have detailed explanations: E0412, E0517, E0658, E0740.
For more information about an error, try `rustc --explain E0412`.
------------------------------------------
failures:
[ui] tests/ui/layout/thaw-validate-invalid-enum.rs
[ui] tests/ui/layout/thaw-transmute-invalid-enum.rs
test result: FAILED. 17649 passed; 2 failed; 174 ignored; 0 measured; 0 filtered out; finished in 165.23s
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
Build completed unsuccessfully in 0:17:48
~~how bizarre.~~ debug asserts!
Hm I feel like this should go to r? @lukas-code
oddly
./x.py build rust-analyzerworks but./x.py test rust-analyzerdoesn't.
r-a isn't setup as a test step in boopstrap, it is setup as a build step
ah, is it finally time to promote it to its own directory?
git mv ./src/bootstrap ./boopstrap
@bors r+ rollup
:pushpin: Commit 9f4c9155d4535e08a3148e792711447e44541cd1 has been approved by lukas-code
It is now in the queue for this repository.