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 unexpectedly panicked. this is a bug. #10895

Closed
duelafn opened this issue Jun 5, 2023 · 4 comments
Closed

compiler unexpectedly panicked. this is a bug. #10895

duelafn opened this issue Jun 5, 2023 · 4 comments
Labels
I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@duelafn
Copy link

duelafn commented Jun 5, 2023

Clippy version: clippy 0.1.70 (90c5418 2023-05-31)

Installed via rustup: 1.70-x86_64-unknown-linux-gnu (default) (override)

$ rustc --version
rustc 1.70.0 (90c541806 2023-05-31)

Command executed:

cargo clippy --color=always -- -W clippy::nursery

Error trace (RUST_BACKTRACE=full)

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: used a `TypeErrCtxt` without failing compilation
  |
  = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
             1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
             2: core::ptr::drop_in_place::<rustc_infer::infer::error_reporting::TypeErrCtxt>
             3: <clippy_utils::diagnostics::span_lint_and_then<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn::{closure#0}>::{closure#0} as core::ops::function::FnOnce<(&mut rustc_errors::diagnostic_builder::DiagnosticBuilder<()>,)>>::call_once::{shim:vtable#0}
             4: rustc_middle::lint::struct_lint_level::struct_lint_level_impl::<&str>
             5: rustc_middle::lint::struct_lint_level::<&str, clippy_utils::diagnostics::span_lint_and_then<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn::{closure#0}>::{closure#0}>
             6: <rustc_lint::context::LateContext as rustc_lint::context::LintContext>::struct_span_lint::<rustc_span::span_encoding::Span, &str, clippy_utils::diagnostics::span_lint_and_then<rustc_lint::context::LateContext, rustc_span::span_encoding::Span, <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn::{closure#0}>::{closure#0}>
             7: <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn
             8: <rustc_lint::late::RuntimeCombinedLateLintPass as rustc_lint::passes::LateLintPass>::check_fn
             9: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_fn
            10: rustc_hir::intravisit::walk_impl_item::<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
            11: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_nested_impl_item
            12: rustc_hir::intravisit::walk_item::<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
            13: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_nested_item
            14: rustc_hir::intravisit::walk_mod::<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
            15: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_nested_item
            16: rustc_hir::intravisit::walk_mod::<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
            17: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_nested_item
            18: rustc_hir::intravisit::walk_mod::<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
            19: rustc_lint::late::late_lint_crate::<rustc_lint::BuiltinCombinedLateLintPass>
            20: <rustc_session::session::Session>::time::<(), rustc_lint::late::check_crate<rustc_lint::BuiltinCombinedLateLintPass, rustc_interface::passes::analysis::{closure#6}::{closure#1}::{closure#2}::{closure#0}::{closure#0}>::{closure#0}::{closure#0}>
            21: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#6}::{closure#1}::{closure#2}::{closure#0}>
            22: <core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#6}::{closure#1}> as core::ops::function::FnOnce<()>>::call_once
            23: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#6}>
            24: rustc_interface::passes::analysis
            25: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (rustc_middle::query::erase::Erased<[u8; 1]>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle::query::erase::Erased<[u8; 1]>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
            26: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
            27: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
            28: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            29: <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>>
            30: rustc_span::set_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
            31: 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>>
            32: <<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}
            33: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/boxed.rs:1973:9
            34: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/boxed.rs:1973:9
            35: std::sys::unix::thread::Thread::new::thread_start
                       at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys/unix/thread.rs:108:17
            36: start_thread
                       at ./nptl/./nptl/pthread_create.c:477:8
            37: clone
                       at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95


thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1679:13
stack backtrace:
   0:     0x7fe547364cca - std::backtrace_rs::backtrace::libunwind::trace::h9a6b80bbf328ba5d
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fe547364cca - std::backtrace_rs::backtrace::trace_unsynchronized::hd162ec543a11886b
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fe547364cca - std::sys_common::backtrace::_print_fmt::h78a5099be12f51a6
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fe547364cca - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha1c5390454d74f71
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fe5473c90cf - core::fmt::write::h9ffde816c577717b
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/fmt/mod.rs:1254:17
   5:     0x7fe547357805 - std::io::Write::write_fmt::h88186074961638e4
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/io/mod.rs:1698:15
   6:     0x7fe547364a95 - std::sys_common::backtrace::_print::h184198273ed08d59
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7fe547364a95 - std::sys_common::backtrace::print::h1b4d8e7add699453
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7fe54736773e - std::panicking::default_hook::{{closure}}::h393bcea75423915a
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:269:22
   9:     0x7fe5473674e5 - std::panicking::default_hook::h48c64f31d8b3fd03
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:288:9
  10:     0x560b2f521572 - clippy_driver[6aa1725373a10098]::ICE_HOOK::{closure#0}::{closure#0}
  11:     0x7fe547367f34 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hb9b860f5a1175bda
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/boxed.rs:1987:9
  12:     0x7fe547367f34 - std::panicking::rust_panic_with_hook::hafdc493a79370062
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:695:13
  13:     0x7fe54a678c31 - std[b70fedfd8b77e9]::panicking::begin_panic::<rustc_errors[c06e44e71f249a31]::DelayedBugPanic>::{closure#0}
  14:     0x7fe54a6785e6 - std[b70fedfd8b77e9]::sys_common::backtrace::__rust_end_short_backtrace::<std[b70fedfd8b77e9]::panicking::begin_panic<rustc_errors[c06e44e71f249a31]::DelayedBugPanic>::{closure#0}, !>
  15:     0x7fe54a68ea96 - std[b70fedfd8b77e9]::panicking::begin_panic::<rustc_errors[c06e44e71f249a31]::DelayedBugPanic>
  16:     0x7fe549b91d55 - <rustc_errors[c06e44e71f249a31]::HandlerInner>::flush_delayed::<alloc[c91da12302dbbf86]::vec::Vec<rustc_errors[c06e44e71f249a31]::DelayedDiagnostic>, &str>
  17:     0x7fe54991018c - <rustc_middle[a487dff4633a86d0]::ty::context::GlobalCtxt>::enter::<<rustc_interface[7aa24cde61830128]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[da82827a87f140f9]::result::Result<alloc[c91da12302dbbf86]::boxed::Box<dyn core[da82827a87f140f9]::any::Any>, rustc_span[2f805118d893a80f]::ErrorGuaranteed>>
  18:     0x7fe54990e858 - <rustc_interface[7aa24cde61830128]::queries::Queries>::ongoing_codegen
  19:     0x7fe54990e061 - <rustc_interface[7aa24cde61830128]::interface::Compiler>::enter::<rustc_driver_impl[fe6df70259db788d]::run_compiler::{closure#1}::{closure#2}, core[da82827a87f140f9]::result::Result<core[da82827a87f140f9]::option::Option<rustc_interface[7aa24cde61830128]::queries::Linker>, rustc_span[2f805118d893a80f]::ErrorGuaranteed>>
  20:     0x7fe549909281 - rustc_span[2f805118d893a80f]::set_source_map::<core[da82827a87f140f9]::result::Result<(), rustc_span[2f805118d893a80f]::ErrorGuaranteed>, rustc_interface[7aa24cde61830128]::interface::run_compiler<core[da82827a87f140f9]::result::Result<(), rustc_span[2f805118d893a80f]::ErrorGuaranteed>, rustc_driver_impl[fe6df70259db788d]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  21:     0x7fe54990882f - std[b70fedfd8b77e9]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[7aa24cde61830128]::util::run_in_thread_pool_with_globals<rustc_interface[7aa24cde61830128]::interface::run_compiler<core[da82827a87f140f9]::result::Result<(), rustc_span[2f805118d893a80f]::ErrorGuaranteed>, rustc_driver_impl[fe6df70259db788d]::run_compiler::{closure#1}>::{closure#0}, core[da82827a87f140f9]::result::Result<(), rustc_span[2f805118d893a80f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[da82827a87f140f9]::result::Result<(), rustc_span[2f805118d893a80f]::ErrorGuaranteed>>
  22:     0x7fe549eec661 - <<std[b70fedfd8b77e9]::thread::Builder>::spawn_unchecked_<rustc_interface[7aa24cde61830128]::util::run_in_thread_pool_with_globals<rustc_interface[7aa24cde61830128]::interface::run_compiler<core[da82827a87f140f9]::result::Result<(), rustc_span[2f805118d893a80f]::ErrorGuaranteed>, rustc_driver_impl[fe6df70259db788d]::run_compiler::{closure#1}>::{closure#0}, core[da82827a87f140f9]::result::Result<(), rustc_span[2f805118d893a80f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[da82827a87f140f9]::result::Result<(), rustc_span[2f805118d893a80f]::ErrorGuaranteed>>::{closure#1} as core[da82827a87f140f9]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  23:     0x7fe5473723b5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha1f2224656a778fb
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/boxed.rs:1973:9
  24:     0x7fe5473723b5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::haa29ed9703f354b7
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/boxed.rs:1973:9
  25:     0x7fe5473723b5 - std::sys::unix::thread::Thread::new::thread_start::h33b6dae3e3692197
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys/unix/thread.rs:108:17
  26:     0x7fe547239ea7 - start_thread
                               at ./nptl/./nptl/pthread_create.c:477:8
  27:     0x7fe547015a2f - clone
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  28:                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-clippy/issues/new

note: Clippy version: clippy 0.1.70 (90c5418 2023-05-31)

query stack during panic:
end of query stack
@Centri3
Copy link
Member

Centri3 commented Jun 5, 2023

@rustbot label +I-ICE

can you give a playground link that reproduces this? or the code in question?

@rustbot rustbot added the I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ label Jun 5, 2023
@giraffate
Copy link
Contributor

Does this happen by using the latest nightly? It looks like that it's a duplicate of #10645.

@duelafn
Copy link
Author

duelafn commented Jun 6, 2023

Ah, sorry, yes it is indeed fixed on nightly. No bugs to see here.

@duelafn duelafn closed this as completed Jun 6, 2023
@giraffate
Copy link
Contributor

No worry, thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants