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: field.0.is_sized() #113760

Closed
matthiaskrgr opened this issue Jul 16, 2023 · 4 comments · Fixed by #113773
Closed

ICE: field.0.is_sized() #113760

matthiaskrgr opened this issue Jul 16, 2023 · 4 comments · Fixed by #113773
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

use std::sync::OnceLock;

pub struct WeakOnce<T>(OnceLock<dyn Iterator<Item: '_>>);

pub(crate) static ONCE: WeakOnce<Context> = WeakOnce::new();

Meta

rustc --version --verbose:

rustc 1.73.0-nightly (4c8bb79d9 2023-07-15)
binary: rustc
commit-hash: 4c8bb79d9f565115637cc6da739f8389e79f3a29
commit-date: 2023-07-15
host: x86_64-unknown-linux-gnu
release: 1.73.0-nightly
LLVM version: 16.0.5

Error output

error[E0106]: missing lifetime specifier
 --> treereduce.out:3:52
  |
3 | pub struct WeakOnce<T>(OnceLock<dyn Iterator<Item: '_>>);
  |                                                    ^^ expected named lifetime parameter
  |
  = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
help: consider making the bound lifetime-generic with a new `'a` lifetime
  |
3 | pub struct WeakOnce<T>(OnceLock<dyn for<'a> Iterator<Item: 'a>>);
  |                                     +++++++                ~~
help: consider introducing a named lifetime parameter
  |
3 | pub struct WeakOnce<'a, T>(OnceLock<dyn Iterator<Item: 'a>>);
  |                     +++                                ~~

error[E0412]: cannot find type `Context` in this scope
 --> treereduce.out:5:34
  |
5 | pub(crate) static ONCE: WeakOnce<Context> = WeakOnce::new();
  |                                  ^^^^^^^ not found in this scope
  |
help: consider importing this struct
  |
1 + use std::task::Context;
  |

error[E0658]: associated type bounds are unstable
 --> treereduce.out:3:46
  |
3 | pub struct WeakOnce<T>(OnceLock<dyn Iterator<Item: '_>>);
  |                                              ^^^^^^^^
  |
  = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
  = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error: associated type bounds are only allowed in where clauses and function signatures, not in field types
 --> treereduce.out:3:46
  |
3 | pub struct WeakOnce<T>(OnceLock<dyn Iterator<Item: '_>>);
  |                                              ^^^^^^^^

error[E0601]: `main` function not found in crate `treereduce`
 --> treereduce.out:5:61
  |
5 | pub(crate) static ONCE: WeakOnce<Context> = WeakOnce::new();
  |                                                             ^ consider adding a `main` function to `treereduce.out`

error[E0599]: no function or associated item named `new` found for struct `WeakOnce` in the current scope
 --> treereduce.out:5:55
  |
3 | pub struct WeakOnce<T>(OnceLock<dyn Iterator<Item: '_>>);
  | ---------------------- function or associated item `new` not found for this struct
4 |
5 | pub(crate) static ONCE: WeakOnce<Context> = WeakOnce::new();
  |                                                       ^^^ function or associated item not found in `WeakOnce<_>`
Backtrace

thread 'rustc' panicked at 'assertion failed: field.0.is_sized()', /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/compiler/rustc_abi/src/layout.rs:766:13
stack backtrace:
   0:     0x7f048a1641e1 - std::backtrace_rs::backtrace::libunwind::trace::h3b5c50f24cf4b35a
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f048a1641e1 - std::backtrace_rs::backtrace::trace_unsynchronized::he026a26ead582316
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f048a1641e1 - std::sys_common::backtrace::_print_fmt::h76fd67678968a4e3
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f048a1641e1 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hdd83524e3f3c2be2
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f048a1ca19c - core::fmt::rt::Argument::fmt::h654276e7f109452e
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/core/src/fmt/rt.rs:138:9
   5:     0x7f048a1ca19c - core::fmt::write::h138407e966f7b43b
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f048a156b8e - std::io::Write::write_fmt::h2424dcece48dafda
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/std/src/io/mod.rs:1714:15
   7:     0x7f048a163ff5 - std::sys_common::backtrace::_print::hed0bf89a99fb894c
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f048a163ff5 - std::sys_common::backtrace::print::h247f5c941c9353a5
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f048a166da3 - std::panicking::default_hook::{{closure}}::hcccd6b964b717049
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/std/src/panicking.rs:269:22
  10:     0x7f048a166b34 - std::panicking::default_hook::hce795b61120bca6d
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/std/src/panicking.rs:288:9
  11:     0x7f048d3f827b - <rustc_driver_impl[36a7eaa3807b03c1]::install_ice_hook::{closure#0} as core[81c8fe8a09de0f06]::ops::function::FnOnce<(&core[81c8fe8a09de0f06]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7f048a1675ce - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h3187784b6c983a99
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/alloc/src/boxed.rs:2021:9
  13:     0x7f048a1675ce - std::panicking::rust_panic_with_hook::h46c9d18986d08847
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/std/src/panicking.rs:709:13
  14:     0x7f048a167311 - std::panicking::begin_panic_handler::{{closure}}::h9240e694e6b0cb3e
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/std/src/panicking.rs:595:13
  15:     0x7f048a164646 - std::sys_common::backtrace::__rust_end_short_backtrace::h37d9a711c5606b4e
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/std/src/sys_common/backtrace.rs:151:18
  16:     0x7f048a1670a2 - rust_begin_unwind
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/std/src/panicking.rs:593:5
  17:     0x7f048a1c6543 - core::panicking::panic_fmt::hb353582dad440800
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/core/src/panicking.rs:67:14
  18:     0x7f048a1c65d3 - core::panicking::panic::hfb3ea9ceb774db6b
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/core/src/panicking.rs:117:5
  19:     0x7f048c333230 - <rustc_middle[bafd45fe52eb4faf]::ty::layout::LayoutCx<rustc_middle[bafd45fe52eb4faf]::ty::context::TyCtxt> as rustc_abi[8d56ae912b876514]::layout::LayoutCalculator>::layout_of_union
  20:     0x7f048c31b39b - rustc_ty_utils[3b78d04571512db1]::layout::layout_of
  21:     0x7f048b437f3e - rustc_query_impl[f1760b35ee71e15a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f1760b35ee71e15a]::query_impl::layout_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bafd45fe52eb4faf]::query::erase::Erased<[u8; 16usize]>>
  22:     0x7f048bdaa4b1 - rustc_query_system[a39b5eca44b3ed3c]::query::plumbing::try_execute_query::<rustc_query_impl[f1760b35ee71e15a]::DynamicConfig<rustc_query_system[a39b5eca44b3ed3c]::query::caches::DefaultCache<rustc_middle[bafd45fe52eb4faf]::ty::ParamEnvAnd<rustc_middle[bafd45fe52eb4faf]::ty::Ty>, rustc_middle[bafd45fe52eb4faf]::query::erase::Erased<[u8; 16usize]>>, false, true, false>, rustc_query_impl[f1760b35ee71e15a]::plumbing::QueryCtxt, false>
  23:     0x7f048bdaa102 - rustc_query_impl[f1760b35ee71e15a]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace
  24:     0x7f048b54e615 - <core[81c8fe8a09de0f06]::iter::adapters::GenericShunt<core[81c8fe8a09de0f06]::iter::adapters::by_ref_sized::ByRefSized<core[81c8fe8a09de0f06]::iter::adapters::map::Map<core[81c8fe8a09de0f06]::slice::iter::Iter<rustc_middle[bafd45fe52eb4faf]::ty::FieldDef>, rustc_ty_utils[3b78d04571512db1]::layout::layout_of_uncached::{closure#8}::{closure#0}>>, core[81c8fe8a09de0f06]::result::Result<core[81c8fe8a09de0f06]::convert::Infallible, &rustc_middle[bafd45fe52eb4faf]::ty::layout::LayoutError>> as core[81c8fe8a09de0f06]::iter::traits::iterator::Iterator>::next
  25:     0x7f048c320329 - core[81c8fe8a09de0f06]::iter::adapters::try_process::<core[81c8fe8a09de0f06]::iter::adapters::by_ref_sized::ByRefSized<core[81c8fe8a09de0f06]::iter::adapters::map::Map<core[81c8fe8a09de0f06]::slice::iter::Iter<rustc_middle[bafd45fe52eb4faf]::ty::VariantDef>, rustc_ty_utils[3b78d04571512db1]::layout::layout_of_uncached::{closure#8}>>, rustc_index[662aeb3083791134]::vec::IndexVec<rustc_abi[8d56ae912b876514]::FieldIdx, rustc_abi[8d56ae912b876514]::Layout>, core[81c8fe8a09de0f06]::result::Result<core[81c8fe8a09de0f06]::convert::Infallible, &rustc_middle[bafd45fe52eb4faf]::ty::layout::LayoutError>, <core[81c8fe8a09de0f06]::iter::adapters::map::Map<core[81c8fe8a09de0f06]::slice::iter::Iter<rustc_middle[bafd45fe52eb4faf]::ty::VariantDef>, rustc_ty_utils[3b78d04571512db1]::layout::layout_of_uncached::{closure#8}> as core[81c8fe8a09de0f06]::iter::traits::iterator::Iterator>::try_collect<rustc_index[662aeb3083791134]::vec::IndexVec<rustc_abi[8d56ae912b876514]::VariantIdx, rustc_index[662aeb3083791134]::vec::IndexVec<rustc_abi[8d56ae912b876514]::FieldIdx, rustc_abi[8d56ae912b876514]::Layout>>>::{closure#0}, rustc_index[662aeb3083791134]::vec::IndexVec<rustc_abi[8d56ae912b876514]::VariantIdx, rustc_index[662aeb3083791134]::vec::IndexVec<rustc_abi[8d56ae912b876514]::FieldIdx, rustc_abi[8d56ae912b876514]::Layout>>>
  26:     0x7f048c31a0cc - rustc_ty_utils[3b78d04571512db1]::layout::layout_of
  27:     0x7f048b437f3e - rustc_query_impl[f1760b35ee71e15a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f1760b35ee71e15a]::query_impl::layout_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bafd45fe52eb4faf]::query::erase::Erased<[u8; 16usize]>>
  28:     0x7f048bdaa4b1 - rustc_query_system[a39b5eca44b3ed3c]::query::plumbing::try_execute_query::<rustc_query_impl[f1760b35ee71e15a]::DynamicConfig<rustc_query_system[a39b5eca44b3ed3c]::query::caches::DefaultCache<rustc_middle[bafd45fe52eb4faf]::ty::ParamEnvAnd<rustc_middle[bafd45fe52eb4faf]::ty::Ty>, rustc_middle[bafd45fe52eb4faf]::query::erase::Erased<[u8; 16usize]>>, false, true, false>, rustc_query_impl[f1760b35ee71e15a]::plumbing::QueryCtxt, false>
  29:     0x7f048bdaa102 - rustc_query_impl[f1760b35ee71e15a]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace
  30:     0x7f048b54e615 - <core[81c8fe8a09de0f06]::iter::adapters::GenericShunt<core[81c8fe8a09de0f06]::iter::adapters::by_ref_sized::ByRefSized<core[81c8fe8a09de0f06]::iter::adapters::map::Map<core[81c8fe8a09de0f06]::slice::iter::Iter<rustc_middle[bafd45fe52eb4faf]::ty::FieldDef>, rustc_ty_utils[3b78d04571512db1]::layout::layout_of_uncached::{closure#8}::{closure#0}>>, core[81c8fe8a09de0f06]::result::Result<core[81c8fe8a09de0f06]::convert::Infallible, &rustc_middle[bafd45fe52eb4faf]::ty::layout::LayoutError>> as core[81c8fe8a09de0f06]::iter::traits::iterator::Iterator>::next
  31:     0x7f048c32039b - core[81c8fe8a09de0f06]::iter::adapters::try_process::<core[81c8fe8a09de0f06]::iter::adapters::by_ref_sized::ByRefSized<core[81c8fe8a09de0f06]::iter::adapters::map::Map<core[81c8fe8a09de0f06]::slice::iter::Iter<rustc_middle[bafd45fe52eb4faf]::ty::VariantDef>, rustc_ty_utils[3b78d04571512db1]::layout::layout_of_uncached::{closure#8}>>, rustc_index[662aeb3083791134]::vec::IndexVec<rustc_abi[8d56ae912b876514]::FieldIdx, rustc_abi[8d56ae912b876514]::Layout>, core[81c8fe8a09de0f06]::result::Result<core[81c8fe8a09de0f06]::convert::Infallible, &rustc_middle[bafd45fe52eb4faf]::ty::layout::LayoutError>, <core[81c8fe8a09de0f06]::iter::adapters::map::Map<core[81c8fe8a09de0f06]::slice::iter::Iter<rustc_middle[bafd45fe52eb4faf]::ty::VariantDef>, rustc_ty_utils[3b78d04571512db1]::layout::layout_of_uncached::{closure#8}> as core[81c8fe8a09de0f06]::iter::traits::iterator::Iterator>::try_collect<rustc_index[662aeb3083791134]::vec::IndexVec<rustc_abi[8d56ae912b876514]::VariantIdx, rustc_index[662aeb3083791134]::vec::IndexVec<rustc_abi[8d56ae912b876514]::FieldIdx, rustc_abi[8d56ae912b876514]::Layout>>>::{closure#0}, rustc_index[662aeb3083791134]::vec::IndexVec<rustc_abi[8d56ae912b876514]::VariantIdx, rustc_index[662aeb3083791134]::vec::IndexVec<rustc_abi[8d56ae912b876514]::FieldIdx, rustc_abi[8d56ae912b876514]::Layout>>>
  32:     0x7f048c31a0cc - rustc_ty_utils[3b78d04571512db1]::layout::layout_of
  33:     0x7f048b437f3e - rustc_query_impl[f1760b35ee71e15a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f1760b35ee71e15a]::query_impl::layout_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bafd45fe52eb4faf]::query::erase::Erased<[u8; 16usize]>>
  34:     0x7f048bdaa4b1 - rustc_query_system[a39b5eca44b3ed3c]::query::plumbing::try_execute_query::<rustc_query_impl[f1760b35ee71e15a]::DynamicConfig<rustc_query_system[a39b5eca44b3ed3c]::query::caches::DefaultCache<rustc_middle[bafd45fe52eb4faf]::ty::ParamEnvAnd<rustc_middle[bafd45fe52eb4faf]::ty::Ty>, rustc_middle[bafd45fe52eb4faf]::query::erase::Erased<[u8; 16usize]>>, false, true, false>, rustc_query_impl[f1760b35ee71e15a]::plumbing::QueryCtxt, false>
  35:     0x7f048bdaa102 - rustc_query_impl[f1760b35ee71e15a]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace
  36:     0x7f048c32096e - rustc_middle[bafd45fe52eb4faf]::query::plumbing::query_get_at::<rustc_query_system[a39b5eca44b3ed3c]::query::caches::DefaultCache<rustc_middle[bafd45fe52eb4faf]::ty::ParamEnvAnd<rustc_middle[bafd45fe52eb4faf]::ty::Ty>, rustc_middle[bafd45fe52eb4faf]::query::erase::Erased<[u8; 16usize]>>>
  37:     0x7f048c31af15 - rustc_ty_utils[3b78d04571512db1]::layout::layout_of
  38:     0x7f048b437f3e - rustc_query_impl[f1760b35ee71e15a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f1760b35ee71e15a]::query_impl::layout_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bafd45fe52eb4faf]::query::erase::Erased<[u8; 16usize]>>
  39:     0x7f048bdaa4b1 - rustc_query_system[a39b5eca44b3ed3c]::query::plumbing::try_execute_query::<rustc_query_impl[f1760b35ee71e15a]::DynamicConfig<rustc_query_system[a39b5eca44b3ed3c]::query::caches::DefaultCache<rustc_middle[bafd45fe52eb4faf]::ty::ParamEnvAnd<rustc_middle[bafd45fe52eb4faf]::ty::Ty>, rustc_middle[bafd45fe52eb4faf]::query::erase::Erased<[u8; 16usize]>>, false, true, false>, rustc_query_impl[f1760b35ee71e15a]::plumbing::QueryCtxt, false>
  40:     0x7f048bdaa102 - rustc_query_impl[f1760b35ee71e15a]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace
  41:     0x7f048b54e615 - <core[81c8fe8a09de0f06]::iter::adapters::GenericShunt<core[81c8fe8a09de0f06]::iter::adapters::by_ref_sized::ByRefSized<core[81c8fe8a09de0f06]::iter::adapters::map::Map<core[81c8fe8a09de0f06]::slice::iter::Iter<rustc_middle[bafd45fe52eb4faf]::ty::FieldDef>, rustc_ty_utils[3b78d04571512db1]::layout::layout_of_uncached::{closure#8}::{closure#0}>>, core[81c8fe8a09de0f06]::result::Result<core[81c8fe8a09de0f06]::convert::Infallible, &rustc_middle[bafd45fe52eb4faf]::ty::layout::LayoutError>> as core[81c8fe8a09de0f06]::iter::traits::iterator::Iterator>::next
  42:     0x7f048c320329 - core[81c8fe8a09de0f06]::iter::adapters::try_process::<core[81c8fe8a09de0f06]::iter::adapters::by_ref_sized::ByRefSized<core[81c8fe8a09de0f06]::iter::adapters::map::Map<core[81c8fe8a09de0f06]::slice::iter::Iter<rustc_middle[bafd45fe52eb4faf]::ty::VariantDef>, rustc_ty_utils[3b78d04571512db1]::layout::layout_of_uncached::{closure#8}>>, rustc_index[662aeb3083791134]::vec::IndexVec<rustc_abi[8d56ae912b876514]::FieldIdx, rustc_abi[8d56ae912b876514]::Layout>, core[81c8fe8a09de0f06]::result::Result<core[81c8fe8a09de0f06]::convert::Infallible, &rustc_middle[bafd45fe52eb4faf]::ty::layout::LayoutError>, <core[81c8fe8a09de0f06]::iter::adapters::map::Map<core[81c8fe8a09de0f06]::slice::iter::Iter<rustc_middle[bafd45fe52eb4faf]::ty::VariantDef>, rustc_ty_utils[3b78d04571512db1]::layout::layout_of_uncached::{closure#8}> as core[81c8fe8a09de0f06]::iter::traits::iterator::Iterator>::try_collect<rustc_index[662aeb3083791134]::vec::IndexVec<rustc_abi[8d56ae912b876514]::VariantIdx, rustc_index[662aeb3083791134]::vec::IndexVec<rustc_abi[8d56ae912b876514]::FieldIdx, rustc_abi[8d56ae912b876514]::Layout>>>::{closure#0}, rustc_index[662aeb3083791134]::vec::IndexVec<rustc_abi[8d56ae912b876514]::VariantIdx, rustc_index[662aeb3083791134]::vec::IndexVec<rustc_abi[8d56ae912b876514]::FieldIdx, rustc_abi[8d56ae912b876514]::Layout>>>
  43:     0x7f048c31a0cc - rustc_ty_utils[3b78d04571512db1]::layout::layout_of
  44:     0x7f048b437f3e - rustc_query_impl[f1760b35ee71e15a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f1760b35ee71e15a]::query_impl::layout_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bafd45fe52eb4faf]::query::erase::Erased<[u8; 16usize]>>
  45:     0x7f048bdaa4b1 - rustc_query_system[a39b5eca44b3ed3c]::query::plumbing::try_execute_query::<rustc_query_impl[f1760b35ee71e15a]::DynamicConfig<rustc_query_system[a39b5eca44b3ed3c]::query::caches::DefaultCache<rustc_middle[bafd45fe52eb4faf]::ty::ParamEnvAnd<rustc_middle[bafd45fe52eb4faf]::ty::Ty>, rustc_middle[bafd45fe52eb4faf]::query::erase::Erased<[u8; 16usize]>>, false, true, false>, rustc_query_impl[f1760b35ee71e15a]::plumbing::QueryCtxt, false>
  46:     0x7f048bdaa102 - rustc_query_impl[f1760b35ee71e15a]::query_impl::layout_of::get_query_non_incr::__rust_end_short_backtrace
  47:     0x7f048c3bf883 - rustc_middle[bafd45fe52eb4faf]::query::plumbing::query_get_at::<rustc_query_system[a39b5eca44b3ed3c]::query::caches::DefaultCache<rustc_middle[bafd45fe52eb4faf]::ty::ParamEnvAnd<rustc_middle[bafd45fe52eb4faf]::ty::Ty>, rustc_middle[bafd45fe52eb4faf]::query::erase::Erased<[u8; 16usize]>>>
  48:     0x7f048c3bee43 - rustc_hir_analysis[51ced00d18f9db10]::check::check::check_static_inhabited
  49:     0x7f048c3a9856 - rustc_hir_analysis[51ced00d18f9db10]::check::check::check_mod_item_types
  50:     0x7f048c15db6c - rustc_query_impl[f1760b35ee71e15a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f1760b35ee71e15a]::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bafd45fe52eb4faf]::query::erase::Erased<[u8; 0usize]>>
  51:     0x7f048c15db4e - <rustc_query_impl[f1760b35ee71e15a]::query_impl::check_mod_item_types::dynamic_query::{closure#2} as core[81c8fe8a09de0f06]::ops::function::FnOnce<(rustc_middle[bafd45fe52eb4faf]::ty::context::TyCtxt, rustc_span[d4de8c39017ea598]::def_id::LocalDefId)>>::call_once
  52:     0x7f048bd52b2f - rustc_query_system[a39b5eca44b3ed3c]::query::plumbing::try_execute_query::<rustc_query_impl[f1760b35ee71e15a]::DynamicConfig<rustc_query_system[a39b5eca44b3ed3c]::query::caches::VecCache<rustc_span[d4de8c39017ea598]::def_id::LocalDefId, rustc_middle[bafd45fe52eb4faf]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[f1760b35ee71e15a]::plumbing::QueryCtxt, false>
  53:     0x7f048cd2da22 - rustc_query_impl[f1760b35ee71e15a]::query_impl::check_mod_item_types::get_query_non_incr::__rust_end_short_backtrace
  54:     0x7f048c8af077 - <rustc_middle[bafd45fe52eb4faf]::hir::map::Map>::for_each_module::<rustc_hir_analysis[51ced00d18f9db10]::check_crate::{closure#6}::{closure#0}>
  55:     0x7f048c8ae2ed - <rustc_session[b1a5d361b73cfad9]::session::Session>::time::<(), rustc_hir_analysis[51ced00d18f9db10]::check_crate::{closure#6}>
  56:     0x7f048c8acf1a - rustc_hir_analysis[51ced00d18f9db10]::check_crate
  57:     0x7f048c8a433a - rustc_interface[b60702df0ae80ef4]::passes::analysis
  58:     0x7f048c87fb3a - rustc_query_impl[f1760b35ee71e15a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f1760b35ee71e15a]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bafd45fe52eb4faf]::query::erase::Erased<[u8; 1usize]>>
  59:     0x7f048c87fb29 - <rustc_query_impl[f1760b35ee71e15a]::query_impl::analysis::dynamic_query::{closure#2} as core[81c8fe8a09de0f06]::ops::function::FnOnce<(rustc_middle[bafd45fe52eb4faf]::ty::context::TyCtxt, ())>>::call_once
  60:     0x7f048ca5bc68 - rustc_query_system[a39b5eca44b3ed3c]::query::plumbing::try_execute_query::<rustc_query_impl[f1760b35ee71e15a]::DynamicConfig<rustc_query_system[a39b5eca44b3ed3c]::query::caches::SingleCache<rustc_middle[bafd45fe52eb4faf]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[f1760b35ee71e15a]::plumbing::QueryCtxt, false>
  61:     0x7f048ca5ba47 - rustc_query_impl[f1760b35ee71e15a]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  62:     0x7f048c66e835 - <rustc_middle[bafd45fe52eb4faf]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[36a7eaa3807b03c1]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[81c8fe8a09de0f06]::result::Result<(), rustc_span[d4de8c39017ea598]::ErrorGuaranteed>>
  63:     0x7f048c66de62 - <rustc_interface[b60702df0ae80ef4]::interface::Compiler>::enter::<rustc_driver_impl[36a7eaa3807b03c1]::run_compiler::{closure#1}::{closure#2}, core[81c8fe8a09de0f06]::result::Result<core[81c8fe8a09de0f06]::option::Option<rustc_interface[b60702df0ae80ef4]::queries::Linker>, rustc_span[d4de8c39017ea598]::ErrorGuaranteed>>
  64:     0x7f048c6671d5 - rustc_span[d4de8c39017ea598]::set_source_map::<core[81c8fe8a09de0f06]::result::Result<(), rustc_span[d4de8c39017ea598]::ErrorGuaranteed>, rustc_interface[b60702df0ae80ef4]::interface::run_compiler<core[81c8fe8a09de0f06]::result::Result<(), rustc_span[d4de8c39017ea598]::ErrorGuaranteed>, rustc_driver_impl[36a7eaa3807b03c1]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  65:     0x7f048c666c46 - <scoped_tls[121ecede58d5c05f]::ScopedKey<rustc_span[d4de8c39017ea598]::SessionGlobals>>::set::<rustc_interface[b60702df0ae80ef4]::interface::run_compiler<core[81c8fe8a09de0f06]::result::Result<(), rustc_span[d4de8c39017ea598]::ErrorGuaranteed>, rustc_driver_impl[36a7eaa3807b03c1]::run_compiler::{closure#1}>::{closure#0}, core[81c8fe8a09de0f06]::result::Result<(), rustc_span[d4de8c39017ea598]::ErrorGuaranteed>>
  66:     0x7f048c66620c - std[fa39155a576d62c5]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[b60702df0ae80ef4]::util::run_in_thread_pool_with_globals<rustc_interface[b60702df0ae80ef4]::interface::run_compiler<core[81c8fe8a09de0f06]::result::Result<(), rustc_span[d4de8c39017ea598]::ErrorGuaranteed>, rustc_driver_impl[36a7eaa3807b03c1]::run_compiler::{closure#1}>::{closure#0}, core[81c8fe8a09de0f06]::result::Result<(), rustc_span[d4de8c39017ea598]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[81c8fe8a09de0f06]::result::Result<(), rustc_span[d4de8c39017ea598]::ErrorGuaranteed>>
  67:     0x7f048c665fce - <<std[fa39155a576d62c5]::thread::Builder>::spawn_unchecked_<rustc_interface[b60702df0ae80ef4]::util::run_in_thread_pool_with_globals<rustc_interface[b60702df0ae80ef4]::interface::run_compiler<core[81c8fe8a09de0f06]::result::Result<(), rustc_span[d4de8c39017ea598]::ErrorGuaranteed>, rustc_driver_impl[36a7eaa3807b03c1]::run_compiler::{closure#1}>::{closure#0}, core[81c8fe8a09de0f06]::result::Result<(), rustc_span[d4de8c39017ea598]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[81c8fe8a09de0f06]::result::Result<(), rustc_span[d4de8c39017ea598]::ErrorGuaranteed>>::{closure#1} as core[81c8fe8a09de0f06]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  68:     0x7f048a171c55 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h83f49025b00909a5
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/alloc/src/boxed.rs:2007:9
  69:     0x7f048a171c55 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h21b0d4679eed4e05
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/alloc/src/boxed.rs:2007:9
  70:     0x7f048a171c55 - std::sys::unix::thread::Thread::new::thread_start::h030641e4e4790460
                               at /rustc/4c8bb79d9f565115637cc6da739f8389e79f3a29/library/std/src/sys/unix/thread.rs:108:17
  71:     0x7f0489f0444b - <unknown>
  72:     0x7f0489f87e40 - <unknown>
  73:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

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.73.0-nightly (4c8bb79d9 2023-07-15) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [layout_of] computing layout of `core::mem::maybe_uninit::MaybeUninit<dyn core::iter::traits::iterator::Iterator<Item = {type error}>>`
#1 [layout_of] computing layout of `core::cell::UnsafeCell<core::mem::maybe_uninit::MaybeUninit<dyn core::iter::traits::iterator::Iterator<Item = {type error}>>>`
#2 [layout_of] computing layout of `std::sync::once_lock::OnceLock<dyn core::iter::traits::iterator::Iterator<Item = {type error}>>`
#3 [layout_of] computing layout of `std::sync::once_lock::OnceLock<(dyn core::iter::traits::iterator::Iterator<Item = {type error}> + 'static)>`
#4 [layout_of] computing layout of `WeakOnce<{type error}>`
#5 [check_mod_item_types] checking item types in top-level module
#6 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 6 previous errors

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

@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 Jul 16, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 16, 2023
@matthiaskrgr matthiaskrgr added the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label Jul 16, 2023
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jul 16, 2023
@matthiaskrgr
Copy link
Member Author

Crashes 1.72.0-beta.1 but not stable 1.71.0

Regression in rust-lang-ci@4c221b7
#112340 cc @lcnr

@compiler-errors
Copy link
Member

compiler-errors commented Jul 16, 2023

Since this went from error -> ICE (specifically because it's neither valid code, and also would need the associated_type_bounds flag even if it were valid), I don't think this needs prioritization and/or the regression tag.

@compiler-errors compiler-errors removed regression-from-stable-to-beta Performance or correctness regression from stable to beta. I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jul 16, 2023
@compiler-errors
Copy link
Member

compiler-errors commented Jul 16, 2023

Minimized too:

union W<T> { s: dyn Iterator<Item = Missing> }

static ONCE: W<()> = todo!();

Or even more minimal:

union W { s: dyn Iterator<Item = Missing> }

static ONCE: W = todo!();

@compiler-errors
Copy link
Member

compiler-errors commented Jul 16, 2023

Also, this didn't really regress in #112340. Before that PR, it ICEd with a slighlty different repro:

union W<T> { t: T, s: dyn Iterator<Item = Missing> }

static ONCE: W<()> = todo!();

Specifically, if you get rid of the "parameter T is never used" error by actually mentioning it in that union W above, then it'll ICE even before #112340.

It probably just regressed in whatever PR introduced that assertion that got triggered.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 28, 2023
…=cjgillot

Don't attempt to compute layout of type referencing error

Leads to more ICEs and strange diagnostics than are worth it.

Fixes rust-lang#113760
@bors bors closed this as completed in 5dee519 Jul 29, 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.

3 participants