Closed
Description
Code
struct Apple((Apple, Option(Banana ? Citron)));
fn main(){}
Error output
thread 'rustc' panicked at 'assertion failed: elem.index() < self.domain_size', /rustc/0da281b6068a7d889ae89a9bd8991284cc9b7535/compiler/rustc_index/src/bit_set.rs:161:9
Full output including backtrace
error: invalid `?` in type
--> u.rs:1:36
|
1 | struct Apple((Apple, Option(Banana ? Citron)));
| ^ `?` is only allowed on expressions, not types
|
help: if you meant to express that the type might not contain a value, use the `Option` wrapper type
|
1 | struct Apple((Apple, Option(Option<Banana > Citron)));
| +++++++ ~
error: expected one of `)` or `,`, found `Citron`
--> u.rs:1:38
|
1 | struct Apple((Apple, Option(Banana ? Citron)));
| -^^^^^^ expected one of `)` or `,`
| |
| help: missing `,`
error[E0412]: cannot find type `Citron` in this scope
--> u.rs:1:38
|
1 | struct Apple((Apple, Option(Banana ? Citron)));
| ^^^^^^ not found in this scope
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> u.rs:1:22
|
1 | struct Apple((Apple, Option(Banana ? Citron)));
| ^^^^^^^^^^^^^^^^^^^^^^^ only `Fn` traits may use parentheses
|
help: use angle brackets instead
|
1 | struct Apple((Apple, Option<Banana ? Citron>));
| ~ ~
thread 'rustc' panicked at 'assertion failed: elem.index() < self.domain_size', /rustc/0da281b6068a7d889ae89a9bd8991284cc9b7535/compiler/rustc_index/src/bit_set.rs:161:9
stack backtrace:
0: 0x106f8a8a2 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h98e7719cdb057d8f
1: 0x106fe274a - core::fmt::write::he324e6f3a7ef7ed0
2: 0x106f7c97c - std::io::Write::write_fmt::h295c914c323e508a
3: 0x106f8a66a - std::sys_common::backtrace::print::hb2f2bd76d0a1d9b2
4: 0x106f8da76 - std::panicking::default_hook::{{closure}}::h7f2a23a911934152
5: 0x106f8d7c7 - std::panicking::default_hook::h576cf5867894044c
6: 0x112f8262d - rustc_driver[ba5c792b9438c2b]::DEFAULT_HOOK::{closure#0}::{closure#0}
7: 0x106f8e271 - std::panicking::rust_panic_with_hook::hf0781b554a936fbf
8: 0x106f8dfc2 - std::panicking::begin_panic_handler::{{closure}}::h8d2525e276d552d8
9: 0x106f8ad38 - std::sys_common::backtrace::__rust_end_short_backtrace::hf3badbbd5492e2d6
10: 0x106f8dccd - _rust_begin_unwind
11: 0x10700f1b3 - core::panicking::panic_fmt::h15d4409e62dc090a
12: 0x10700f287 - core::panicking::panic::h503de31a4470d5f7
13: 0x117747a5b - rustc_middle[298407787cc28eff]::values::find_item_ty_spans
14: 0x1177477e5 - rustc_middle[298407787cc28eff]::values::find_item_ty_spans
15: 0x11774601c - rustc_middle[298407787cc28eff]::values::recursive_type_error
16: 0x1177eb5a9 - <rustc_middle[298407787cc28eff]::ty::adt::Representability as rustc_query_system[fd3d689380a50de4]::values::Value<rustc_middle[298407787cc28eff]::ty::context::TyCtxt>>::from_cycle_error
17: 0x117c5c66d - rustc_query_system[fd3d689380a50de4]::query::plumbing::mk_cycle::<rustc_query_impl[f77634870212a75e]::plumbing::QueryCtxt, rustc_middle[298407787cc28eff]::ty::adt::Representability, rustc_middle[298407787cc28eff]::ty::adt::Representability>
18: 0x116767a32 - rustc_query_system[fd3d689380a50de4]::query::plumbing::try_execute_query::<rustc_query_impl[f77634870212a75e]::plumbing::QueryCtxt, rustc_query_system[fd3d689380a50de4]::query::caches::DefaultCache<rustc_span[73e074df7cba0abf]::def_id::LocalDefId, rustc_middle[298407787cc28eff]::ty::adt::Representability>>
19: 0x11685f309 - rustc_query_system[fd3d689380a50de4]::query::plumbing::get_query::<rustc_query_impl[f77634870212a75e]::queries::representability, rustc_query_impl[f77634870212a75e]::plumbing::QueryCtxt>
20: 0x115748f97 - rustc_ty_utils[c85f993db90c93e8]::representability::representability_adt_ty
21: 0x11675ab4c - rustc_query_system[fd3d689380a50de4]::query::plumbing::try_execute_query::<rustc_query_impl[f77634870212a75e]::plumbing::QueryCtxt, rustc_query_system[fd3d689380a50de4]::query::caches::DefaultCache<rustc_middle[298407787cc28eff]::ty::Ty, rustc_middle[298407787cc28eff]::ty::adt::Representability>>
22: 0x116867cd8 - rustc_query_system[fd3d689380a50de4]::query::plumbing::get_query::<rustc_query_impl[f77634870212a75e]::queries::representability_adt_ty, rustc_query_impl[f77634870212a75e]::plumbing::QueryCtxt>
23: 0x115748bc9 - rustc_ty_utils[c85f993db90c93e8]::representability::representability_ty
24: 0x115748a65 - rustc_ty_utils[c85f993db90c93e8]::representability::representability_ty
25: 0x1157486f0 - rustc_ty_utils[c85f993db90c93e8]::representability::representability
26: 0x116767502 - rustc_query_system[fd3d689380a50de4]::query::plumbing::try_execute_query::<rustc_query_impl[f77634870212a75e]::plumbing::QueryCtxt, rustc_query_system[fd3d689380a50de4]::query::caches::DefaultCache<rustc_span[73e074df7cba0abf]::def_id::LocalDefId, rustc_middle[298407787cc28eff]::ty::adt::Representability>>
27: 0x11685f309 - rustc_query_system[fd3d689380a50de4]::query::plumbing::get_query::<rustc_query_impl[f77634870212a75e]::queries::representability, rustc_query_impl[f77634870212a75e]::plumbing::QueryCtxt>
28: 0x1157484b8 - rustc_ty_utils[c85f993db90c93e8]::representability::representability
29: 0x116767502 - rustc_query_system[fd3d689380a50de4]::query::plumbing::try_execute_query::<rustc_query_impl[f77634870212a75e]::plumbing::QueryCtxt, rustc_query_system[fd3d689380a50de4]::query::caches::DefaultCache<rustc_span[73e074df7cba0abf]::def_id::LocalDefId, rustc_middle[298407787cc28eff]::ty::adt::Representability>>
30: 0x11685f309 - rustc_query_system[fd3d689380a50de4]::query::plumbing::get_query::<rustc_query_impl[f77634870212a75e]::queries::representability, rustc_query_impl[f77634870212a75e]::plumbing::QueryCtxt>
31: 0x115a83b18 - rustc_hir_analysis[3f5a3f8b91adb05]::check::wfcheck::check_item
32: 0x115a7511f - rustc_hir_analysis[3f5a3f8b91adb05]::check::wfcheck::check_well_formed
33: 0x1167ca855 - rustc_query_system[fd3d689380a50de4]::query::plumbing::try_execute_query::<rustc_query_impl[f77634870212a75e]::plumbing::QueryCtxt, rustc_query_system[fd3d689380a50de4]::query::caches::DefaultCache<rustc_hir[7dceeafd8b0a3ae3]::hir_id::OwnerId, ()>>
34: 0x11685fba5 - rustc_query_system[fd3d689380a50de4]::query::plumbing::get_query::<rustc_query_impl[f77634870212a75e]::queries::check_well_formed, rustc_query_impl[f77634870212a75e]::plumbing::QueryCtxt>
35: 0x11597bf8b - rustc_data_structures[445d045225b5bae3]::sync::par_for_each_in::<&[rustc_hir[7dceeafd8b0a3ae3]::hir::ItemId], <rustc_middle[298407787cc28eff]::hir::ModuleItems>::par_items<rustc_hir_analysis[3f5a3f8b91adb05]::check::wfcheck::check_mod_type_wf::{closure#0}>::{closure#0}>
36: 0x115a7e411 - rustc_hir_analysis[3f5a3f8b91adb05]::check::wfcheck::check_mod_type_wf
37: 0x116770855 - rustc_query_system[fd3d689380a50de4]::query::plumbing::try_execute_query::<rustc_query_impl[f77634870212a75e]::plumbing::QueryCtxt, rustc_query_system[fd3d689380a50de4]::query::caches::DefaultCache<rustc_span[73e074df7cba0abf]::def_id::LocalDefId, ()>>
38: 0x11685fa85 - rustc_query_system[fd3d689380a50de4]::query::plumbing::get_query::<rustc_query_impl[f77634870212a75e]::queries::check_mod_type_wf, rustc_query_impl[f77634870212a75e]::plumbing::QueryCtxt>
39: 0x11597c08b - rustc_data_structures[445d045225b5bae3]::sync::par_for_each_in::<&[rustc_hir[7dceeafd8b0a3ae3]::hir_id::OwnerId], <rustc_middle[298407787cc28eff]::hir::map::Map>::par_for_each_module<rustc_hir_analysis[3f5a3f8b91adb05]::check_crate::{closure#5}::{closure#0}::{closure#0}>::{closure#0}>
40: 0x1159e6f20 - <rustc_session[43d2d941ace548e5]::session::Session>::track_errors::<rustc_hir_analysis[3f5a3f8b91adb05]::check_crate::{closure#5}, ()>
41: 0x115995352 - rustc_hir_analysis[3f5a3f8b91adb05]::check_crate
42: 0x11305afda - rustc_interface[a666f6d755ed9279]::passes::analysis
43: 0x1167f326c - rustc_query_system[fd3d689380a50de4]::query::plumbing::try_execute_query::<rustc_query_impl[f77634870212a75e]::plumbing::QueryCtxt, rustc_query_system[fd3d689380a50de4]::query::caches::DefaultCache<(), core[13371b8ce97f01bb]::result::Result<(), rustc_errors[b0e16a209d58ca7d]::ErrorGuaranteed>>>
44: 0x11686d3f9 - rustc_query_system[fd3d689380a50de4]::query::plumbing::get_query::<rustc_query_impl[f77634870212a75e]::queries::analysis, rustc_query_impl[f77634870212a75e]::plumbing::QueryCtxt>
45: 0x112f11296 - <rustc_interface[a666f6d755ed9279]::passes::QueryContext>::enter::<rustc_driver[ba5c792b9438c2b]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[13371b8ce97f01bb]::result::Result<(), rustc_errors[b0e16a209d58ca7d]::ErrorGuaranteed>>
46: 0x112f55a4d - rustc_span[73e074df7cba0abf]::with_source_map::<core[13371b8ce97f01bb]::result::Result<(), rustc_errors[b0e16a209d58ca7d]::ErrorGuaranteed>, rustc_interface[a666f6d755ed9279]::interface::run_compiler<core[13371b8ce97f01bb]::result::Result<(), rustc_errors[b0e16a209d58ca7d]::ErrorGuaranteed>, rustc_driver[ba5c792b9438c2b]::run_compiler::{closure#1}>::{closure#0}::{closure#1}>
47: 0x112f4534c - <scoped_tls[c17fceff1b2b43d8]::ScopedKey<rustc_span[73e074df7cba0abf]::SessionGlobals>>::set::<rustc_interface[a666f6d755ed9279]::interface::run_compiler<core[13371b8ce97f01bb]::result::Result<(), rustc_errors[b0e16a209d58ca7d]::ErrorGuaranteed>, rustc_driver[ba5c792b9438c2b]::run_compiler::{closure#1}>::{closure#0}, core[13371b8ce97f01bb]::result::Result<(), rustc_errors[b0e16a209d58ca7d]::ErrorGuaranteed>>
48: 0x112f14e5a - std[8878bd7dd366d71b]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[a666f6d755ed9279]::util::run_in_thread_pool_with_globals<rustc_interface[a666f6d755ed9279]::interface::run_compiler<core[13371b8ce97f01bb]::result::Result<(), rustc_errors[b0e16a209d58ca7d]::ErrorGuaranteed>, rustc_driver[ba5c792b9438c2b]::run_compiler::{closure#1}>::{closure#0}, core[13371b8ce97f01bb]::result::Result<(), rustc_errors[b0e16a209d58ca7d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[13371b8ce97f01bb]::result::Result<(), rustc_errors[b0e16a209d58ca7d]::ErrorGuaranteed>>
49: 0x112efaf7b - <<std[8878bd7dd366d71b]::thread::Builder>::spawn_unchecked_<rustc_interface[a666f6d755ed9279]::util::run_in_thread_pool_with_globals<rustc_interface[a666f6d755ed9279]::interface::run_compiler<core[13371b8ce97f01bb]::result::Result<(), rustc_errors[b0e16a209d58ca7d]::ErrorGuaranteed>, rustc_driver[ba5c792b9438c2b]::run_compiler::{closure#1}>::{closure#0}, core[13371b8ce97f01bb]::result::Result<(), rustc_errors[b0e16a209d58ca7d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[13371b8ce97f01bb]::result::Result<(), rustc_errors[b0e16a209d58ca7d]::ErrorGuaranteed>>::{closure#1} as core[13371b8ce97f01bb]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
50: 0x106f97387 - std::sys::unix::thread::Thread::new::thread_start::hfd54df40dd14130e
51: 0x7ff814d514e1 - __pthread_start
error: internal compiler error: unexpected panic
note: 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.66.0-nightly (0da281b60 2022-10-27) running on x86_64-apple-darwin
query stack during panic:
#0 [representability_adt_ty] checking if `Apple` is representable
#1 [representability] checking if `Apple::0` is representable
#2 [representability] checking if `Apple` is representable
#3 [check_well_formed] checking that `Apple` is well-formed
#4 [check_mod_type_wf] checking that types are well-formed in top-level module
#5 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors
Version
rustc 1.66.0-nightly (0da281b60 2022-10-27)
binary: rustc
commit-hash: 0da281b6068a7d889ae89a9bd8991284cc9b7535
commit-date: 2022-10-27
host: x86_64-apple-darwin
release: 1.66.0-nightly
LLVM version: 15.0.2
Regression
Regression from bba9785 (#100720)
Bisection details
bisected with cargo-bisect-rustc v0.6.4
searched nightlies: from nightly-2022-10-06 to nightly-2022-10-28
regressed nightly: nightly-2022-10-09
searched commit range: 8b0c05d...8796e7a
regressed commit: bba9785
Host triple: x86_64-apple-darwin