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

ICE failed to normalize #112736

Closed
matthiaskrgr opened this issue Jun 17, 2023 · 1 comment · Fixed by #112810
Closed

ICE failed to normalize #112736

matthiaskrgr opened this issue Jun 17, 2023 · 1 comment · Fixed by #112810
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

trait Structure<E>: Sized {
    type RefTarget: ?Sized;
    type FfiPtr;
    unsafe fn borrow_from_ffi_ptr<'a>(ptr: Self::FfiPtr) -> Option<&'a Self::RefTarget>;
}

enum Slice {}

impl<E> Structure<E> for Slice
where
    S: Structure<E>,
    E: Encoding,
{
    type RefTarget = [E::Unit];
    type FfiPtr = (*const E::FfiUnit, usize);
}

trait Encoding {
    type Unit: Unit;
    type FfiUnit;
}

trait Unit {}

enum Utf16 {}

impl Encoding for Utf16 {
    type Unit = Utf16Unit;
    type FfiUnit = u16;
}

struct Utf16Unit(pub u16);

struct SUtf16Str {
    _data: <Slice as Structure<Utf16>>::RefTarget,
}

impl SUtf16Str {
    pub unsafe fn from_ptr<'a>(ptr: <Slice as Structure<Utf16>>::FfiPtr) -> Option<&'a Self> {
        std::mem::transmute::<Option<&[<Utf16 as Encoding>::Unit]>, _>(<Slice as Structure<
            Utf16,
        >>::borrow_from_ffi_ptr(
            ptr
        ))
    }
}

Meta

rustc --version --verbose:

rustc 1.72.0-nightly (1d7d82472 2023-06-17)
binary: rustc
commit-hash: 1d7d82472617a4a0fea59c7e239c8a48c8ac5c34
commit-date: 2023-06-17
host: x86_64-unknown-linux-gnu
release: 1.72.0-nightly
LLVM version: 16.0.5

Error output

error[E0412]: cannot find type `S` in this scope
  --> treereduce.out:11:5
   |
9  | impl<E> Structure<E> for Slice
   |      - similarly named type parameter `E` defined here
10 | where
11 |     S: Structure<E>,
   |     ^ help: a type parameter with a similar name exists: `E`

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

error[E0046]: not all trait items implemented, missing: `borrow_from_ffi_ptr`
 --> treereduce.out:9:1
  |
4 |     unsafe fn borrow_from_ffi_ptr<'a>(ptr: Self::FfiPtr) -> Option<&'a Self::RefTarget>;
  |     ------------------------------------------------------------------------------------ `borrow_from_ffi_ptr` from trait
...
9 | impl<E> Structure<E> for Slice
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `borrow_from_ffi_ptr` in implementation

error[E0277]: the trait bound `Utf16Unit: Unit` is not satisfied
  --> treereduce.out:28:17
   |
28 |     type Unit = Utf16Unit;
   |                 ^^^^^^^^^ the trait `Unit` is not implemented for `Utf16Unit`
   |
note: required by a bound in `Encoding::Unit`
  --> treereduce.out:19:16
   |
19 |     type Unit: Unit;
   |                ^^^^ required by this bound in `Encoding::Unit`
Backtrace

error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:195:90: Failed to normalize <Slice as Structure<Utf16>>::RefTarget, maybe try to call `try_normalize_erasing_regions` instead

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/compiler/rustc_errors/src/lib.rs:1650:9
stack backtrace:
   0:     0x7faab1f60821 - std::backtrace_rs::backtrace::libunwind::trace::h6e3584f9aa263648
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7faab1f60821 - std::backtrace_rs::backtrace::trace_unsynchronized::h7cba45a2d56b3723
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7faab1f60821 - std::sys_common::backtrace::_print_fmt::hb3e5f2b800058c47
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7faab1f60821 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc6fcd56f05592786
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7faab1fc1b2f - core::fmt::rt::Argument::fmt::hb8b6762d96a2930c
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/core/src/fmt/rt.rs:138:9
   5:     0x7faab1fc1b2f - core::fmt::write::ha824b1be2c398991
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/core/src/fmt/mod.rs:1094:21
   6:     0x7faab1f53a31 - std::io::Write::write_fmt::h4bbc557c498e18be
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/io/mod.rs:1713:15
   7:     0x7faab1f60635 - std::sys_common::backtrace::_print::hb6a2afc924d1ac9a
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7faab1f60635 - std::sys_common::backtrace::print::h39a60e9b1dd2b988
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7faab1f63317 - std::panicking::default_hook::{{closure}}::hf1636ea70b88baf6
  10:     0x7faab1f63104 - std::panicking::default_hook::h25db0e741a15cb6c
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/panicking.rs:288:9
  11:     0x7faab0dc105b - <rustc_driver_impl[9fb98086b5dc1b8]::install_ice_hook::{closure#0} as core[5a025f5ac19a3684]::ops::function::FnOnce<(&core[5a025f5ac19a3684]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7faab1f63a5d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hb67fc0de76dc4685
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/alloc/src/boxed.rs:1999:9
  13:     0x7faab1f63a5d - std::panicking::rust_panic_with_hook::h6c10fd1f40066f99
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/panicking.rs:709:13
  14:     0x7faab12c21b1 - std[5e6a7ab4ec51e2fa]::panicking::begin_panic::<rustc_errors[db6e693a4d78f721]::ExplicitBug>::{closure#0}
  15:     0x7faab12c0e06 - std[5e6a7ab4ec51e2fa]::sys_common::backtrace::__rust_end_short_backtrace::<std[5e6a7ab4ec51e2fa]::panicking::begin_panic<rustc_errors[db6e693a4d78f721]::ExplicitBug>::{closure#0}, !>
  16:     0x7faab13572a6 - std[5e6a7ab4ec51e2fa]::panicking::begin_panic::<rustc_errors[db6e693a4d78f721]::ExplicitBug>
  17:     0x7faab12bdbd4 - <rustc_errors[db6e693a4d78f721]::HandlerInner>::bug::<alloc[31842ca5441cdb56]::string::String>
  18:     0x7faab12bda56 - <rustc_errors[db6e693a4d78f721]::Handler>::bug::<alloc[31842ca5441cdb56]::string::String>
  19:     0x7faab131142c - rustc_middle[c2d4873b804b2cf0]::util::bug::opt_span_bug_fmt::<rustc_span[7bbc48c8a570ee79]::span_encoding::Span>::{closure#0}
  20:     0x7faab130e2ca - rustc_middle[c2d4873b804b2cf0]::ty::context::tls::with_opt::<rustc_middle[c2d4873b804b2cf0]::util::bug::opt_span_bug_fmt<rustc_span[7bbc48c8a570ee79]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7faab130e29a - rustc_middle[c2d4873b804b2cf0]::ty::context::tls::with_context_opt::<rustc_middle[c2d4873b804b2cf0]::ty::context::tls::with_opt<rustc_middle[c2d4873b804b2cf0]::util::bug::opt_span_bug_fmt<rustc_span[7bbc48c8a570ee79]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7faaaf04f89d - rustc_middle[c2d4873b804b2cf0]::util::bug::bug_fmt
  23:     0x7faab0287805 - <rustc_middle[c2d4873b804b2cf0]::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder>::normalize_generic_arg_after_erasing_regions
  24:     0x7faaaf337db3 - <rustc_middle[c2d4873b804b2cf0]::ty::Ty as rustc_type_ir[ec7fec18ba31fd26]::fold::TypeFoldable<rustc_middle[c2d4873b804b2cf0]::ty::context::TyCtxt>>::fold_with::<rustc_middle[c2d4873b804b2cf0]::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder>
  25:     0x7faaaf5b9a13 - <rustc_middle[c2d4873b804b2cf0]::ty::context::TyCtxt>::struct_tail_erasing_lifetimes
  26:     0x7faaafd6b4cc - rustc_ty_utils[f36d30a9cf7df766]::layout::layout_of
  27:     0x7faaaedd80e0 - rustc_query_impl[7260f550d3fae5ad]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7260f550d3fae5ad]::query_impl::layout_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c2d4873b804b2cf0]::query::erase::Erased<[u8; 24usize]>>
  28:     0x7faaaf677577 - rustc_query_system[fd595a8868fcd518]::query::plumbing::try_execute_query::<rustc_query_impl[7260f550d3fae5ad]::DynamicConfig<rustc_query_system[fd595a8868fcd518]::query::caches::DefaultCache<rustc_middle[c2d4873b804b2cf0]::ty::ParamEnvAnd<rustc_middle[c2d4873b804b2cf0]::ty::Ty>, rustc_middle[c2d4873b804b2cf0]::query::erase::Erased<[u8; 24usize]>>, false, true, false>, rustc_query_impl[7260f550d3fae5ad]::plumbing::QueryCtxt, false>
  29:     0x7faaaf6771aa - rustc_query_impl[7260f550d3fae5ad]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace
  30:     0x7faaaef350c4 - <core[5a025f5ac19a3684]::iter::adapters::GenericShunt<core[5a025f5ac19a3684]::iter::adapters::by_ref_sized::ByRefSized<core[5a025f5ac19a3684]::iter::adapters::map::Map<core[5a025f5ac19a3684]::slice::iter::Iter<rustc_middle[c2d4873b804b2cf0]::ty::FieldDef>, rustc_ty_utils[f36d30a9cf7df766]::layout::layout_of_uncached::{closure#5}::{closure#0}>>, core[5a025f5ac19a3684]::result::Result<core[5a025f5ac19a3684]::convert::Infallible, rustc_middle[c2d4873b804b2cf0]::ty::layout::LayoutError>> as core[5a025f5ac19a3684]::iter::traits::iterator::Iterator>::next
  31:     0x7faaafd7084b - core[5a025f5ac19a3684]::iter::adapters::try_process::<core[5a025f5ac19a3684]::iter::adapters::by_ref_sized::ByRefSized<core[5a025f5ac19a3684]::iter::adapters::map::Map<core[5a025f5ac19a3684]::slice::iter::Iter<rustc_middle[c2d4873b804b2cf0]::ty::VariantDef>, rustc_ty_utils[f36d30a9cf7df766]::layout::layout_of_uncached::{closure#5}>>, rustc_index[d5751782e61451cb]::vec::IndexVec<rustc_abi[3d47570f4488febf]::FieldIdx, rustc_abi[3d47570f4488febf]::Layout>, core[5a025f5ac19a3684]::result::Result<core[5a025f5ac19a3684]::convert::Infallible, rustc_middle[c2d4873b804b2cf0]::ty::layout::LayoutError>, <core[5a025f5ac19a3684]::iter::adapters::map::Map<core[5a025f5ac19a3684]::slice::iter::Iter<rustc_middle[c2d4873b804b2cf0]::ty::VariantDef>, rustc_ty_utils[f36d30a9cf7df766]::layout::layout_of_uncached::{closure#5}> as core[5a025f5ac19a3684]::iter::traits::iterator::Iterator>::try_collect<rustc_index[d5751782e61451cb]::vec::IndexVec<rustc_abi[3d47570f4488febf]::VariantIdx, rustc_index[d5751782e61451cb]::vec::IndexVec<rustc_abi[3d47570f4488febf]::FieldIdx, rustc_abi[3d47570f4488febf]::Layout>>>::{closure#0}, rustc_index[d5751782e61451cb]::vec::IndexVec<rustc_abi[3d47570f4488febf]::VariantIdx, rustc_index[d5751782e61451cb]::vec::IndexVec<rustc_abi[3d47570f4488febf]::FieldIdx, rustc_abi[3d47570f4488febf]::Layout>>>
  32:     0x7faaafd6aa71 - rustc_ty_utils[f36d30a9cf7df766]::layout::layout_of
  33:     0x7faaaedd80e0 - rustc_query_impl[7260f550d3fae5ad]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7260f550d3fae5ad]::query_impl::layout_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c2d4873b804b2cf0]::query::erase::Erased<[u8; 24usize]>>
  34:     0x7faaaf677577 - rustc_query_system[fd595a8868fcd518]::query::plumbing::try_execute_query::<rustc_query_impl[7260f550d3fae5ad]::DynamicConfig<rustc_query_system[fd595a8868fcd518]::query::caches::DefaultCache<rustc_middle[c2d4873b804b2cf0]::ty::ParamEnvAnd<rustc_middle[c2d4873b804b2cf0]::ty::Ty>, rustc_middle[c2d4873b804b2cf0]::query::erase::Erased<[u8; 24usize]>>, false, true, false>, rustc_query_impl[7260f550d3fae5ad]::plumbing::QueryCtxt, false>
  35:     0x7faaaf6771aa - rustc_query_impl[7260f550d3fae5ad]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace
  36:     0x7faaaffcf0c9 - <rustc_middle[c2d4873b804b2cf0]::ty::layout::SizeSkeleton>::compute
  37:     0x7faab03973c8 - <rustc_hir_typeck[a6c8b38659ddb931]::fn_ctxt::FnCtxt>::check_transmute
  38:     0x7faaaf61909f - rustc_hir_typeck[a6c8b38659ddb931]::typeck
  39:     0x7faaaee09a8c - rustc_query_impl[7260f550d3fae5ad]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7260f550d3fae5ad]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c2d4873b804b2cf0]::query::erase::Erased<[u8; 8usize]>>
  40:     0x7faaaee09a6e - <rustc_query_impl[7260f550d3fae5ad]::query_impl::typeck::dynamic_query::{closure#2} as core[5a025f5ac19a3684]::ops::function::FnOnce<(rustc_middle[c2d4873b804b2cf0]::ty::context::TyCtxt, rustc_span[7bbc48c8a570ee79]::def_id::LocalDefId)>>::call_once
  41:     0x7faaaeed2d4d - rustc_query_system[fd595a8868fcd518]::query::plumbing::try_execute_query::<rustc_query_impl[7260f550d3fae5ad]::DynamicConfig<rustc_query_system[fd595a8868fcd518]::query::caches::VecCache<rustc_span[7bbc48c8a570ee79]::def_id::LocalDefId, rustc_middle[c2d4873b804b2cf0]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[7260f550d3fae5ad]::plumbing::QueryCtxt, false>
  42:     0x7faab073115f - rustc_query_impl[7260f550d3fae5ad]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  43:     0x7faaaef4f75d - rustc_query_impl[7260f550d3fae5ad]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7260f550d3fae5ad]::query_impl::used_trait_imports::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c2d4873b804b2cf0]::query::erase::Erased<[u8; 8usize]>>
  44:     0x7faaaef4f6be - <rustc_query_impl[7260f550d3fae5ad]::query_impl::used_trait_imports::dynamic_query::{closure#2} as core[5a025f5ac19a3684]::ops::function::FnOnce<(rustc_middle[c2d4873b804b2cf0]::ty::context::TyCtxt, rustc_span[7bbc48c8a570ee79]::def_id::LocalDefId)>>::call_once
  45:     0x7faaaeed2d4d - rustc_query_system[fd595a8868fcd518]::query::plumbing::try_execute_query::<rustc_query_impl[7260f550d3fae5ad]::DynamicConfig<rustc_query_system[fd595a8868fcd518]::query::caches::VecCache<rustc_span[7bbc48c8a570ee79]::def_id::LocalDefId, rustc_middle[c2d4873b804b2cf0]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[7260f550d3fae5ad]::plumbing::QueryCtxt, false>
  46:     0x7faab073124f - rustc_query_impl[7260f550d3fae5ad]::query_impl::used_trait_imports::get_query_non_incr::__rust_end_short_backtrace
  47:     0x7faab01e27b6 - rustc_hir_analysis[e24c9918eefe89cd]::check_crate
  48:     0x7faab01d580a - rustc_interface[75da62af7afad68]::passes::analysis
  49:     0x7faab023d1aa - rustc_query_impl[7260f550d3fae5ad]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7260f550d3fae5ad]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c2d4873b804b2cf0]::query::erase::Erased<[u8; 1usize]>>
  50:     0x7faab023d199 - <rustc_query_impl[7260f550d3fae5ad]::query_impl::analysis::dynamic_query::{closure#2} as core[5a025f5ac19a3684]::ops::function::FnOnce<(rustc_middle[c2d4873b804b2cf0]::ty::context::TyCtxt, ())>>::call_once
  51:     0x7faab0457ae8 - rustc_query_system[fd595a8868fcd518]::query::plumbing::try_execute_query::<rustc_query_impl[7260f550d3fae5ad]::DynamicConfig<rustc_query_system[fd595a8868fcd518]::query::caches::SingleCache<rustc_middle[c2d4873b804b2cf0]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[7260f550d3fae5ad]::plumbing::QueryCtxt, false>
  52:     0x7faab04578c7 - rustc_query_impl[7260f550d3fae5ad]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  53:     0x7faab02f4ca5 - <rustc_middle[c2d4873b804b2cf0]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[9fb98086b5dc1b8]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>
  54:     0x7faab02f3c06 - rustc_span[7bbc48c8a570ee79]::set_source_map::<core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>, rustc_interface[75da62af7afad68]::interface::run_compiler<core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>, rustc_driver_impl[9fb98086b5dc1b8]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  55:     0x7faab02ec3f9 - <scoped_tls[5be461245172b0fd]::ScopedKey<rustc_span[7bbc48c8a570ee79]::SessionGlobals>>::set::<rustc_interface[75da62af7afad68]::interface::run_compiler<core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>, rustc_driver_impl[9fb98086b5dc1b8]::run_compiler::{closure#1}>::{closure#0}, core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>
  56:     0x7faab02eb9f6 - std[5e6a7ab4ec51e2fa]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[75da62af7afad68]::util::run_in_thread_pool_with_globals<rustc_interface[75da62af7afad68]::interface::run_compiler<core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>, rustc_driver_impl[9fb98086b5dc1b8]::run_compiler::{closure#1}>::{closure#0}, core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>
  57:     0x7faab02eb7a5 - <<std[5e6a7ab4ec51e2fa]::thread::Builder>::spawn_unchecked_<rustc_interface[75da62af7afad68]::util::run_in_thread_pool_with_globals<rustc_interface[75da62af7afad68]::interface::run_compiler<core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>, rustc_driver_impl[9fb98086b5dc1b8]::run_compiler::{closure#1}>::{closure#0}, core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>::{closure#1} as core[5a025f5ac19a3684]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  58:     0x7faab1f6df55 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3b57fe0fe8253eda
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/alloc/src/boxed.rs:1985:9
  59:     0x7faab1f6df55 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6eac2c7c988070fa
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/alloc/src/boxed.rs:1985:9
  60:     0x7faab1f6df55 - std::sys::unix::thread::Thread::new::thread_start::h8d73f1104f34aa7b
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/sys/unix/thread.rs:108:17
  61:     0x7faaada6444b - <unknown>
  62:     0x7faaadae7e40 - <unknown>
  63:                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.72.0-nightly (1d7d82472 2023-06-17) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [layout_of] computing layout of `&SUtf16Str`
#1 [layout_of] computing layout of `core::option::Option<&SUtf16Str>`
#2 [typeck] type-checking `<impl at treereduce.out:38:1: 38:15>::from_ptr`
#3 [used_trait_imports] finding used_trait_imports `<impl at treereduce.out:38:1: 38:15>::from_ptr`
#4 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 5 previous errors

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

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Jun 17, 2023
@matthiaskrgr
Copy link
Member Author

matthiaskrgr commented Jun 17, 2023

crashes since nightly-2023-01-13

Regression in 2b8590e

rust-lang-ci@07baff0 #106309

@compiler-errors compiler-errors self-assigned this Jun 17, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 23, 2023
…yout, r=wesleywiser

Don't ICE on unnormalized struct tail in layout computation

1. We try to compute a `SizeSkeleton` even if a layout error occurs, but we really only need to do this if we get `LayoutError::Unknown`, since that means our type is too polymorphic to actually compute the full layout. If we have other errors, like `LayoutError::NormalizationError` or `LayoutError::Cycle`, then we can't really make any progress, since this represents an actual error.
2. Avoid using `normalize_erasing_regions` and `struct_tail_erasing_lifetimes` since those ICE on normalization errors, and since we may call `layout_of` in HIR typeck, we don't know for certain that we're on the happy path.

Fixes rust-lang#112736
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 23, 2023
…yout, r=wesleywiser

Don't ICE on unnormalized struct tail in layout computation

1. We try to compute a `SizeSkeleton` even if a layout error occurs, but we really only need to do this if we get `LayoutError::Unknown`, since that means our type is too polymorphic to actually compute the full layout. If we have other errors, like `LayoutError::NormalizationError` or `LayoutError::Cycle`, then we can't really make any progress, since this represents an actual error.
2. Avoid using `normalize_erasing_regions` and `struct_tail_erasing_lifetimes` since those ICE on normalization errors, and since we may call `layout_of` in HIR typeck, we don't know for certain that we're on the happy path.

Fixes rust-lang#112736
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 23, 2023
…yout, r=wesleywiser

Don't ICE on unnormalized struct tail in layout computation

1. We try to compute a `SizeSkeleton` even if a layout error occurs, but we really only need to do this if we get `LayoutError::Unknown`, since that means our type is too polymorphic to actually compute the full layout. If we have other errors, like `LayoutError::NormalizationError` or `LayoutError::Cycle`, then we can't really make any progress, since this represents an actual error.
2. Avoid using `normalize_erasing_regions` and `struct_tail_erasing_lifetimes` since those ICE on normalization errors, and since we may call `layout_of` in HIR typeck, we don't know for certain that we're on the happy path.

Fixes rust-lang#112736
@bors bors closed this as completed in cea5ae0 Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants