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

Compiler panic, partial_cmp #114056

Open
RichoDemus opened this issue Jul 25, 2023 · 6 comments
Open

Compiler panic, partial_cmp #114056

RichoDemus opened this issue Jul 25, 2023 · 6 comments
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. 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

@RichoDemus
Copy link

RichoDemus commented Jul 25, 2023

Code

https://github.com/RichoDemus/luna/tree/compiler_crash

Meta

bug is also in nightly edit: no it's not, I invoked the nightly flag incorrectly

rustc --version --verbose:

❯ rustc --version --verbose
rustc 1.71.0 (8ede3aae2 2023-07-12)
binary: rustc
commit-hash: 8ede3aae28fe6e4d52b38157d7bfe0d3bceef225
commit-date: 2023-07-12
host: x86_64-pc-windows-msvc
release: 1.71.0
LLVM version: 16.0.5

Error output

<output>
Backtrace

thread 'rustc' panicked at 'index out of bounds: the len is 162 but the index is 167', C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ena-0.14.2\src\snapshot_vec.rs:199:10
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: 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.71.0 (8ede3aae2 2023-07-12) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type bin -C opt-level=3 -C embed-bitcode=no

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

query stack during panic:
#0 [typeck] type-checking `train_loop`
#1 [used_trait_imports] finding used_trait_imports `train_loop`
#2 [analysis] running analysis passes on this crate
end of query stack
warning: `luna` (bin "luna") generated 6 warnings (run `cargo fix --bin "luna"` to apply 6 suggestions)
error: could not compile `luna` (bin "luna"); 6 warnings emitted

@RichoDemus RichoDemus 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 Jul 25, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 25, 2023
@RichoDemus
Copy link
Author

it started failing when I added main.rs:61
I actually meant to invoke partial_cmp for the float result of MyState::reward() but I accidentally called partial_cmp on MyState and the compiler got sad

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 25, 2023
@AsumFace
Copy link

I experienced the same error on 1.71.0 with this highly reduced snipped:

struct P<Q>(R<Q>);
impl<U> V
{
}
impl<W> P<Q>
{
    Z() {
        X(&Y) {
            {
                Z() {
                    AB(BB) {
                        IB {
                        }
                    }
                }
            }
        }
    }
}
impl<Q: Eq> P<Q> {
    fn KB(&self, Y) -> MB {
        self.partial_cmp(PB)
    }
}

It does not trigger an ICE on 1.70.0 or 1.72.0.

@Xiretza
Copy link
Contributor

Xiretza commented Jul 25, 2023

Is all that stuff actually necessary for you? This also reproduces the ICE (with multiple additional backtraces) for me:

struct P<Q>(Q);
impl<Q> P<Q> {
    fn foo(&self) {
        self.partial_cmp(())
    }
}
output
thread 'rustc' panicked at 'index out of bounds: the len is 1 but the index is 6', /cargo/registry/src/index.crates.io-6f17d22bba15001f/ena-0.14.2/src/snapshot_vec.rs:199:10
stack backtrace:
   0:     0x7f954bd6a071 - std::backtrace_rs::backtrace::libunwind::trace::h6aeaf83abc038fe6
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f954bd6a071 - std::backtrace_rs::backtrace::trace_unsynchronized::h4f9875212db0ad97
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f954bd6a071 - std::sys_common::backtrace::_print_fmt::h3f820027e9c39d3b
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f954bd6a071 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hded4932df41373b3
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f954bdc9d9f - core::fmt::rt::Argument::fmt::hc8ead7746b2406d6
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/fmt/rt.rs:138:9
   5:     0x7f954bdc9d9f - core::fmt::write::hb1cb56105a082ad9
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f954bd5d271 - std::io::Write::write_fmt::h797fda7085c97e57
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/io/mod.rs:1713:15
   7:     0x7f954bd69e85 - std::sys_common::backtrace::_print::h492d3c92d7400346
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f954bd69e85 - std::sys_common::backtrace::print::hf74aa2eef05af215
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f954bd6cb47 - std::panicking::default_hook::{{closure}}::h8cad394227ea3de8
  10:     0x7f954bd6c934 - std::panicking::default_hook::h249cc184fec99a8a
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:288:9
  11:     0x7f954eee9b5b - rustc_driver_impl[55b27a31f76e3fb7]::install_ice_hook::{closure#0}
  12:     0x7f954bd6d28d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h0be7fc2421582b49
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1999:9
  13:     0x7f954bd6d28d - std::panicking::rust_panic_with_hook::h82ebcd5d5ed2fad4
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:709:13
  14:     0x7f954bd6d027 - std::panicking::begin_panic_handler::{{closure}}::h810bed8ecbe66f1a
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:597:13
  15:     0x7f954bd6a4a6 - std::sys_common::backtrace::__rust_end_short_backtrace::h1410008071796261
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:151:18
  16:     0x7f954bd6cd72 - rust_begin_unwind
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:593:5
  17:     0x7f954bdc6023 - core::panicking::panic_fmt::ha0a42a25e0cf258d
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/panicking.rs:67:14
  18:     0x7f954bdc6182 - core::panicking::panic_bounds_check::h387b081bddea0fec
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/panicking.rs:162:5
  19:     0x7f954cfe9867 - <rustc_infer[ab09412129cf3116]::infer::equate::Equate as rustc_middle[69e8a450f04f22d]::ty::relate::TypeRelation>::tys
  20:     0x7f954d5154c0 - <rustc_infer[ab09412129cf3116]::infer::at::At>::eq::<rustc_middle[69e8a450f04f22d]::ty::Ty>
  21:     0x7f954f0b2fdd - <rustc_infer[ab09412129cf3116]::infer::InferCtxt>::can_eq::<rustc_middle[69e8a450f04f22d]::ty::Ty>
  22:     0x7f954f08a23e - <rustc_hir_typeck[f9181b2105172c36]::fn_ctxt::FnCtxt>::suggest_derive
  23:     0x7f954f080a07 - <rustc_hir_typeck[f9181b2105172c36]::fn_ctxt::FnCtxt>::report_no_match_method_error
  24:     0x7f954f095573 - <rustc_hir_typeck[f9181b2105172c36]::fn_ctxt::FnCtxt>::report_method_error
  25:     0x7f954d4dfa48 - <rustc_hir_typeck[f9181b2105172c36]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  26:     0x7f954d51ef0a - <rustc_hir_typeck[f9181b2105172c36]::fn_ctxt::FnCtxt>::check_block_with_expected
  27:     0x7f954d4d82f9 - <rustc_hir_typeck[f9181b2105172c36]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  28:     0x7f954d9b3eb6 - <rustc_hir_typeck[f9181b2105172c36]::fn_ctxt::FnCtxt>::check_return_expr
  29:     0x7f954d9abb44 - rustc_hir_typeck[f9181b2105172c36]::check::check_fn
  30:     0x7f954d99a057 - rustc_hir_typeck[f9181b2105172c36]::typeck
  31:     0x7f954cfcb71e - rustc_query_impl[9640443f3247e199]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9640443f3247e199]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[69e8a450f04f22d]::query::erase::Erased<[u8; 8usize]>>
  32:     0x7f954cfcb6ee - <rustc_query_impl[9640443f3247e199]::query_impl::typeck::dynamic_query::{closure#2} as core[3d2408b9a7974bb]::ops::function::FnOnce<(rustc_middle[69e8a450f04f22d]::ty::context::TyCtxt, rustc_span[b25f563e2e6d20a1]::def_id::LocalDefId)>>::call_once
  33:     0x7f954d5fafc3 - rustc_query_system[18feb85a2a4aa83f]::query::plumbing::try_execute_query::<rustc_query_impl[9640443f3247e199]::DynamicConfig<rustc_query_system[18feb85a2a4aa83f]::query::caches::VecCache<rustc_span[b25f563e2e6d20a1]::def_id::LocalDefId, rustc_middle[69e8a450f04f22d]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[9640443f3247e199]::plumbing::QueryCtxt, true>
  34:     0x7f954e8c8eda - rustc_query_impl[9640443f3247e199]::query_impl::typeck::get_query_incr::__rust_end_short_backtrace
  35:     0x7f954d0f9dad - rustc_query_impl[9640443f3247e199]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9640443f3247e199]::query_impl::used_trait_imports::dynamic_query::{closure#2}::{closure#0}, rustc_middle[69e8a450f04f22d]::query::erase::Erased<[u8; 8usize]>>
  36:     0x7f954d0f9d0e - <rustc_query_impl[9640443f3247e199]::query_impl::used_trait_imports::dynamic_query::{closure#2} as core[3d2408b9a7974bb]::ops::function::FnOnce<(rustc_middle[69e8a450f04f22d]::ty::context::TyCtxt, rustc_span[b25f563e2e6d20a1]::def_id::LocalDefId)>>::call_once
  37:     0x7f954d5fafc3 - rustc_query_system[18feb85a2a4aa83f]::query::plumbing::try_execute_query::<rustc_query_impl[9640443f3247e199]::DynamicConfig<rustc_query_system[18feb85a2a4aa83f]::query::caches::VecCache<rustc_span[b25f563e2e6d20a1]::def_id::LocalDefId, rustc_middle[69e8a450f04f22d]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[9640443f3247e199]::plumbing::QueryCtxt, true>
  38:     0x7f954e8c90aa - rustc_query_impl[9640443f3247e199]::query_impl::used_trait_imports::get_query_incr::__rust_end_short_backtrace
  39:     0x7f954e3cd37c - rustc_hir_analysis[367b7eb6b2106fd1]::check_crate
  40:     0x7f954e3c843d - rustc_interface[2ac6857faa489841]::passes::analysis
  41:     0x7f954e40624a - rustc_query_impl[9640443f3247e199]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9640443f3247e199]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[69e8a450f04f22d]::query::erase::Erased<[u8; 1usize]>>
  42:     0x7f954e406239 - <rustc_query_impl[9640443f3247e199]::query_impl::analysis::dynamic_query::{closure#2} as core[3d2408b9a7974bb]::ops::function::FnOnce<(rustc_middle[69e8a450f04f22d]::ty::context::TyCtxt, ())>>::call_once
  43:     0x7f954e70e62c - rustc_query_system[18feb85a2a4aa83f]::query::plumbing::try_execute_query::<rustc_query_impl[9640443f3247e199]::DynamicConfig<rustc_query_system[18feb85a2a4aa83f]::query::caches::SingleCache<rustc_middle[69e8a450f04f22d]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[9640443f3247e199]::plumbing::QueryCtxt, true>
  44:     0x7f954e70e1d4 - rustc_query_impl[9640443f3247e199]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  45:     0x7f954e172f22 - <rustc_interface[2ac6857faa489841]::queries::QueryResult<&rustc_middle[69e8a450f04f22d]::ty::context::GlobalCtxt>>::enter::<core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>, rustc_driver_impl[55b27a31f76e3fb7]::run_compiler::{closure#1}::{closure#2}::{closure#4}>
  46:     0x7f954e171e85 - <rustc_interface[2ac6857faa489841]::interface::Compiler>::enter::<rustc_driver_impl[55b27a31f76e3fb7]::run_compiler::{closure#1}::{closure#2}, core[3d2408b9a7974bb]::result::Result<core[3d2408b9a7974bb]::option::Option<rustc_interface[2ac6857faa489841]::queries::Linker>, rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>>
  47:     0x7f954e16f683 - std[a2d7a4c8dd6a1366]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[2ac6857faa489841]::util::run_in_thread_pool_with_globals<rustc_interface[2ac6857faa489841]::interface::run_compiler<core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>, rustc_driver_impl[55b27a31f76e3fb7]::run_compiler::{closure#1}>::{closure#0}, core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>>
  48:     0x7f954e79b165 - <<std[a2d7a4c8dd6a1366]::thread::Builder>::spawn_unchecked_<rustc_interface[2ac6857faa489841]::util::run_in_thread_pool_with_globals<rustc_interface[2ac6857faa489841]::interface::run_compiler<core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>, rustc_driver_impl[55b27a31f76e3fb7]::run_compiler::{closure#1}>::{closure#0}, core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>>::{closure#1} as core[3d2408b9a7974bb]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  49:     0x7f954bd777b5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9adfc2ae43657457
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1985:9
  50:     0x7f954bd777b5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h14fefbfa7b574396
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1985:9
  51:     0x7f954bd777b5 - std::sys::unix::thread::Thread::new::thread_start::ha211bb47f6f5cedc
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys/unix/thread.rs:108:17
  52:     0x7f954bb1344b - <unknown>
  53:     0x7f954bb96e40 - <unknown>
  54:                0x0 - <unknown>

error: 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.71.0 (8ede3aae2 2023-07-12) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
#0 [typeck] type-checking `<impl at src/lib.rs:2:1: 2:13>::foo`
#1 [used_trait_imports] finding used_trait_imports `<impl at src/lib.rs:2:1: 2:13>::foo`
#2 [analysis] running analysis passes on this crate
end of query stack
error: internal compiler error: no warnings or errors encountered even though `delayed_good_path_bugs` issued

error: internal compiler error: trimmed_def_paths constructed but no error emitted; use `DelayDm` for lints or `with_no_trimmed_paths` for debugging
  |
  = note: delayed at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/compiler/rustc_errors/src/lib.rs:1620:30
             0: <rustc_errors::Handler>::delay_good_path_bug::<&str>
             1: rustc_middle::ty::print::pretty::trimmed_def_paths
             2: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::trimmed_def_paths::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
             3: <rustc_query_impl::query_impl::trimmed_def_paths::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, ())>>::call_once
             4: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
             5: rustc_query_impl::query_impl::trimmed_def_paths::get_query_incr::__rust_end_short_backtrace
             6: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::Printer>::print_def_path
             7: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::Printer>::print_def_path
             8: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::pretty::PrettyPrinter>::pretty_print_type
             9: <rustc_middle::ty::sty::TypeAndMut as rustc_middle::ty::print::Print<rustc_middle::ty::print::pretty::FmtPrinter>>::print
            10: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::pretty::PrettyPrinter>::pretty_print_type
            11: <rustc_middle::ty::context::TyCtxt>::short_ty_string
            12: <rustc_hir_typeck::fn_ctxt::FnCtxt>::report_no_match_method_error
            13: <rustc_hir_typeck::fn_ctxt::FnCtxt>::report_method_error
            14: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
            15: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
            16: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
            17: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
            18: rustc_hir_typeck::check::check_fn
            19: rustc_hir_typeck::typeck
            20: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
            21: <rustc_query_impl::query_impl::typeck::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
            22: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
            23: rustc_query_impl::query_impl::typeck::get_query_incr::__rust_end_short_backtrace
            24: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::used_trait_imports::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
            25: <rustc_query_impl::query_impl::used_trait_imports::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
            26: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
            27: rustc_query_impl::query_impl::used_trait_imports::get_query_incr::__rust_end_short_backtrace
            28: rustc_hir_analysis::check_crate
            29: rustc_interface::passes::analysis
            30: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            31: <rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, ())>>::call_once
            32: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
            33: rustc_query_impl::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
            34: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
            35: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
            36: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            37: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            38: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1985:9
            39: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1985:9
            40: std::sys::unix::thread::Thread::new::thread_start
                       at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys/unix/thread.rs:108:17
            41: <unknown>
            42: <unknown>


error: internal compiler error: used a `TypeErrCtxt` without raising an error or lint
  |
  = note: delayed at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/compiler/rustc_errors/src/lib.rs:1620:30
             0: <rustc_errors::Handler>::delay_good_path_bug::<&str>
             1: core::ptr::drop_in_place::<rustc_infer::infer::error_reporting::TypeErrCtxt>
             2: <rustc_hir_typeck::fn_ctxt::FnCtxt>::extract_callable_info
             3: <rustc_hir_typeck::fn_ctxt::FnCtxt>::report_no_match_method_error
             4: <rustc_hir_typeck::fn_ctxt::FnCtxt>::report_method_error
             5: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
             7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
             8: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
             9: rustc_hir_typeck::check::check_fn
            10: rustc_hir_typeck::typeck
            11: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
            12: <rustc_query_impl::query_impl::typeck::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
            13: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
            14: rustc_query_impl::query_impl::typeck::get_query_incr::__rust_end_short_backtrace
            15: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::used_trait_imports::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
            16: <rustc_query_impl::query_impl::used_trait_imports::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
            17: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
            18: rustc_query_impl::query_impl::used_trait_imports::get_query_incr::__rust_end_short_backtrace
            19: rustc_hir_analysis::check_crate
            20: rustc_interface::passes::analysis
            21: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            22: <rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, ())>>::call_once
            23: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
            24: rustc_query_impl::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
            25: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
            26: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
            27: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            28: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            29: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1985:9
            30: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1985:9
            31: std::sys::unix::thread::Thread::new::thread_start
                       at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys/unix/thread.rs:108:17
            32: <unknown>
            33: <unknown>


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.71.0 (8ede3aae2 2023-07-12) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
end of query stack
thread 'rustc' panicked at 'panic in a function that cannot unwind', library/core/src/panicking.rs:126:5
stack backtrace:
   0:     0x7f954bd6a071 - std::backtrace_rs::backtrace::libunwind::trace::h6aeaf83abc038fe6
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f954bd6a071 - std::backtrace_rs::backtrace::trace_unsynchronized::h4f9875212db0ad97
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f954bd6a071 - std::sys_common::backtrace::_print_fmt::h3f820027e9c39d3b
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f954bd6a071 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hded4932df41373b3
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f954bdc9d9f - core::fmt::rt::Argument::fmt::hc8ead7746b2406d6
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/fmt/rt.rs:138:9
   5:     0x7f954bdc9d9f - core::fmt::write::hb1cb56105a082ad9
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f954bd5d271 - std::io::Write::write_fmt::h797fda7085c97e57
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/io/mod.rs:1713:15
   7:     0x7f954bd69e85 - std::sys_common::backtrace::_print::h492d3c92d7400346
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f954bd69e85 - std::sys_common::backtrace::print::hf74aa2eef05af215
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f954bd6cb47 - std::panicking::default_hook::{{closure}}::h8cad394227ea3de8
  10:     0x7f954bd6c934 - std::panicking::default_hook::h249cc184fec99a8a
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:288:9
  11:     0x7f954eee9b5b - rustc_driver_impl[55b27a31f76e3fb7]::install_ice_hook::{closure#0}
  12:     0x7f954bd6d28d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h0be7fc2421582b49
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1999:9
  13:     0x7f954bd6d28d - std::panicking::rust_panic_with_hook::h82ebcd5d5ed2fad4
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:709:13
  14:     0x7f954bd6cfe1 - std::panicking::begin_panic_handler::{{closure}}::h810bed8ecbe66f1a
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:595:13
  15:     0x7f954bd6a4a6 - std::sys_common::backtrace::__rust_end_short_backtrace::h1410008071796261
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:151:18
  16:     0x7f954bd6cd72 - rust_begin_unwind
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:593:5
  17:     0x7f954bdc6063 - core::panicking::panic_nounwind_fmt::h80a99c33c4703954
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/panicking.rs:96:14
  18:     0x7f954bdc6107 - core::panicking::panic_nounwind::h81a1bb4a16bcd655
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/panicking.rs:126:5
  19:     0x7f954bdc6293 - core::panicking::panic_cannot_unwind::hc3ef110419ba8f94
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/panicking.rs:188:5
  20:     0x7f954e17001f - std[a2d7a4c8dd6a1366]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[2ac6857faa489841]::util::run_in_thread_pool_with_globals<rustc_interface[2ac6857faa489841]::interface::run_compiler<core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>, rustc_driver_impl[55b27a31f76e3fb7]::run_compiler::{closure#1}>::{closure#0}, core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>>
  21:     0x7f954e79b165 - <<std[a2d7a4c8dd6a1366]::thread::Builder>::spawn_unchecked_<rustc_interface[2ac6857faa489841]::util::run_in_thread_pool_with_globals<rustc_interface[2ac6857faa489841]::interface::run_compiler<core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>, rustc_driver_impl[55b27a31f76e3fb7]::run_compiler::{closure#1}>::{closure#0}, core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>>::{closure#1} as core[3d2408b9a7974bb]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  22:     0x7f954bd777b5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9adfc2ae43657457
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1985:9
  23:     0x7f954bd777b5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h14fefbfa7b574396
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1985:9
  24:     0x7f954bd777b5 - std::sys::unix::thread::Thread::new::thread_start::ha211bb47f6f5cedc
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys/unix/thread.rs:108:17
  25:     0x7f954bb1344b - <unknown>
  26:     0x7f954bb96e40 - <unknown>
  27:                0x0 - <unknown>

error: 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.71.0 (8ede3aae2 2023-07-12) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
end of query stack
thread caused non-unwinding panic. aborting.

@AsumFace
Copy link

Is all that stuff actually necessary for you? This also reproduces the ICE (with multiple additional backtraces) for me:
[...]

You are right, it also reproduces with that. I'm surprised DustMite is failing to reduce that part, actually.

@RichoDemus
Copy link
Author

Thanks for helping out with producing a more minimal example :)

@lqd
Copy link
Member

lqd commented Jul 25, 2023

This is a duplicate of #111500 or #114049 and has already been fixed on nightly and beta by #111516. I’ve nominated that PR for a stable backport, in case there’s a point release.

@matthiaskrgr matthiaskrgr added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Apr 19, 2024
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. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. 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

7 participants