Open dastbe opened 2 years ago
We're incorrectly invoking resolve_instance
with an inference car - this should never happen, but we seem to still have inference cars present during monomorphization.
I suspect that this is related to the overflow, and could be solved by skipping Instance::resolve
and calling delay_span_bug
when we encounter an unresolved inference variable.
Triage: Fixed by https://github.com/rust-lang/rust/pull/100757, I think it has a regression test that should cover this case, closing.
Reopened by https://github.com/rust-lang/rust/pull/104610
This now overflows with an error.
This crashes again :rofl:
another regression of #122568
Ah this is where I got the code of https://github.com/rust-lang/rust/issues/122823 from lol
Code
I've hacked it down from an advent of code solution. When
is replaced with u32 literals the compiler emits a (correct) compilation error due to infinitely nesting types.
Meta
rustc --version --verbose
:Error output
Backtrace
``` stack backtrace: 0: _rust_begin_unwind 1: core::panicking::panic_fmt 2: core::panicking::panic_bounds_check 3:::probe
4: ::probe_ty_var
5: ::fold_ty
6: <&rustc_middle::ty::list::List as rustc_middle::ty::fold::TypeFoldable>::fold_with::
7: <&rustc_middle::ty::TyS as rustc_middle::ty::fold::TypeFoldable>::super_fold_with::
8: <&rustc_middle::ty::list::List as rustc_middle::ty::fold::TypeFoldable>::fold_with::
9: <&rustc_middle::ty::TyS as rustc_middle::ty::fold::TypeFoldable>::super_fold_with::
10: <&rustc_middle::ty::list::List as rustc_middle::ty::fold::TypeFoldable>::fold_with::
11: ::fold_with::
12: ::canonicalize::>
13: ::evaluate_obligation
14: ::evaluate_obligation_no_overflow
15: rustc_trait_selection::traits::type_known_to_meet_bound_modulo_regions
16: ::enter::
17: rustc_ty_utils::common_traits::is_copy_raw
18: >::with_task::, bool>
19: rustc_data_structures::stack::ensure_sufficient_stack::<(bool, rustc_query_system::dep_graph::graph::DepNodeIndex), rustc_query_system::query::plumbing::execute_job, bool>::{closure#3}>
20: rustc_query_system::query::plumbing::try_execute_query::, bool>>
21: rustc_query_system::query::plumbing::get_query::
22: ::is_copy_modulo_regions
23: rustc_ty_utils::needs_drop::needs_drop_raw
24: >::with_task::, bool>
25: rustc_data_structures::stack::ensure_sufficient_stack::<(bool, rustc_query_system::dep_graph::graph::DepNodeIndex), rustc_query_system::query::plumbing::execute_job, bool>::{closure#3}>
26: rustc_query_system::query::plumbing::try_execute_query::, bool>>
27: rustc_query_system::query::plumbing::get_query::
28: rustc_ty_utils::instance::inner_resolve_instance
29: rustc_ty_utils::instance::resolve_instance
30: ::with_deps::<>::with_task_impl)>, core::result::Result, rustc_errors::ErrorReported>>::{closure#0}, core::result::Result, rustc_errors::ErrorReported>>
31: >::with_task::)>, core::result::Result, rustc_errors::ErrorReported>>
32: rustc_data_structures::stack::ensure_sufficient_stack::<(core::result::Result, rustc_errors::ErrorReported>, rustc_query_system::dep_graph::graph::DepNodeIndex), rustc_query_system::query::plumbing::execute_job)>, core::result::Result, rustc_errors::ErrorReported>>::{closure#3}>
33: rustc_query_system::query::plumbing::get_query::
34: ::resolve_instance
35: ::resolve_opt_const_arg
36: ::resolve_drop_in_place
37: ::visit_terminator
38: rustc_monomorphize::collector::collect_neighbours
39: rustc_monomorphize::collector::collect_items_rec
40: rustc_monomorphize::collector::collect_items_rec
41: rustc_monomorphize::collector::collect_items_rec
42: rustc_monomorphize::collector::collect_items_rec
43: rustc_monomorphize::collector::collect_items_rec
44: rustc_monomorphize::collector::collect_items_rec
45: rustc_monomorphize::collector::collect_items_rec
46: rustc_monomorphize::collector::collect_items_rec
47: rustc_monomorphize::collector::collect_items_rec
48: rustc_monomorphize::collector::collect_items_rec
49: rustc_monomorphize::collector::collect_items_rec
50: rustc_monomorphize::collector::collect_items_rec
51: rustc_monomorphize::collector::collect_items_rec
52: rustc_monomorphize::collector::collect_items_rec
53: rustc_monomorphize::collector::collect_items_rec
54: rustc_monomorphize::collector::collect_items_rec
55: rustc_monomorphize::collector::collect_items_rec
56: rustc_monomorphize::collector::collect_items_rec
57: rustc_monomorphize::collector::collect_items_rec
58: rustc_monomorphize::collector::collect_items_rec
59: rustc_monomorphize::collector::collect_items_rec
60: rustc_monomorphize::collector::collect_items_rec
61: rustc_monomorphize::collector::collect_items_rec
62: rustc_monomorphize::collector::collect_items_rec
63: rustc_monomorphize::collector::collect_items_rec
64: rustc_monomorphize::collector::collect_items_rec
65: rustc_monomorphize::collector::collect_items_rec
66: rustc_monomorphize::collector::collect_items_rec
67: rustc_monomorphize::collector::collect_items_rec
68: rustc_monomorphize::collector::collect_items_rec
69: rustc_monomorphize::collector::collect_items_rec
70: rustc_monomorphize::collector::collect_items_rec
71: rustc_monomorphize::collector::collect_items_rec
72: rustc_monomorphize::collector::collect_items_rec
73: rustc_monomorphize::collector::collect_items_rec
74: rustc_monomorphize::collector::collect_items_rec
75: rustc_monomorphize::collector::collect_items_rec
76: rustc_monomorphize::collector::collect_items_rec
77: rustc_monomorphize::collector::collect_items_rec
78: rustc_monomorphize::collector::collect_items_rec
79: rustc_monomorphize::collector::collect_items_rec
80: rustc_monomorphize::collector::collect_items_rec
81: rustc_monomorphize::collector::collect_items_rec
82: rustc_monomorphize::collector::collect_items_rec
83: rustc_monomorphize::collector::collect_items_rec
84: rustc_monomorphize::collector::collect_items_rec
85: rustc_monomorphize::collector::collect_items_rec
86: rustc_monomorphize::collector::collect_items_rec
87: rustc_monomorphize::collector::collect_items_rec
88: rustc_monomorphize::collector::collect_items_rec
89: rustc_monomorphize::collector::collect_items_rec
90: rustc_monomorphize::collector::collect_items_rec
91: rustc_monomorphize::collector::collect_items_rec
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
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.59.0-nightly (db9d361a4 2021-11-28) running on aarch64-apple-darwin
note: compiler flags: -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [is_copy_raw] computing whether `core::option::Option>` is `Copy`
#1 [needs_drop_raw] computing whether `core::option::Option>` needs drop
#2 [resolve_instance] resolving instance `core::ptr::drop_in_place::>>`
#3 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
```