Skip to content

ICE: Inconsistent rustc_transmute::is_transmutable(...) result, got Yes #110467

Closed
@matthiaskrgr

Description

@matthiaskrgr

Code

use std::mem::BikeshedIntrinsicFrom;
pub struct Context;

pub fn is_maybe_transmutable<Src, Dst>()
where
    Dst: BikeshedIntrinsicFrom<Src, Context>,
{
}

fn should_pad_explicitly_packed_field<T>() {
    is_maybe_transmutable::<(), ()>();
}

Meta

rustc --version --verbose:

rustc 1.71.0-nightly (31656e729 2023-04-17)
binary: rustc
commit-hash: 31656e7295ebd5f2f6597f10c011e2ac4ba3ef39
commit-date: 2023-04-17
host: x86_64-unknown-linux-gnu
release: 1.71.0-nightly
LLVM version: 16.0.2

Error output

<output>
Backtrace

error[E0601]: `main` function not found in crate `treereduce`
  --> treereduce.out:12:2
   |
12 | }
   |  ^ consider adding a `main` function to `treereduce.out`

error[E0658]: use of unstable library feature 'transmutability'
 --> treereduce.out:1:5
  |
1 | use std::mem::BikeshedIntrinsicFrom;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = 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

error[E0658]: use of unstable library feature 'transmutability'
 --> treereduce.out:6:10
  |
6 |     Dst: BikeshedIntrinsicFrom<Src, Context>,
  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = 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

error: internal compiler error: compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs:2974:45: Inconsistent rustc_transmute::is_transmutable(...) result, got Yes
  --> treereduce.out:11:33
   |
11 |     is_maybe_transmutable::<(), ()>();
   |                                 ^^

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/31656e7295ebd5f2f6597f10c011e2ac4ba3ef39/compiler/rustc_errors/src/lib.rs:994:33
stack backtrace:
   0:     0x7f6769d653c2 - std::backtrace_rs::backtrace::libunwind::trace::h12fb0181e6282928
                               at /rustc/31656e7295ebd5f2f6597f10c011e2ac4ba3ef39/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f6769d653c2 - std::backtrace_rs::backtrace::trace_unsynchronized::hd58a23b488ab4414
                               at /rustc/31656e7295ebd5f2f6597f10c011e2ac4ba3ef39/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f6769d653c2 - std::sys_common::backtrace::_print_fmt::h1e92ee6e175ed435
                               at /rustc/31656e7295ebd5f2f6597f10c011e2ac4ba3ef39/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f6769d653c2 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he25ddff8a40f4065
                               at /rustc/31656e7295ebd5f2f6597f10c011e2ac4ba3ef39/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f6769dc95df - core::fmt::write::h2334c3311cfbc09f
                               at /rustc/31656e7295ebd5f2f6597f10c011e2ac4ba3ef39/library/core/src/fmt/mod.rs:1254:17
   5:     0x7f6769d58371 - std::io::Write::write_fmt::h32ceba1e85ba39af
                               at /rustc/31656e7295ebd5f2f6597f10c011e2ac4ba3ef39/library/std/src/io/mod.rs:1698:15
   6:     0x7f6769d651c5 - std::sys_common::backtrace::_print::headbc582bfe8f74f
                               at /rustc/31656e7295ebd5f2f6597f10c011e2ac4ba3ef39/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f6769d651c5 - std::sys_common::backtrace::print::h9fbeedaf474e45ad
                               at /rustc/31656e7295ebd5f2f6597f10c011e2ac4ba3ef39/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f6769d67e87 - std::panicking::default_hook::{{closure}}::hff4b7a4e67c75e45
   9:     0x7f6769d67c75 - std::panicking::default_hook::h2ca9686b025551a8
                               at /rustc/31656e7295ebd5f2f6597f10c011e2ac4ba3ef39/library/std/src/panicking.rs:288:9
  10:     0x7f676d031d45 - <rustc_driver_impl[19ce8278adc32abb]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[ecd79567034e570c]::ops::function::FnOnce<(&core[ecd79567034e570c]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f6769d685c5 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h97aef67d40dea969
                               at /rustc/31656e7295ebd5f2f6597f10c011e2ac4ba3ef39/library/alloc/src/boxed.rs:1987:9
  12:     0x7f6769d685c5 - std::panicking::rust_panic_with_hook::h8edf350457ba7c57
                               at /rustc/31656e7295ebd5f2f6597f10c011e2ac4ba3ef39/library/std/src/panicking.rs:695:13
  13:     0x7f676dc20cc1 - std[44a4f6cc0231f9b2]::panicking::begin_panic::<rustc_errors[c08719f1ef463e6f]::ExplicitBug>::{closure#0}
  14:     0x7f676dc0fe06 - std[44a4f6cc0231f9b2]::sys_common::backtrace::__rust_end_short_backtrace::<std[44a4f6cc0231f9b2]::panicking::begin_panic<rustc_errors[c08719f1ef463e6f]::ExplicitBug>::{closure#0}, !>
  15:     0x7f676dcc4636 - std[44a4f6cc0231f9b2]::panicking::begin_panic::<rustc_errors[c08719f1ef463e6f]::ExplicitBug>
  16:     0x7f676dbf76a0 - <rustc_errors[c08719f1ef463e6f]::HandlerInner>::span_bug::<rustc_span[bacfd568afc27ca7]::span_encoding::Span, &alloc[b29edc6afdbb639a]::string::String>
  17:     0x7f676dbf74d7 - <rustc_errors[c08719f1ef463e6f]::Handler>::span_bug::<rustc_span[bacfd568afc27ca7]::span_encoding::Span, &alloc[b29edc6afdbb639a]::string::String>
  18:     0x7f676dbbd7eb - rustc_middle[a098ebc07bc191ee]::util::bug::opt_span_bug_fmt::<rustc_span[bacfd568afc27ca7]::span_encoding::Span>::{closure#0}
  19:     0x7f676dbbd83a - rustc_middle[a098ebc07bc191ee]::ty::context::tls::with_opt::<rustc_middle[a098ebc07bc191ee]::util::bug::opt_span_bug_fmt<rustc_span[bacfd568afc27ca7]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  20:     0x7f676dbb74a6 - rustc_middle[a098ebc07bc191ee]::ty::context::tls::with_context_opt::<rustc_middle[a098ebc07bc191ee]::ty::context::tls::with_opt<rustc_middle[a098ebc07bc191ee]::util::bug::opt_span_bug_fmt<rustc_span[bacfd568afc27ca7]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  21:     0x7f676dbb7444 - rustc_middle[a098ebc07bc191ee]::util::bug::span_bug_fmt::<rustc_span[bacfd568afc27ca7]::span_encoding::Span>
  22:     0x7f676dcbbdea - <rustc_infer[44d00952e7390d21]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[184e7675a95467cf]::traits::error_reporting::InferCtxtPrivExt>::get_safe_transmute_error_and_reason
  23:     0x7f676dcb4afa - <rustc_infer[44d00952e7390d21]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[184e7675a95467cf]::traits::error_reporting::TypeErrCtxtExt>::report_selection_error
  24:     0x7f676dcbe771 - <rustc_infer[44d00952e7390d21]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[184e7675a95467cf]::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
  25:     0x7f676dcb1854 - <rustc_infer[44d00952e7390d21]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[184e7675a95467cf]::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
  26:     0x7f676b1ac6e1 - <rustc_hir_typeck[667a4ac438b3b5ea]::fn_ctxt::FnCtxt>::check_argument_types
  27:     0x7f676b19a468 - <rustc_hir_typeck[667a4ac438b3b5ea]::fn_ctxt::FnCtxt>::check_call
  28:     0x7f676b55eee0 - <rustc_hir_typeck[667a4ac438b3b5ea]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  29:     0x7f676b5a2ed0 - <rustc_hir_typeck[667a4ac438b3b5ea]::fn_ctxt::FnCtxt>::check_block_with_expected
  30:     0x7f676b55f877 - <rustc_hir_typeck[667a4ac438b3b5ea]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  31:     0x7f676b79609d - <rustc_hir_typeck[667a4ac438b3b5ea]::fn_ctxt::FnCtxt>::check_return_expr
  32:     0x7f676b78e10d - rustc_hir_typeck[667a4ac438b3b5ea]::check::check_fn
  33:     0x7f676b7757ce - rustc_hir_typeck[667a4ac438b3b5ea]::typeck
  34:     0x7f676b0fba29 - rustc_query_system[8013f3037cfe4f42]::query::plumbing::try_execute_query::<rustc_query_impl[d100f3cda631c9d2]::queries::typeck, rustc_query_impl[d100f3cda631c9d2]::plumbing::QueryCtxt>
  35:     0x7f676c7aa020 - rustc_data_structures[e3b057fee94cbb2e]::sync::par_for_each_in::<&[rustc_span[bacfd568afc27ca7]::def_id::LocalDefId], <rustc_middle[a098ebc07bc191ee]::hir::map::Map>::par_body_owners<rustc_hir_typeck[667a4ac438b3b5ea]::typeck_item_bodies::{closure#0}>::{closure#0}>
  36:     0x7f676c7a9dde - rustc_hir_typeck[667a4ac438b3b5ea]::typeck_item_bodies
  37:     0x7f676c826f17 - rustc_query_system[8013f3037cfe4f42]::query::plumbing::try_execute_query::<rustc_query_impl[d100f3cda631c9d2]::queries::typeck_item_bodies, rustc_query_impl[d100f3cda631c9d2]::plumbing::QueryCtxt>
  38:     0x7f676c826c2c - <rustc_query_impl[d100f3cda631c9d2]::Queries as rustc_middle[a098ebc07bc191ee]::ty::query::QueryEngine>::typeck_item_bodies
  39:     0x7f676c400f3c - rustc_hir_analysis[18d38fd7f32cb571]::check_crate
  40:     0x7f676c3fad1d - rustc_interface[e2b40ad4e6aa2c15]::passes::analysis
  41:     0x7f676c79a562 - rustc_query_system[8013f3037cfe4f42]::query::plumbing::try_execute_query::<rustc_query_impl[d100f3cda631c9d2]::queries::analysis, rustc_query_impl[d100f3cda631c9d2]::plumbing::QueryCtxt>
  42:     0x7f676c79a270 - <rustc_query_impl[d100f3cda631c9d2]::Queries as rustc_middle[a098ebc07bc191ee]::ty::query::QueryEngine>::analysis
  43:     0x7f676c65e8e6 - <std[44a4f6cc0231f9b2]::thread::local::LocalKey<core[ecd79567034e570c]::cell::Cell<*const ()>>>::with::<rustc_middle[a098ebc07bc191ee]::ty::context::tls::enter_context<<rustc_middle[a098ebc07bc191ee]::ty::context::GlobalCtxt>::enter<rustc_driver_impl[19ce8278adc32abb]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[ecd79567034e570c]::result::Result<(), rustc_span[bacfd568afc27ca7]::ErrorGuaranteed>>::{closure#0}, core[ecd79567034e570c]::result::Result<(), rustc_span[bacfd568afc27ca7]::ErrorGuaranteed>>::{closure#0}, core[ecd79567034e570c]::result::Result<(), rustc_span[bacfd568afc27ca7]::ErrorGuaranteed>>
  44:     0x7f676c21da67 - <rustc_interface[e2b40ad4e6aa2c15]::interface::Compiler>::enter::<rustc_driver_impl[19ce8278adc32abb]::run_compiler::{closure#1}::{closure#2}, core[ecd79567034e570c]::result::Result<core[ecd79567034e570c]::option::Option<rustc_interface[e2b40ad4e6aa2c15]::queries::Linker>, rustc_span[bacfd568afc27ca7]::ErrorGuaranteed>>
  45:     0x7f676c217b4f - rustc_span[bacfd568afc27ca7]::set_source_map::<core[ecd79567034e570c]::result::Result<(), rustc_span[bacfd568afc27ca7]::ErrorGuaranteed>, rustc_interface[e2b40ad4e6aa2c15]::interface::run_compiler<core[ecd79567034e570c]::result::Result<(), rustc_span[bacfd568afc27ca7]::ErrorGuaranteed>, rustc_driver_impl[19ce8278adc32abb]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  46:     0x7f676c217768 - <scoped_tls[41028e5492da81b4]::ScopedKey<rustc_span[bacfd568afc27ca7]::SessionGlobals>>::set::<rustc_interface[e2b40ad4e6aa2c15]::interface::run_compiler<core[ecd79567034e570c]::result::Result<(), rustc_span[bacfd568afc27ca7]::ErrorGuaranteed>, rustc_driver_impl[19ce8278adc32abb]::run_compiler::{closure#1}>::{closure#0}, core[ecd79567034e570c]::result::Result<(), rustc_span[bacfd568afc27ca7]::ErrorGuaranteed>>
  47:     0x7f676c216d7b - std[44a4f6cc0231f9b2]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[e2b40ad4e6aa2c15]::util::run_in_thread_pool_with_globals<rustc_interface[e2b40ad4e6aa2c15]::interface::run_compiler<core[ecd79567034e570c]::result::Result<(), rustc_span[bacfd568afc27ca7]::ErrorGuaranteed>, rustc_driver_impl[19ce8278adc32abb]::run_compiler::{closure#1}>::{closure#0}, core[ecd79567034e570c]::result::Result<(), rustc_span[bacfd568afc27ca7]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ecd79567034e570c]::result::Result<(), rustc_span[bacfd568afc27ca7]::ErrorGuaranteed>>
  48:     0x7f676c8f9161 - <<std[44a4f6cc0231f9b2]::thread::Builder>::spawn_unchecked_<rustc_interface[e2b40ad4e6aa2c15]::util::run_in_thread_pool_with_globals<rustc_interface[e2b40ad4e6aa2c15]::interface::run_compiler<core[ecd79567034e570c]::result::Result<(), rustc_span[bacfd568afc27ca7]::ErrorGuaranteed>, rustc_driver_impl[19ce8278adc32abb]::run_compiler::{closure#1}>::{closure#0}, core[ecd79567034e570c]::result::Result<(), rustc_span[bacfd568afc27ca7]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ecd79567034e570c]::result::Result<(), rustc_span[bacfd568afc27ca7]::ErrorGuaranteed>>::{closure#1} as core[ecd79567034e570c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  49:     0x7f6769d72a85 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf699fb692a362d4f
                               at /rustc/31656e7295ebd5f2f6597f10c011e2ac4ba3ef39/library/alloc/src/boxed.rs:1973:9
  50:     0x7f6769d72a85 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h5785a67d99b09647
                               at /rustc/31656e7295ebd5f2f6597f10c011e2ac4ba3ef39/library/alloc/src/boxed.rs:1973:9
  51:     0x7f6769d72a85 - std::sys::unix::thread::Thread::new::thread_start::hd8d3f6147809d6cf
                               at /rustc/31656e7295ebd5f2f6597f10c011e2ac4ba3ef39/library/std/src/sys/unix/thread.rs:108:17
  52:     0x7f6769b0dbb5 - <unknown>
  53:     0x7f6769b8fd90 - <unknown>
  54:                0x0 - <unknown>

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.71.0-nightly (31656e729 2023-04-17) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck] type-checking `should_pad_explicitly_packed_field`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors

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

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions