Repository navigation
Stable ICE: assertion failed: (left == right) #77329
Copy link
Copy link
Closed
Labels
A-HIRArea: The high-level intermediate representation (HIR)Area: The high-level intermediate representation (HIR)A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.
Description
Code
fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| { x } }]> {
std::iter::empty()
}Meta
rustc --version --verbose:
rustc 1.46.0 (04488afe3 2020-08-24)
rustc 1.47.0-beta.5 (9f0e6fa94 2020-09-29)
rustc 1.48.0-nightly (fc2daaae6 2020-09-28)
Error output
thread 'rustc' panicked at 'assertion failed: `(left == right)`
left: `DefId(0:5 ~ playground[6bea]::bug[0]::{{opaque}}[0])`,
right: `DefId(0:3 ~ playground[6bea]::bug[0])`', src/librustc_middle/hir/map/collector.rs:226:13
Backtrace
Compiling playground v0.0.1 (/playground)
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
1: backtrace::backtrace::trace_unsynchronized
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print_fmt
at src/libstd/sys_common/backtrace.rs:78
3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
at src/libstd/sys_common/backtrace.rs:59
4: core::fmt::write
at src/libcore/fmt/mod.rs:1076
5: std::io::Write::write_fmt
at src/libstd/io/mod.rs:1537
6: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:62
7: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:49
8: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:198
9: std::panicking::default_hook
at src/libstd/panicking.rs:217
10: rustc_driver::report_ice
11: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:530
12: rust_begin_unwind
at src/libstd/panicking.rs:437
13: std::panicking::begin_panic_fmt
at src/libstd/panicking.rs:391
14: rustc_middle::hir::map::collector::NodeCollector::insert_entry
15: <rustc_middle::hir::map::collector::NodeCollector as rustc_hir::intravisit::Visitor>::visit_param
16: rustc_hir::intravisit::walk_body
17: rustc_hir::intravisit::walk_expr
18: rustc_hir::intravisit::walk_block
19: rustc_hir::intravisit::walk_expr
20: rustc_hir::intravisit::walk_body
21: rustc_hir::intravisit::walk_ty
22: rustc_hir::intravisit::walk_assoc_type_binding
23: rustc_hir::intravisit::walk_path
24: rustc_hir::intravisit::Visitor::visit_param_bound
25: rustc_hir::intravisit::walk_item
26: <rustc_middle::hir::map::collector::NodeCollector as rustc_hir::intravisit::Visitor>::visit_item
27: rustc_hir::intravisit::walk_ty
28: rustc_hir::intravisit::walk_fn
29: <rustc_middle::hir::map::collector::NodeCollector as rustc_hir::intravisit::Visitor>::visit_fn
30: rustc_hir::intravisit::walk_item
31: <rustc_middle::hir::map::collector::NodeCollector as rustc_hir::intravisit::Visitor>::visit_item
32: rustc_middle::hir::map::index_hir
33: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
34: rustc_data_structures::stack::ensure_sufficient_stack
35: rustc_query_system::query::plumbing::get_query_impl
36: core::ops::function::FnOnce::call_once
37: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
38: rustc_data_structures::stack::ensure_sufficient_stack
39: rustc_query_system::query::plumbing::get_query_impl
40: rustc_middle::hir::map::Map::expect_item
41: rustc_middle::hir::map::Map::visit_item_likes_in_module
42: rustc_passes::hir_id_validator::check_crate
43: rustc_interface::passes::analysis
44: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
45: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
46: rustc_query_system::query::plumbing::get_query_impl
47: rustc_middle::ty::context::tls::enter_global
48: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
49: rustc_span::with_source_map
50: rustc_interface::interface::create_compiler_and_run
51: scoped_tls::ScopedKey<T>::set
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/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.46.0 (04488afe3 2020-08-24) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2 --crate-type lib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [index_hir] index HIR
#1 [hir_owner] HIR owner of `{{misc}}#0`
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `playground`.
Metadata
Metadata
Assignees
Labels
A-HIRArea: The high-level intermediate representation (HIR)Area: The high-level intermediate representation (HIR)A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.
Activity
DutchGhost commentedon Sep 29, 2020
This started happening on stable 1.36
DutchGhost commentedon Sep 29, 2020
I'm realy unsure on how much this bisect can be trusted, I'm happy to run other ones with a little bit of help, this is the best I got.
searched nightlies: from nightly-2020-04-30 to nightly-2020-08-28
regressed nightly: nightly-2020-05-03
searched commits: from 7f65393 to f05a524
regressed commit: dae90c1
bisected with cargo-bisect-rustc v0.5.2
Host triple: x86_64-unknown-linux-gnu
Reproduce with:
tesuji commentedon Sep 29, 2020
My bisect:
ERROR: no commits between e4c66af...aa99abe within last 167 days
git lg --author=bors e4c66afba5d69356879570aeff22db5a38566a86...aa99abeb262307d5e9aa11a792312fd620b7f89aSpanfrom 4 bytes to 8 bytes. #59693 - nnethercote:64-bit-Spans, r=petrochenkov (1 year, 6 months ago)Command:
cargo-bisect-rustc --start 2019-02-28 --end 2019-07-01 --preserve --regress=icetamuhey commentedon Sep 29, 2020
Smaller example:
playground
Something wrong with the inference when
iml traitand array expression are used togetherfrxstrem commentedon Sep 29, 2020
Using regular const generics on nightly produces the same error, so it's probably related:
playground
tesuji commentedon Sep 29, 2020
All example include closure. So I don't think it is particular bug for const generics.
lcnr commentedon Sep 29, 2020
Looks like something blocking const generics, even if it's not directly caused by it.
Also something I want to look into myself, so @rustbot claim
lcnr commentedon Sep 29, 2020
This also breaks code which, if nonsensical, should be working. Don't think we have to increase the priority because of this though.
tamuhey commentedon Sep 30, 2020
It is a regression - stable 1.26.0 correctly outputs a compile error
lcnr commentedon Oct 4, 2020
Not something I can fix myself, releasing assignment.
lcnr commentedon Oct 4, 2020
Something I can fix myself, #77546 (with a lot of guidance by eddyb)