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

[ICE]: crash due to mutable re-borrow on nightly #117280

Closed
1 of 4 tasks
kchibisov opened this issue Oct 27, 2023 · 3 comments
Closed
1 of 4 tasks

[ICE]: crash due to mutable re-borrow on nightly #117280

kchibisov opened this issue Oct 27, 2023 · 3 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

@kchibisov
Copy link

kchibisov commented Oct 27, 2023

Code

No response

Affected release channels

  • Previous Stable
  • Current Stable
  • Current Beta
  • Current Nightly

Rust Version

rustc version: 1.75.0-nightly (df871fbf0 2023-10-24)

Current error output

No response

Backtrace

thread 'rustc' panicked at compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs:1755:62:
already mutably borrowed: BorrowError
stack backtrace:
   0:     0x7f31567511d1 - std::backtrace_rs::backtrace::libunwind::trace::h461fbefb027ec110
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f31567511d1 - std::backtrace_rs::backtrace::trace_unsynchronized::h1e7b9c7494dfa1dc
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f31567511d1 - std::backtrace::Backtrace::create::h23695d2e78022487
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/backtrace.rs:331:13
   3:     0x7f3156751120 - std::backtrace::Backtrace::force_capture::hbf6b76085f1850f2
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/backtrace.rs:313:9
   4:     0x7f31592c354c - std[6ab607a5ab2cb8cc]::panicking::update_hook::<alloc[ce99307034c6fa75]::boxed::Box<rustc_driver_impl[8589ffcf9907f645]::install_ice_hook::{closure#0}>>::{closure#0}
   5:     0x7f315676c338 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h55d83663e933c1e1
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/alloc/src/boxed.rs:2021:9
   6:     0x7f315676c338 - std::panicking::rust_panic_with_hook::h84b1df6311265f63
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/panicking.rs:735:13
   7:     0x7f315676c08e - std::panicking::begin_panic_handler::{{closure}}::hb5b46a0fb17cc9d6
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/panicking.rs:609:13
   8:     0x7f3156769646 - std::sys_common::backtrace::__rust_end_short_backtrace::h8d1a3272d720bdec
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/sys_common/backtrace.rs:170:18
   9:     0x7f315676bdf2 - rust_begin_unwind
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/panicking.rs:597:5
  10:     0x7f31567c7b25 - core::panicking::panic_fmt::h76d60a2d79b08002
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/core/src/panicking.rs:72:14
  11:     0x7f31567c4399 - core::cell::panic_already_mutably_borrowed::hd1690218e6231777
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/core/src/cell.rs:770:5
  12:     0x7f31594765a7 - <rustc_hir_typeck[9ddb6e03192e9266]::fn_ctxt::FnCtxt>::suggest_missing_unwrap_expect
  13:     0x7f315944a7fe - <rustc_hir_typeck[9ddb6e03192e9266]::fn_ctxt::FnCtxt>::emit_type_mismatch_suggestions
  14:     0x7f315944b185 - <rustc_hir_typeck[9ddb6e03192e9266]::fn_ctxt::FnCtxt>::emit_coerce_suggestions
  15:     0x7f315ae69646 - <rustc_hir_typeck[9ddb6e03192e9266]::fn_ctxt::FnCtxt>::check_return_expr
  16:     0x7f315ae6bcd6 - <rustc_hir_typeck[9ddb6e03192e9266]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  17:     0x7f315a983c19 - <rustc_hir_typeck[9ddb6e03192e9266]::fn_ctxt::FnCtxt>::check_block_with_expected
  18:     0x7f315a9879e2 - <rustc_hir_typeck[9ddb6e03192e9266]::fn_ctxt::FnCtxt>::check_decl
  19:     0x7f315a984b9a - <rustc_hir_typeck[9ddb6e03192e9266]::fn_ctxt::FnCtxt>::check_block_with_expected
  20:     0x7f315ae6ab63 - <rustc_hir_typeck[9ddb6e03192e9266]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  21:     0x7f315acc2312 - rustc_hir_typeck[9ddb6e03192e9266]::check::check_fn
  22:     0x7f315a6d16a6 - rustc_hir_typeck[9ddb6e03192e9266]::typeck
  23:     0x7f315a6d0b3d - rustc_query_impl[f574b90a06e120c1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f574b90a06e120c1]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dea512150ded3e4a]::query::erase::Erased<[u8; 8usize]>>
  24:     0x7f315aaeaace - rustc_query_system[f0209a4e9dd6e770]::query::plumbing::try_execute_query::<rustc_query_impl[f574b90a06e120c1]::DynamicConfig<rustc_query_system[f0209a4e9dd6e770]::query::caches::VecCache<rustc_span[d4c22c52f489236a]::def_id::LocalDefId, rustc_middle[dea512150ded3e4a]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[f574b90a06e120c1]::plumbing::QueryCtxt, true>
  25:     0x7f315ac8dd4b - rustc_query_impl[f574b90a06e120c1]::query_impl::typeck::get_query_incr::__rust_end_short_backtrace
  26:     0x7f315a7ea6fa - rustc_hir_analysis[c91f1e08dc87088c]::check_crate
  27:     0x7f315aa0f69f - rustc_interface[699cb49b79c4b7c4]::passes::analysis
  28:     0x7f315aa0f0a1 - rustc_query_impl[f574b90a06e120c1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[f574b90a06e120c1]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dea512150ded3e4a]::query::erase::Erased<[u8; 1usize]>>
  29:     0x7f315af19e44 - rustc_query_system[f0209a4e9dd6e770]::query::plumbing::try_execute_query::<rustc_query_impl[f574b90a06e120c1]::DynamicConfig<rustc_query_system[f0209a4e9dd6e770]::query::caches::SingleCache<rustc_middle[dea512150ded3e4a]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[f574b90a06e120c1]::plumbing::QueryCtxt, true>
  30:     0x7f315af19b20 - rustc_query_impl[f574b90a06e120c1]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  31:     0x7f315b125a8d - std[6ab607a5ab2cb8cc]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[699cb49b79c4b7c4]::util::run_in_thread_with_globals<rustc_interface[699cb49b79c4b7c4]::interface::run_compiler<core[fb885386c08fe159]::result::Result<(), rustc_span[d4c22c52f489236a]::ErrorGuaranteed>, rustc_driver_impl[8589ffcf9907f645]::run_compiler::{closure#1}>::{closure#0}, core[fb885386c08fe159]::result::Result<(), rustc_span[d4c22c52f489236a]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[fb885386c08fe159]::result::Result<(), rustc_span[d4c22c52f489236a]::ErrorGuaranteed>>
  32:     0x7f315b124d73 - <<std[6ab607a5ab2cb8cc]::thread::Builder>::spawn_unchecked_<rustc_interface[699cb49b79c4b7c4]::util::run_in_thread_with_globals<rustc_interface[699cb49b79c4b7c4]::interface::run_compiler<core[fb885386c08fe159]::result::Result<(), rustc_span[d4c22c52f489236a]::ErrorGuaranteed>, rustc_driver_impl[8589ffcf9907f645]::run_compiler::{closure#1}>::{closure#0}, core[fb885386c08fe159]::result::Result<(), rustc_span[d4c22c52f489236a]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[fb885386c08fe159]::result::Result<(), rustc_span[d4c22c52f489236a]::ErrorGuaranteed>>::{closure#1} as core[fb885386c08fe159]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  33:     0x7f3156777105 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc1912fbcc3cda000
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/alloc/src/boxed.rs:2007:9
  34:     0x7f3156777105 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1dc2cad801006e9c
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/alloc/src/boxed.rs:2007:9
  35:     0x7f3156777105 - std::sys::unix::thread::Thread::new::thread_start::h20273a6be208d23b
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/sys/unix/thread.rs:108:17
  36:     0x7f3156546cfb - <unknown>
  37:     0x7f31565c707c - <unknown>
  38:                0x0 - <unknown>


rustc version: 1.75.0-nightly (df871fbf0 2023-10-24)
platform: x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck] type-checking `input::action`
#1 [analysis] running analysis passes on this crate
end of query stack
delayed span bug: coercion error but no error emitted
disabled backtrace
thread 'rustc' panicked at library/core/src/panicking.rs:144:5:
panic in a destructor during cleanup
stack backtrace:
   0:     0x7f31567511d1 - std::backtrace_rs::backtrace::libunwind::trace::h461fbefb027ec110
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f31567511d1 - std::backtrace_rs::backtrace::trace_unsynchronized::h1e7b9c7494dfa1dc
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f31567511d1 - std::backtrace::Backtrace::create::h23695d2e78022487
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/backtrace.rs:331:13
   3:     0x7f3156751120 - std::backtrace::Backtrace::force_capture::hbf6b76085f1850f2
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/backtrace.rs:313:9
   4:     0x7f31592c354c - std[6ab607a5ab2cb8cc]::panicking::update_hook::<alloc[ce99307034c6fa75]::boxed::Box<rustc_driver_impl[8589ffcf9907f645]::install_ice_hook::{closure#0}>>::{closure#0}
   5:     0x7f315676c338 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h55d83663e933c1e1
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/alloc/src/boxed.rs:2021:9
   6:     0x7f315676c338 - std::panicking::rust_panic_with_hook::h84b1df6311265f63
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/panicking.rs:735:13
   7:     0x7f315676c059 - std::panicking::begin_panic_handler::{{closure}}::hb5b46a0fb17cc9d6
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/panicking.rs:601:13
   8:     0x7f3156769646 - std::sys_common::backtrace::__rust_end_short_backtrace::h8d1a3272d720bdec
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/sys_common/backtrace.rs:170:18
   9:     0x7f315676bdf2 - rust_begin_unwind
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/panicking.rs:597:5
  10:     0x7f31567c7b68 - core::panicking::panic_nounwind_fmt::hdf18f2c30bb31a48
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/core/src/panicking.rs:106:14
  11:     0x7f31567c7c6c - core::panicking::panic_nounwind_nobacktrace::h6a856dc7081ef21a
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/core/src/panicking.rs:144:5
  12:     0x7f31567c7e73 - core::panicking::panic_in_cleanup::h81daca18c9e385fe
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/core/src/panicking.rs:238:5
  13:     0x7f315b126cdb - std[6ab607a5ab2cb8cc]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[699cb49b79c4b7c4]::util::run_in_thread_with_globals<rustc_interface[699cb49b79c4b7c4]::interface::run_compiler<core[fb885386c08fe159]::result::Result<(), rustc_span[d4c22c52f489236a]::ErrorGuaranteed>, rustc_driver_impl[8589ffcf9907f645]::run_compiler::{closure#1}>::{closure#0}, core[fb885386c08fe159]::result::Result<(), rustc_span[d4c22c52f489236a]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[fb885386c08fe159]::result::Result<(), rustc_span[d4c22c52f489236a]::ErrorGuaranteed>>
  14:     0x7f315b124d73 - <<std[6ab607a5ab2cb8cc]::thread::Builder>::spawn_unchecked_<rustc_interface[699cb49b79c4b7c4]::util::run_in_thread_with_globals<rustc_interface[699cb49b79c4b7c4]::interface::run_compiler<core[fb885386c08fe159]::result::Result<(), rustc_span[d4c22c52f489236a]::ErrorGuaranteed>, rustc_driver_impl[8589ffcf9907f645]::run_compiler::{closure#1}>::{closure#0}, core[fb885386c08fe159]::result::Result<(), rustc_span[d4c22c52f489236a]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[fb885386c08fe159]::result::Result<(), rustc_span[d4c22c52f489236a]::ErrorGuaranteed>>::{closure#1} as core[fb885386c08fe159]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  15:     0x7f3156777105 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc1912fbcc3cda000
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/alloc/src/boxed.rs:2007:9
  16:     0x7f3156777105 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1dc2cad801006e9c
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/alloc/src/boxed.rs:2007:9
  17:     0x7f3156777105 - std::sys::unix::thread::Thread::new::thread_start::h20273a6be208d23b
                               at /rustc/df871fbf053de3a855398964cd05fadbe91cf4fd/library/std/src/sys/unix/thread.rs:108:17
  18:     0x7f3156546cfb - <unknown>
  19:     0x7f31565c707c - <unknown>
  20:                0x0 - <unknown>

Anything else?

The error was triggered by the rust-analyzer during me writing this patch YaLTeR/niri#58 . I've noticed just by seeing a lot of rustc-ice stuff in the version control.

@kchibisov kchibisov 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 Oct 27, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 27, 2023
@lqd
Copy link
Member

lqd commented Oct 27, 2023

Could you test on the latest nightly? I believe this may have already been fixed by #117152

@kchibisov
Copy link
Author

I can't repro this issue at all though, so if you believe that it's fixed you can close it. Though the location is the same, so I'd assume the crash is the same?

@lqd
Copy link
Member

lqd commented Oct 27, 2023

That's my belief as well. Thanks for opening an issue. I'll close this one as a duplicate of #117144 then. Feel free to reopen if it still happens in a future nightly.

@lqd lqd closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2023
@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 28, 2023
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

4 participants