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

drop(self); in fn ... (self) causes a compiler crash (nightly) #95022

Closed
griffi-gh opened this issue Mar 16, 2022 · 4 comments
Closed

drop(self); in fn ... (self) causes a compiler crash (nightly) #95022

griffi-gh opened this issue Mar 16, 2022 · 4 comments
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

@griffi-gh
Copy link

Code

    ...
    pub fn build(self) -> Result<Gameboy, Box<dyn std::error::Error + 'static>> {
        let gb = self.gb;
        let err = self.err;
        drop(self); // <- This line causes the compiler to crash
        match err {
            Some(err) => Err(err),
            None => Ok(gb)
        }
    }
    ...

Meta

rustc --version --verbose:

rustc 1.61.0-nightly (9fcbc3205 2022-03-04)
binary: rustc
commit-hash: 9fcbc32053d5084d1de79bd484de82474cdae427
commit-date: 2022-03-04
host: x86_64-unknown-linux-gnu
release: 1.61.0-nightly
LLVM version: 14.0.0

Error output

user@pop-os:~/Projects/rustish$ cargo build
Compiling rustish-gb v0.1.0 (/home/user/Projects/rustish)
thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 3', compiler/rustc_infer/src/infer/region_constraints/mod.rs:446:9
stack backtrace:
0:     0x7f196dee8c8c - std::backtrace_rs::backtrace::libunwind::trace::h85a99825553c3ef4
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1:     0x7f196dee8c8c - std::backtrace_rs::backtrace::trace_unsynchronized::h2fe1724be12667bf
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2:     0x7f196dee8c8c - std::sys_common::backtrace::_print_fmt::h85a73c46be7af254
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/std/src/sys_common/backtrace.rs:66:5
3:     0x7f196dee8c8c - <std::sys_common::backtrace::_print::DisplayBacktraceas core::fmt::Display>::fmt::h30c32953deafcc5b
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/std/src/sys_common/backtrace.rs:45:22
4:     0x7f196df42b6c - core::fmt::write::h3b71aa0cf071dab4
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/core/src/fmt/mod.rs:1190:17
5:     0x7f196ded96c1 - std::io::Write::write_fmt::h98b6680dca3ce26b
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/std/src/io/mod.rs:1655:15
6:     0x7f196deebbb5 - std::sys_common::backtrace::_print::h37d2ec65c4aca279
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/std/src/sys_common/backtrace.rs:48:5
7:     0x7f196deebbb5 - std::sys_common::backtrace::print::h5e60ceeb42a6eb64
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/std/src/sys_common/backtrace.rs:35:9
8:     0x7f196deebbb5 - std::panicking::default_hook::{{closure}}::h8fc16f5ef2371077
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/std/src/panicking.rs:295:22
9:     0x7f196deeb864 - std::panicking::default_hook::h9bdf436c14e69687
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/std/src/panicking.rs:314:9
10:     0x7f196e680601 - rustc_driver[253633c1b73202d4]::DEFAULT_HOOK::{closure#0}::{closure#0}
11:     0x7f195f5e7763 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hce7a094751399747
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/alloc/src/boxed.rs:1868:9
12:     0x7f195f5dfa1c - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::hc935da45780f8b59
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/proc_macro/src/bridge/client.rs:319:21
13:     0x7f195f5f4230 - std::panicking::update_hook::{{closure}}::h72d2c509781ff4cf
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/std/src/panicking.rs:258:41
14:     0x7f196deec43f - std::panicking::rust_panic_with_hook::ha3982850844dea9d
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/std/src/panicking.rs:702:17
15:     0x7f196deec127 - std::panicking::begin_panic_handler::{{closure}}::hc30769891553329e
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/std/src/panicking.rs:588:13
16:     0x7f196dee9144 - std::sys_common::backtrace::__rust_end_short_backtrace::hc45a6a8e93dc3d76
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/std/src/sys_common/backtrace.rs:138:18
17:     0x7f196deebe59 - rust_begin_unwind
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/std/src/panicking.rs:584:5
18:     0x7f196deafa13 - core::panicking::panic_fmt::h091108b0e7b1d766
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/core/src/panicking.rs:143:14
19:     0x7f196deaf952 - core::panicking::panic_bounds_check::h9d998c19ad28f413
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/core/src/panicking.rs:84:5
20:     0x7f197033e2d0 - <rustc_middle[b5c8afc8c545842e]::ty::sty::Region as rustc_middle[b5c8afc8c545842e]::ty::relate::Relate>::relate::<rustc_infer[ed5ed88bea1f1a11]::infer::combine::Generalizer>
21:     0x7f19702ede04 - rustc_middle[b5c8afc8c545842e]::ty::relate::super_relate_tys::<rustc_infer[ed5ed88bea1f1a11]::infer::combine::Generalizer>
22:     0x7f19702e752b - <rustc_infer[ed5ed88bea1f1a11]::infer::combine::Generalizer as rustc_middle[b5c8afc8c545842e]::ty::relate::TypeRelation>::tys
23:     0x7f19702ec4dd - rustc_middle[b5c8afc8c545842e]::ty::relate::super_relate_tys::<rustc_infer[ed5ed88bea1f1a11]::infer::combine::Generalizer>
24:     0x7f19702e752b - <rustc_infer[ed5ed88bea1f1a11]::infer::combine::Generalizer as rustc_middle[b5c8afc8c545842e]::ty::relate::TypeRelation>::tys
25:     0x7f19702e01b4 - <rustc_infer[ed5ed88bea1f1a11]::infer::combine::CombineFields>::instantiate
26:     0x7f196f5681ea - <rustc_infer[ed5ed88bea1f1a11]::infer::equate::Equateas rustc_middle[b5c8afc8c545842e]::ty::relate::TypeRelation>::relate_with_variance::<rustc_middle[b5c8afc8c545842e]::ty::subst::GenericArg>
27:     0x7f196f528f3a - <&mut rustc_middle[b5c8afc8c545842e]::ty::relate::relate_substs<rustc_infer[ed5ed88bea1f1a11]::infer::equate::Equate>::{closure#0} ascore[b57089ad9157542c]::ops::function::FnOnce<((usize, (rustc_middle[b5c8afc8c545842e]::ty::subst::GenericArg, rustc_middle[b5c8afc8c545842e]::ty::subst::GenericArg)),)>>::call_once
28:     0x7f197032ff21 - <rustc_infer[ed5ed88bea1f1a11]::infer::equate::Equateas rustc_middle[b5c8afc8c545842e]::ty::relate::TypeRelation>::relate_item_substs
29:     0x7f196f52411e - rustc_middle[b5c8afc8c545842e]::ty::relate::super_relate_tys::<rustc_infer[ed5ed88bea1f1a11]::infer::equate::Equate>
30:     0x7f1970331239 - <rustc_infer[ed5ed88bea1f1a11]::infer::equate::Equateas rustc_middle[b5c8afc8c545842e]::ty::relate::TypeRelation>::tys
31:     0x7f1970233193 - <rustc_trait_selection[8f5b3efcfe8fa220]::traits::select::SelectionContext>::rematch_impl
32:     0x7f197023a04d - <rustc_trait_selection[8f5b3efcfe8fa220]::traits::select::SelectionContext>::confirm_candidate
33:     0x7f19702429d6 - <rustc_trait_selection[8f5b3efcfe8fa220]::traits::select::SelectionContext>::select
34:     0x7f1970280fcf - <rustc_trait_selection[8f5b3efcfe8fa220]::traits::fulfill::FulfillProcessor>::process_changed_obligations
35:     0x7f197029181e - <rustc_data_structures[987fc78f4ea6f575]::obligation_forest::ObligationForest<rustc_trait_selection[8f5b3efcfe8fa220]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[8f5b3efcfe8fa220]::traits::fulfill::FulfillProcessor, rustc_data_structures[987fc78f4ea6f575]::obligation_forest::Outcome<rustc_trait_selection[8f5b3efcfe8fa220]::traits::fulfill::PendingPredicateObligation, rustc_infer[ed5ed88bea1f1a11]::traits::FulfillmentErrorCode>>
36:     0x7f19702808bf - <rustc_trait_selection[8f5b3efcfe8fa220]::traits::fulfill::FulfillmentContext as rustc_infer[ed5ed88bea1f1a11]::traits::engine::TraitEngine>::select_where_possible
37:     0x7f196ec3643e - <rustc_infer[ed5ed88bea1f1a11]::infer::InferCtxtBuilder>::enter::<core[b57089ad9157542c]::result::Result<alloc[16c9bdc92ac74255]::vec::Vec<(&rustc_middle[b5c8afc8c545842e]::ty::generics::GenericParamDef, alloc[16c9bdc92ac74255]::string::String)>, ()>, <rustc_borrowck[89cfb880cbe825ee]::MirBorrowckCtxt>::report_use_of_moved_or_uninitialized::{closure#10}>
38:     0x7f196ec6d830 - <rustc_borrowck[89cfb880cbe825ee]::MirBorrowckCtxt>::report_use_of_moved_or_uninitialized
39:     0x7f196ec8530d - <rustc_borrowck[89cfb880cbe825ee]::MirBorrowckCtxt asrustc_mir_dataflow[1118a44e2e3e2a6c]::framework::visitor::ResultsVisitor>::visit_statement_before_primary_effect
40:     0x7f196fd0ab23 - rustc_mir_dataflow[1118a44e2e3e2a6c]::framework::visitor::visit_results::<rustc_borrowck[89cfb880cbe825ee]::dataflow::BorrowckAnalyses<rustc_index[883f35d451eaea8e]::bit_set::BitSet<rustc_borrowck[89cfb880cbe825ee]::dataflow::BorrowIndex>, rustc_index[883f35d451eaea8e]::bit_set::ChunkedBitSet<rustc_mir_dataflow[1118a44e2e3e2a6c]::move_paths::MovePathIndex>, rustc_index[883f35d451eaea8e]::bit_set::ChunkedBitSet<rustc_mir_dataflow[1118a44e2e3e2a6c]::move_paths::InitIndex>>, rustc_borrowck[89cfb880cbe825ee]::dataflow::BorrowckAnalyses<rustc_mir_dataflow[1118a44e2e3e2a6c]::framework::engine::Results<rustc_borrowck[89cfb880cbe825ee]::dataflow::Borrows>, rustc_mir_dataflow[1118a44e2e3e2a6c]::framework::engine::Results<rustc_mir_dataflow[1118a44e2e3e2a6c]::impls::MaybeUninitializedPlaces>, rustc_mir_dataflow[1118a44e2e3e2a6c]::framework::engine::Results<rustc_mir_dataflow[1118a44e2e3e2a6c]::impls::EverInitializedPlaces>>, core[b57089ad9157542c]::iter::adapters::map::Map<rustc_middle[b5c8afc8c545842e]::mir::traversal::ReversePostorder, rustc_borrowck[89cfb880cbe825ee]::do_mir_borrowck::{closure#2}>, rustc_borrowck[89cfb880cbe825ee]::MirBorrowckCtxt>
41:     0x7f196fda2ac7 - rustc_borrowck[89cfb880cbe825ee]::do_mir_borrowck
42:     0x7f196fd96b2e - rustc_borrowck[89cfb880cbe825ee]::mir_borrowck
43:     0x7f196fd936d0 - <rustc_borrowck[89cfb880cbe825ee]::provide::{closure#0} as core[b57089ad9157542c]::ops::function::FnOnce<(rustc_middle[b5c8afc8c545842e]::ty::context::TyCtxt, rustc_span[27f869f84b8424c3]::def_id::LocalDefId)>>::call_once
44:     0x7f1970a48372 - <rustc_query_system[f1c75ba6d27283a1]::dep_graph::graph::DepGraph<rustc_middle[b5c8afc8c545842e]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[b5c8afc8c545842e]::ty::context::TyCtxt, rustc_span[27f869f84b8424c3]::def_id::LocalDefId, &rustc_middle[b5c8afc8c545842e]::mir::query::BorrowCheckResult>
45:     0x7f196ff394f1 - rustc_query_system[f1c75ba6d27283a1]::query::plumbing::try_execute_query::<rustc_query_impl[545fe5bd5d961cd1]::plumbing::QueryCtxt, rustc_query_system[f1c75ba6d27283a1]::query::caches::DefaultCache<rustc_span[27f869f84b8424c3]::def_id::LocalDefId, &rustc_middle[b5c8afc8c545842e]::mir::query::BorrowCheckResult>>
46:     0x7f197001b35a - <rustc_query_impl[545fe5bd5d961cd1]::Queries as rustc_middle[b5c8afc8c545842e]::ty::query::QueryEngine>::mir_borrowck
47:     0x7f196f88cb88 - <rustc_middle[b5c8afc8c545842e]::hir::map::Map>::par_body_owners::<rustc_interface[8e34a951fb175e92]::passes::analysis::{closure#2}::{closure#0}>
48:     0x7f1970514098 - <rustc_session[9898eee89ca36b86]::session::Session>::time::<(), rustc_interface[8e34a951fb175e92]::passes::analysis::{closure#2}>
49:     0x7f19704ffbf5 - rustc_interface[8e34a951fb175e92]::passes::analysis
50:     0x7f1970a61ec4 - <rustc_query_system[f1c75ba6d27283a1]::dep_graph::graph::DepGraph<rustc_middle[b5c8afc8c545842e]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[b5c8afc8c545842e]::ty::context::TyCtxt, (), core[b57089ad9157542c]::result::Result<(), rustc_errors[8f52deac729bd09c]::ErrorGuaranteed>>
51:     0x7f19709abacf - rustc_query_system[f1c75ba6d27283a1]::query::plumbing::try_execute_query::<rustc_query_impl[545fe5bd5d961cd1]::plumbing::QueryCtxt, rustc_query_system[f1c75ba6d27283a1]::query::caches::DefaultCache<(), core[b57089ad9157542c]::result::Result<(), rustc_errors[8f52deac729bd09c]::ErrorGuaranteed>>>
52:     0x7f19709eadae - rustc_query_system[f1c75ba6d27283a1]::query::plumbing::get_query::<rustc_query_impl[545fe5bd5d961cd1]::queries::analysis, rustc_query_impl[545fe5bd5d961cd1]::plumbing::QueryCtxt>
53:     0x7f19704ddaa4 - <rustc_interface[8e34a951fb175e92]::passes::QueryContext>::enter::<rustc_driver[253633c1b73202d4]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[b57089ad9157542c]::result::Result<(), rustc_errors[8f52deac729bd09c]::ErrorGuaranteed>>
54:     0x7f19704bb40a - <rustc_interface[8e34a951fb175e92]::interface::Compiler>::enter::<rustc_driver[253633c1b73202d4]::run_compiler::{closure#1}::{closure#2}, core[b57089ad9157542c]::result::Result<core[b57089ad9157542c]::option::Option<rustc_interface[8e34a951fb175e92]::queries::Linker>, rustc_errors[8f52deac729bd09c]::ErrorGuaranteed>>
55:     0x7f19704ce27d - rustc_span[27f869f84b8424c3]::with_source_map::<core[b57089ad9157542c]::result::Result<(), rustc_errors[8f52deac729bd09c]::ErrorGuaranteed>, rustc_interface[8e34a951fb175e92]::interface::create_compiler_and_run<core[b57089ad9157542c]::result::Result<(), rustc_errors[8f52deac729bd09c]::ErrorGuaranteed>, rustc_driver[253633c1b73202d4]::run_compiler::{closure#1}>::{closure#1}>
56:     0x7f19704bc3b0 - rustc_interface[8e34a951fb175e92]::interface::create_compiler_and_run::<core[b57089ad9157542c]::result::Result<(), rustc_errors[8f52deac729bd09c]::ErrorGuaranteed>, rustc_driver[253633c1b73202d4]::run_compiler::{closure#1}>
57:     0x7f19704ba322 - <scoped_tls[c69d22638ea3d4d4]::ScopedKey<rustc_span[27f869f84b8424c3]::SessionGlobals>>::set::<rustc_interface[8e34a951fb175e92]::interface::run_compiler<core[b57089ad9157542c]::result::Result<(), rustc_errors[8f52deac729bd09c]::ErrorGuaranteed>, rustc_driver[253633c1b73202d4]::run_compiler::{closure#1}>::{closure#0}, core[b57089ad9157542c]::result::Result<(), rustc_errors[8f52deac729bd09c]::ErrorGuaranteed>>
58:     0x7f19704b85fd - std[7f7de7bb0dc2c2d9]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[8e34a951fb175e92]::util::run_in_thread_pool_with_globals<rustc_interface[8e34a951fb175e92]::interface::run_compiler<core[b57089ad9157542c]::result::Result<(), rustc_errors[8f52deac729bd09c]::ErrorGuaranteed>, rustc_driver[253633c1b73202d4]::run_compiler::{closure#1}>::{closure#0}, core[b57089ad9157542c]::result::Result<(), rustc_errors[8f52deac729bd09c]::ErrorGuaranteed>>::{closure#0}, core[b57089ad9157542c]::result::Result<(), rustc_errors[8f52deac729bd09c]::ErrorGuaranteed>>
59:     0x7f19704b88f9 - <<std[7f7de7bb0dc2c2d9]::thread::Builder>::spawn_unchecked_<rustc_interface[8e34a951fb175e92]::util::run_in_thread_pool_with_globals<rustc_interface[8e34a951fb175e92]::interface::run_compiler<core[b57089ad9157542c]::result::Result<(), rustc_errors[8f52deac729bd09c]::ErrorGuaranteed>, rustc_driver[253633c1b73202d4]::run_compiler::{closure#1}>::{closure#0}, core[b57089ad9157542c]::result::Result<(), rustc_errors[8f52deac729bd09c]::ErrorGuaranteed>>::{closure#0}, core[b57089ad9157542c]::result::Result<(), rustc_errors[8f52deac729bd09c]::ErrorGuaranteed>>::{closure#1} as core[b57089ad9157542c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
60:     0x7f196def6843 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h87c94dc77f5f15da
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/alloc/src/boxed.rs:1854:9
61:     0x7f196def6843 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h08d1e7d9bef4fe96
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/alloc/src/boxed.rs:1854:9
62:     0x7f196def6843 - std::sys::unix::thread::Thread::new::thread_start::heb982bb63b328588
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/std/src/sys/unix/thread.rs:108:17
63:     0x7f196dc88927 - start_thread
at ./nptl/./nptl/pthread_create.c:435:8
64:     0x7f196dd189e4 - __clone
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:100
65:                0x0 - <unknown>

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.61.0-nightly (9fcbc3205 2022-03-04) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [mir_borrowck] borrow-checking `gb::<impl at src/gb/mod.rs:19:1: 53:2>::build`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `rustish-gb`
user@pop-os:~/Projects/rustish$
Backtrace

user@pop-os:~/Projects/rustish$ RUST_BACKTRACE=1 cargo build
Compiling rustish-gb v0.1.0 (/home/user/Projects/rustish)
thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 3', compiler/rustc_infer/src/infer/region_constraints/mod.rs:446:9
stack backtrace:
0: rust_begin_unwind
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/core/src/panicking.rs:143:14
2: core::panicking::panic_bounds_check
at /rustc/9fcbc32053d5084d1de79bd484de82474cdae427/library/core/src/panicking.rs:84:5
3: <rustc_middle::ty::sty::Region as rustc_middle::ty::relate::Relate>::relate::<rustc_infer::infer::combine::Generalizer>
4: rustc_middle::ty::relate::super_relate_tys::<rustc_infer::infer::combine::Generalizer>
5: <rustc_infer::infer::combine::Generalizer as rustc_middle::ty::relate::TypeRelation>::tys
6: rustc_middle::ty::relate::super_relate_tys::<rustc_infer::infer::combine::Generalizer>
7: <rustc_infer::infer::combine::Generalizer as rustc_middle::ty::relate::TypeRelation>::tys
8: <rustc_infer::infer::combine::CombineFields>::instantiate
9: <rustc_infer::infer::equate::Equate as rustc_middle::ty::relate::TypeRelation>::relate_with_variance::<rustc_middle::ty::subst::GenericArg>
10: <&mut rustc_middle::ty::relate::relate_substs<rustc_infer::infer::equate::Equate>::{closure#0} as core::ops::function::FnOnce<((usize, (rustc_middle::ty::subst::GenericArg, rustc_middle::ty::subst::GenericArg)),)>>::call_once
11: <rustc_infer::infer::equate::Equate as rustc_middle::ty::relate::TypeRelation>::relate_item_substs
12: rustc_middle::ty::relate::super_relate_tys::<rustc_infer::infer::equate::Equate>
13: <rustc_infer::infer::equate::Equate as rustc_middle::ty::relate::TypeRelation>::tys
14: <rustc_trait_selection::traits::select::SelectionContext>::rematch_impl
15: <rustc_trait_selection::traits::select::SelectionContext>::confirm_candidate
16: <rustc_trait_selection::traits::select::SelectionContext>::select
17: <rustc_trait_selection::traits::fulfill::FulfillProcessor>::process_changed_obligations
18: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor, rustc_data_structures::obligation_forest::Outcome<rustc_trait_selection::traits::fulfill::PendingPredicateObligation, rustc_infer::traits::FulfillmentErrorCode>>
19: <rustc_trait_selection::traits::fulfill::FulfillmentContext as rustc_infer::traits::engine::TraitEngine>::select_where_possible
20: <rustc_infer::infer::InferCtxtBuilder>::enter::<core::result::Result<alloc::vec::Vec<(&rustc_middle::ty::generics::GenericParamDef, alloc::string::String)>, ()>, <rustc_borrowck::MirBorrowckCtxt>::report_use_of_moved_or_uninitialized::{closure#10}>
21: <rustc_borrowck::MirBorrowckCtxt>::report_use_of_moved_or_uninitialized
22: <rustc_borrowck::MirBorrowckCtxt as rustc_mir_dataflow::framework::visitor::ResultsVisitor>::visit_statement_before_primary_effect
23: rustc_mir_dataflow::framework::visitor::visit_results::<rustc_borrowck::dataflow::BorrowckAnalyses<rustc_index::bit_set::BitSet<rustc_borrowck::dataflow::BorrowIndex>, rustc_index::bit_set::ChunkedBitSet<rustc_mir_dataflow::move_paths::MovePathIndex>, rustc_index::bit_set::ChunkedBitSet<rustc_mir_dataflow::move_paths::InitIndex>>, rustc_borrowck::dataflow::BorrowckAnalyses<rustc_mir_dataflow::framework::engine::Results<rustc_borrowck::dataflow::Borrows>, rustc_mir_dataflow::framework::engine::Results<rustc_mir_dataflow::impls::MaybeUninitializedPlaces>, rustc_mir_dataflow::framework::engine::Results<rustc_mir_dataflow::impls::EverInitializedPlaces>>, core::iter::adapters::map::Map<rustc_middle::mir::traversal::ReversePostorder, rustc_borrowck::do_mir_borrowck::{closure#2}>, rustc_borrowck::MirBorrowckCtxt>
24: rustc_borrowck::do_mir_borrowck
25: rustc_borrowck::mir_borrowck
26: <rustc_borrowck::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
27: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::BorrowCheckResult>
28: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::BorrowCheckResult>>
29: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
30: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_interface::passes::analysis::{closure#2}::{closure#0}>
31: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#2}>
32: rustc_interface::passes::analysis
33: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), core::result::Result<(), rustc_errors::ErrorGuaranteed>>
34: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), core::result::Result<(), rustc_errors::ErrorGuaranteed>>>
35: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
36: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
37: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
38: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
39: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>
40: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
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.61.0-nightly (9fcbc3205 2022-03-04) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [mir_borrowck] borrow-checking `gb::<impl at src/gb/mod.rs:19:1: 53:2>::build`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `rustish-gb`
user@pop-os:~/Projects/rustish$

@griffi-gh griffi-gh added 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. labels Mar 16, 2022
@griffi-gh
Copy link
Author

griffi-gh commented Mar 16, 2022

@compiler-errors
Copy link
Member

This seems to be fixed on nightly, or else maybe I'm having trouble reproducing it with cargo build. Can you rustup update nightly and check again?

@compiler-errors
Copy link
Member

Actually I think I fixed this in #94688.

@griffi-gh
Copy link
Author

fixed in the latest nightly

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

No branches or pull requests

2 participants