-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 using a type alias to a const generic struct across crates #61624
Comments
triage: P-high. Assigning to self for initial investigation. Removing I-nominated label.
|
Oh, given that this is using const generics (an unstable feature), it probably should be P-medium rather than P-high. I won't change the label yet, but if triage on thursday rolls around and I haven't seen a good reason to keep it P-high, I'll change the label then. |
If downstream crates could ICE because they're using a type alias with const generics, even if they don't enable (Sorry, I don't have time to look into this issue at the moment.) |
It's not just type aliases, but also other constellations of cross-crate usage that are giving this ICE: #61806 (comment) |
I continue to have the impression that if you use stable Rust, it will be used on all of your crates, and therefore you won't hit this bug. (don't get me wrong; I've commented elsewhere, rust-call bug #34901 in particular, where I do worry about impact on downstream crates from upstream crates using certain features that have bugs) But I still think this only warrants P-medium. Reclassifying as such. |
I just hit this issue as well in my project. Unfortunately I cannot share the code I'm hitting this with. A repro would look very similar to est31's example here, but in my case the affected type isn't even exposed to the bin application. It's Click for stack
1: std::panicking::take_hook
2: std::panicking::take_hook
3: <rustc::ty::query::queries::analysis as rustc::ty::query::config::QueryDescription>::describe
4: std::panicking::rust_panic_with_hook
5: <rustc_errors::diagnostic::SubDiagnostic as core::fmt::Debug>::fmt
6: rustc_errors::Handler::bug
7: rustc::util::bug::bug_fmt
8: rustc::ty::wf::object_region_bounds
9: rustc::ty::wf::object_region_bounds
10: rustc::ty::wf::object_region_bounds
11: rustc::util::bug::bug_fmt
12: rustc::util::bug::bug_fmt
13: rustc_metadata::decoder::<impl rustc_metadata::cstore::CrateMetadata>::entry
14: rustc_metadata::decoder::<impl rustc_metadata::cstore::CrateMetadata>::get_type
15: rustc_metadata::cstore_impl::provide_extern
16: rustc::middle::weak_lang_items::<impl rustc::ty::context::TyCtxt>::is_weak_lang_item
17: rustc::dep_graph::graph::DepGraph::assert_ignored
18: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::try_print_query_stack
19: rustc::ty::instance::Instance::resolve
20: <rustc::traits::query::normalize::QueryNormalizer as rustc::ty::fold::TypeFolder>::fold_const
21: rustc::ty::context::TyCtxt::_intern_canonical_var_infos
22: rustc::ty::fast_reject::simplify_type
23: rustc::ty::structural_impls::<impl rustc::ty::context::Lift for rustc::ty::ParamEnv>::lift_to_tcx
24: <rustc::traits::query::normalize::QueryNormalizer as rustc::ty::fold::TypeFolder>::fold_ty
25: <rustc_lint::types::VariantSizeDifferences as rustc::lint::LintPass>::get_lints
26: <&mut rustc_traits::chalk_context::unify::ChalkTypeRelatingDelegate as rustc::infer::nll_relate::TypeRelatingDelegate>::push_domain_goal
27: <&mut rustc_traits::chalk_context::unify::ChalkTypeRelatingDelegate as rustc::infer::nll_relate::TypeRelatingDelegate>::push_domain_goal
28: rustc::ty::print::pretty::<impl core::fmt::Display for rustc::ty::subst::Kind>::fmt
29: rustc::middle::weak_lang_items::<impl rustc::ty::context::TyCtxt>::is_weak_lang_item
30: rustc::dep_graph::graph::DepGraph::assert_ignored
31: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::try_print_query_stack
32: rustc::traits::util::<impl rustc::ty::context::TyCtxt>::impl_item_is_final
33: <rustc::ty::layout::LayoutCx<rustc::ty::context::TyCtxt> as rustc_target::abi::LayoutOf>::layout_of
34: <rustc::hir::SyntheticTyParamKind as core::fmt::Debug>::fmt
35: rustc::hir::intravisit::NestedVisitorMap::inter
36: <rustc::util::common::ErrorReported as core::fmt::Debug>::fmt
37: rustc::hir::intravisit::NestedVisitorMap::inter
38: rustc::ty::layout::provide
39: <rustc::ty::layout::LayoutError as core::fmt::Display>::fmt
40: rustc::ty::print::pretty::<impl core::fmt::Display for rustc::ty::subst::Kind>::fmt
41: rustc::middle::weak_lang_items::<impl rustc::ty::context::TyCtxt>::is_weak_lang_item
42: rustc::dep_graph::graph::DepGraph::assert_ignored
43: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::try_print_query_stack
44: <rustc::ty::layout::LayoutCx<rustc::ty::context::TyCtxt> as rustc_target::abi::LayoutOf>::layout_of
45: <rustc_target::abi::TyLayout<&rustc::ty::TyS> as rustc_codegen_llvm::type_of::LayoutLlvmExt>::llvm_type
46: <rustc_target::abi::TyLayout<&rustc::ty::TyS> as rustc_codegen_llvm::type_of::LayoutLlvmExt>::llvm_type
47: <rustc_target::abi::TyLayout<&rustc::ty::TyS> as rustc_codegen_llvm::type_of::LayoutLlvmExt>::llvm_type
48: <rustc_target::abi::TyLayout<&rustc::ty::TyS> as rustc_codegen_llvm::type_of::LayoutLlvmExt>::scalar_pair_element_llvm_type
49: <rustc_target::abi::TyLayout<&rustc::ty::TyS> as rustc_codegen_llvm::type_of::LayoutLlvmExt>::llvm_type
50: <rustc_target::abi::call::FnType<&rustc::ty::TyS> as rustc_codegen_llvm::abi::FnTypeLlvmExt>::llvm_type
51: rustc_codegen_llvm::declare::<impl rustc_codegen_ssa::traits::declare::DeclareMethods for rustc_codegen_llvm::context::CodegenCx>::declare_fn
52: rustc_codegen_llvm::mono_item::<impl rustc_codegen_ssa::traits::declare::PreDefineMethods for rustc_codegen_llvm::context::CodegenCx>::predefine_fn
53: <rustc_codegen_llvm::back::lto::Linker as core::ops::drop::Drop>::drop
54: <rustc_codegen_llvm::base::ValueIter as core::iter::traits::iterator::Iterator>::next
55: <rustc_codegen_llvm::back::lto::Linker as core::ops::drop::Drop>::drop
56: <rustc_codegen_llvm::base::ValueIter as core::iter::traits::iterator::Iterator>::next
57: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
58: <humantime::date::Rfc3339Timestamp as core::fmt::Debug>::fmt
59: rustc_interface::passes::BoxedResolver::complete
60: <humantime::date::Rfc3339Timestamp as core::fmt::Debug>::fmt
61: rustc_interface::passes::BoxedResolver::to_expansion_result
62: flate2::gz::GzHeader::extra
63: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::ongoing_codegen
64: <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt
65: <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt
66: <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt
67: <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt
68: _rust_maybe_catch_panic
69: <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt
70: ZN244_$LT$std..error..$LT$impl$u20$core..convert..From$LT$alloc..string..String$GT$$u20$for$u20$alloc..boxed..Box$LT$dyn$u20$std..error..Error$u2b$core..marker..Sync$u2b$core..marker..Send$GT$$GT$..from..StringError$u20$as$u20$core..fmt..Display$GT$3fmt17
71: std::sys::windows::thread::Thread::new
72: BaseThreadInitThunk
73: RtlUserThreadStart
query stack during panic:
#0 [type_of] processing `REDACTED::{{constant}}#0`
thread 'rustc' panicked at 'Box<Any>', src\librustc_errors\lib.rs:649:9
stack backtrace:
0: 0x7ffdf3412d8c - std::sys_common::alloc::realloc_fallback::h704c80e2016671f8
1: 0x7ffdf34167ce - std::panicking::take_hook::h046f7f877897a7ad
2: 0x7ffdf3416452 - std::panicking::take_hook::h046f7f877897a7ad
3: 0x7ffdb92145ce - <rustc::ty::query::queries::analysis as rustc::ty::query::config::QueryDescription>::describe::hb6b6cd67f83ea56f
4: 0x7ffdf3417085 - std::panicking::rust_panic_with_hook::h6f132f2a8a2e71b7
5: 0x7ffdb9b74020 - <rustc_errors::diagnostic::SubDiagnostic as core::fmt::Debug>::fmt::hfb0064d79ea4e650
6: 0x7ffdb9b5a207 - rustc_errors::Handler::bug::h4a0079b884fb6b5d
7: 0x7ffdb931b211 - rustc::util::bug::bug_fmt::hca927fe7d91e0d89
8: 0x7ffdb931aae6 - rustc::ty::wf::object_region_bounds::hc99a98c5fcedf416
9: 0x7ffdb931aa5a - rustc::ty::wf::object_region_bounds::hc99a98c5fcedf416
10: 0x7ffdb931aa9a - rustc::ty::wf::object_region_bounds::hc99a98c5fcedf416
11: 0x7ffdb931b11f - rustc::util::bug::bug_fmt::hca927fe7d91e0d89
12: 0x7ffdb931b07d - rustc::util::bug::bug_fmt::hca927fe7d91e0d89
13: 0x7ffdb8de59b7 - rustc_metadata::decoder::<impl rustc_metadata::cstore::CrateMetadata>::entry::hd2633ad21c98b0b5
14: 0x7ffdb8de5b95 - rustc_metadata::decoder::<impl rustc_metadata::cstore::CrateMetadata>::def_kind::h7827bdb991e2e404
15: 0x7ffdb8df44b7 - rustc_metadata::cstore_impl::provide_extern::h131d83cf6cb3952d
16: 0x7ffdb963562c - rustc::middle::weak_lang_items::<impl rustc::ty::context::TyCtxt>::is_weak_lang_item::he4177d5a844a7076
17: 0x7ffdb96ec986 - rustc::dep_graph::graph::DepGraph::assert_ignored::h2a01b057f7608d6e
18: 0x7ffdb94406cb - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::try_print_query_stack::h1753461678c23fa5
19: 0x7ffdb9366319 - rustc::ty::print::pretty::RegionHighlightMode::highlighting_bound_region::hb3908208854c2a92
20: 0x7ffdb935f5e7 - rustc::ty::print::pretty::RegionHighlightMode::highlighting_bound_region::hb3908208854c2a92
21: 0x7ffdb935b8a1 - rustc::ty::print::pretty::RegionHighlightMode::highlighting_bound_region::hb3908208854c2a92
22: 0x7ffdb918b6a5 - rustc::ty::print::pretty::<impl core::fmt::Display for &rustc::ty::TyS>::fmt::hf01d9b599dd66d21
23: 0x7ffdf343fae9 - core::fmt::builders::DebugStruct::field::h8198c77bc9a8f6a2
24: 0x7ffdb9198e4d - <rustc::ty::ParamEnv as core::fmt::Debug>::fmt::hf8f8c75a6c7cfdf8
25: 0x7ffdf34409eb - core::fmt::write::h158250b286853c9c
26: 0x7ffdf34315c8 - alloc::fmt::format::h2894ef712218ed82
27: 0x7ffdb9753d60 - rustc::ty::query::Query::describe::hf7780e23596df25d
28: 0x7ffdb93fbadc - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::try_print_query_stack::h1753461678c23fa5
29: 0x7ffdb921463e - <rustc::ty::query::queries::analysis as rustc::ty::query::config::QueryDescription>::describe::hb6b6cd67f83ea56f
30: 0x7ffdf3417085 - std::panicking::rust_panic_with_hook::h6f132f2a8a2e71b7
31: 0x7ffdb9b74020 - <rustc_errors::diagnostic::SubDiagnostic as core::fmt::Debug>::fmt::hfb0064d79ea4e650
32: 0x7ffdb9b5a207 - rustc_errors::Handler::bug::h4a0079b884fb6b5d
33: 0x7ffdb931b211 - rustc::util::bug::bug_fmt::hca927fe7d91e0d89
34: 0x7ffdb931aae6 - rustc::ty::wf::object_region_bounds::hc99a98c5fcedf416
35: 0x7ffdb931aa5a - rustc::ty::wf::object_region_bounds::hc99a98c5fcedf416
36: 0x7ffdb931aa9a - rustc::ty::wf::object_region_bounds::hc99a98c5fcedf416
37: 0x7ffdb931b11f - rustc::util::bug::bug_fmt::hca927fe7d91e0d89
38: 0x7ffdb931b07d - rustc::util::bug::bug_fmt::hca927fe7d91e0d89
39: 0x7ffdb8de59b7 - rustc_metadata::decoder::<impl rustc_metadata::cstore::CrateMetadata>::entry::hd2633ad21c98b0b5
40: 0x7ffdb8de6a9c - rustc_metadata::decoder::<impl rustc_metadata::cstore::CrateMetadata>::get_type::h089802f601cc827d
41: 0x7ffdb8df066d - rustc_metadata::cstore_impl::provide_extern::h131d83cf6cb3952d
42: 0x7ffdb9634a7c - rustc::middle::weak_lang_items::<impl rustc::ty::context::TyCtxt>::is_weak_lang_item::he4177d5a844a7076
43: 0x7ffdb96df3d3 - rustc::dep_graph::graph::DepGraph::assert_ignored::h2a01b057f7608d6e
44: 0x7ffdb94a17e4 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::try_print_query_stack::h1753461678c23fa5
45: 0x7ffdb9283e29 - rustc::ty::instance::Instance::resolve::hae5b876dde91880f
46: 0x7ffdb927bcae - <rustc::traits::query::normalize::QueryNormalizer as rustc::ty::fold::TypeFolder>::fold_const::h7412764b8d098722
47: 0x7ffdb9651932 - rustc::ty::context::TyCtxt::_intern_canonical_var_infos::h4843a21b2323a1f1
48: 0x7ffdb9152349 - rustc::ty::fast_reject::simplify_type::hbc8cf28d21042664
49: 0x7ffdb91795bd - rustc::ty::structural_impls::<impl rustc::ty::context::Lift for rustc::ty::ParamEnv>::lift_to_tcx::h8ef5562ad5d03122
50: 0x7ffdb927b309 - <rustc::traits::query::normalize::QueryNormalizer as rustc::ty::fold::TypeFolder>::fold_ty::hdf6e6fab13c32758
51: 0x7ffdb80d667b - <rustc_lint::types::VariantSizeDifferences as rustc::lint::LintPass>::get_lints::hbc3ba6509ff17f06
52: 0x7ffdb817fe41 - <&mut rustc_traits::chalk_context::unify::ChalkTypeRelatingDelegate as rustc::infer::nll_relate::TypeRelatingDelegate>::push_domain_goal::hd6c786c78f82743a
53: 0x7ffdb811dc9f - <&mut rustc_traits::chalk_context::unify::ChalkTypeRelatingDelegate as rustc::infer::nll_relate::TypeRelatingDelegate>::push_domain_goal::hd6c786c78f82743a
54: 0x7ffdb96a3208 - rustc::ty::print::pretty::<impl core::fmt::Display for rustc::ty::subst::Kind>::fmt::hc399db3d39f649e9
55: 0x7ffdb96361d4 - rustc::middle::weak_lang_items::<impl rustc::ty::context::TyCtxt>::is_weak_lang_item::he4177d5a844a7076
56: 0x7ffdb96f5200 - rustc::dep_graph::graph::DepGraph::assert_ignored::h2a01b057f7608d6e
57: 0x7ffdb942c44e - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::try_print_query_stack::h1753461678c23fa5
58: 0x7ffdb93f2002 - rustc::traits::util::<impl rustc::ty::context::TyCtxt>::impl_item_is_final::h3e3622f37c9b9353
59: 0x7ffdb920be7d - <rustc::ty::layout::LayoutCx<rustc::ty::context::TyCtxt> as rustc_target::abi::LayoutOf>::layout_of::h35874203b040ff53
60: 0x7ffdb932c846 - <rustc::hir::SyntheticTyParamKind as core::fmt::Debug>::fmt::had7f4e72750b5831
61: 0x7ffdb97d6499 - rustc::hir::intravisit::NestedVisitorMap::inter::ha843c108031b6e1a
62: 0x7ffdb91b0661 - <rustc::util::common::ErrorReported as core::fmt::Debug>::fmt::h66c5bf790fa31243
63: 0x7ffdb97c8699 - rustc::hir::intravisit::NestedVisitorMap::inter::ha843c108031b6e1a
64: 0x7ffdb92037e8 - rustc::ty::layout::provide::hc605ca1e26b97864
65: 0x7ffdb9200534 - <rustc::ty::layout::LayoutError as core::fmt::Display>::fmt::h29dff8e36fb0008b
66: 0x7ffdb96a00cf - rustc::ty::print::pretty::<impl core::fmt::Display for rustc::ty::subst::Kind>::fmt::hc399db3d39f649e9
67: 0x7ffdb9635a6a - rustc::middle::weak_lang_items::<impl rustc::ty::context::TyCtxt>::is_weak_lang_item::he4177d5a844a7076
68: 0x7ffdb96f9037 - rustc::dep_graph::graph::DepGraph::assert_ignored::h2a01b057f7608d6e
69: 0x7ffdb948b533 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::try_print_query_stack::h1753461678c23fa5
70: 0x7ffdb920bed3 - <rustc::ty::layout::LayoutCx<rustc::ty::context::TyCtxt> as rustc_target::abi::LayoutOf>::layout_of::h35874203b040ff53
71: 0x7ffdb565bf51 - <rustc_target::abi::TyLayout<&rustc::ty::TyS> as rustc_codegen_llvm::type_of::LayoutLlvmExt>::llvm_type::h8f80fa95e654501c
72: 0x7ffdb565c4ff - <rustc_target::abi::TyLayout<&rustc::ty::TyS> as rustc_codegen_llvm::type_of::LayoutLlvmExt>::llvm_type::h8f80fa95e654501c
73: 0x7ffdb565bdf7 - <rustc_target::abi::TyLayout<&rustc::ty::TyS> as rustc_codegen_llvm::type_of::LayoutLlvmExt>::llvm_type::h8f80fa95e654501c
74: 0x7ffdb565ceb3 - <rustc_target::abi::TyLayout<&rustc::ty::TyS> as rustc_codegen_llvm::type_of::LayoutLlvmExt>::scalar_pair_element_llvm_type::h013edd9347332251
75: 0x7ffdb565c171 - <rustc_target::abi::TyLayout<&rustc::ty::TyS> as rustc_codegen_llvm::type_of::LayoutLlvmExt>::llvm_type::h8f80fa95e654501c
76: 0x7ffdb54ee0e1 - <rustc_target::abi::call::FnType<&rustc::ty::TyS> as rustc_codegen_llvm::abi::FnTypeLlvmExt>::llvm_type::h186eeb827ff60e0d
77: 0x7ffdb55fd1ed - rustc_codegen_llvm::declare::<impl rustc_codegen_ssa::traits::declare::DeclareMethods for rustc_codegen_llvm::context::CodegenCx>::declare_fn::heca258954977ec9d
78: 0x7ffdb55fda5c - rustc_codegen_llvm::mono_item::<impl rustc_codegen_ssa::traits::declare::PreDefineMethods for rustc_codegen_llvm::context::CodegenCx>::predefine_fn::h776e0f4c5ac93463
79: 0x7ffdb555041c - <rustc_codegen_llvm::back::lto::Linker as core::ops::drop::Drop>::drop::hc825d6ee9a545cf8
80: 0x7ffdb54ef825 - <rustc_codegen_llvm::base::ValueIter as core::iter::traits::iterator::Iterator>::next::ha672766d69e7a305
81: 0x7ffdb554a4b2 - <rustc_codegen_llvm::back::lto::Linker as core::ops::drop::Drop>::drop::hc825d6ee9a545cf8
82: 0x7ffdb54ef637 - <rustc_codegen_llvm::base::ValueIter as core::iter::traits::iterator::Iterator>::next::ha672766d69e7a305
83: 0x7ffdb564552f - <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate::h993ba9d352f4d4fa
84: 0x7ffdb7f22901 - <humantime::date::Rfc3339Timestamp as core::fmt::Debug>::fmt::hec63be805cad1b01
85: 0x7ffdb8021c61 - rustc_interface::passes::BoxedResolver::complete::h3ec528251042c0a7
86: 0x7ffdb7f2916e - <humantime::date::Rfc3339Timestamp as core::fmt::Debug>::fmt::hec63be805cad1b01
87: 0x7ffdb8020677 - rustc_interface::passes::BoxedResolver::to_expansion_result::h7bfab83d43887bf3
88: 0x7ffdb7fbbbce - flate2::gz::GzHeader::extra::hfc44b7a28fcb441b
89: 0x7ffdb7f43a1a - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::ongoing_codegen::h929a9c95080f59f6
90: 0x7ffdb7ea4dd6 - <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt::h278baf744d79c069
91: 0x7ffdb7eb1776 - <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt::h278baf744d79c069
92: 0x7ffdb7ed3d6f - <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt::h278baf744d79c069
93: 0x7ffdb7e756f4 - <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt::h278baf744d79c069
94: 0x7ffdf3429222 - _rust_maybe_catch_panic
95: 0x7ffdb7e809b2 - <rustc_driver::pretty::UserIdentifiedItem as core::fmt::Debug>::fmt::h278baf744d79c069
96: 0x7ffdf33f60f7 - ZN244_$LT$std..error..$LT$impl$u20$core..convert..From$LT$alloc..string..String$GT$$u20$for$u20$alloc..boxed..Box$LT$dyn$u20$std..error..Error$u2b$core..marker..Sync$u2b$core..marker..Send$GT$$GT$..from..StringError$u20$as$u20$core..fmt..Display$GT$3fmt17
97: 0x7ffdf3426ae6 - std::sys::windows::thread::Thread::new::h6a5fd2d66eb61031
98: 0x7ffe1f1b6e24 - BaseThreadInitThunk
99: 0x7ffe1fadb081 - RtlUserThreadStart
query stack during panic:
``` </p></details> |
Also when the type is wrapped privately (i.e., |
In a folder
a
, I have a blank library crate with the followingsrc/lib.rs
:In a folder
b
, I have a blank binary crate with the followsrc/main.rs
:b
's Cargo.toml uses cratea
with the following line:Running
cargo check
orcargo build
inb
will produce the following ICE:The text was updated successfully, but these errors were encountered: