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 in clippy #5816

Closed
yan-zaretskiy opened this issue Jul 17, 2020 · 5 comments
Closed

ICE in clippy #5816

yan-zaretskiy opened this issue Jul 17, 2020 · 5 comments
Labels
I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@yan-zaretskiy
Copy link

Trying to run cargo clippy on my code today, I got

thread 'rustc' panicked at 'index out of bounds: the len is 4 but the index is 4', src/tools/clippy/clippy_lints/src/unnested_or_patterns.rs:403:27
stack backtrace:
   0:        0x10f48951e - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h13e6f26430148ff2
   1:        0x10f4c1f5c - core::fmt::write::h45a9bd04db15c24f
   2:        0x10f47a659 - std::io::Write::write_fmt::h8ae61696f13218d5
   3:        0x10f48df45 - std::panicking::default_hook::{{closure}}::hc98fe2390b6284e5
   4:        0x10f48dc82 - std::panicking::default_hook::h9a63cea866a4c14a
   5:        0x107d7ae32 - clippy_driver::report_clippy_ice::h5d9e7083c9c7365d
   6:        0x10f48e5fd - std::panicking::rust_panic_with_hook::h4d446ca45c8e1faa
   7:        0x10f48e1a2 - rust_begin_unwind
   8:        0x10f4e521f - core::panicking::panic_fmt::hda969e68cfcc1b10
   9:        0x10f4e51e6 - core::panicking::panic_bounds_check::h09b5dc2ffa04f0cf
  10:        0x107f7d433 - clippy_lints::unnested_or_patterns::eq_pre_post::hedce6be0a05cf1a1
  11:        0x10801f8ba - <alloc::vec::DrainFilter<T,F> as core::iter::traits::iterator::Iterator>::next::hb4962a33bf061c5d
  12:        0x107f7b096 - <clippy_lints::unnested_or_patterns::unnest_or_patterns::Visitor as rustc_ast::mut_visit::MutVisitor>::visit_pat::h60806b54d29096d8
  13:        0x107f7a0dd - clippy_lints::unnested_or_patterns::lint_unnested_or_patterns::h5b8a4d1c2f13fadf
  14:        0x10bb4ec23 - <rustc_lint::early::EarlyLintPassObjects as rustc_lint::passes::EarlyLintPass>::check_arm::h0babd5ff79ce58e4
  15:        0x1086ab6be - rustc_ast::visit::walk_expr::h97e76480f5144919
  16:        0x108663867 - <rustc_lint::early::EarlyContextAndPass<T> as rustc_ast::visit::Visitor>::visit_expr::h4b47e9ab3967cb67
  17:        0x1086ab774 - rustc_ast::visit::walk_expr::h97e76480f5144919
  18:        0x108663867 - <rustc_lint::early::EarlyContextAndPass<T> as rustc_ast::visit::Visitor>::visit_expr::h4b47e9ab3967cb67
  19:        0x1086abdbf - rustc_ast::visit::walk_expr::h97e76480f5144919
  20:        0x108663867 - <rustc_lint::early::EarlyContextAndPass<T> as rustc_ast::visit::Visitor>::visit_expr::h4b47e9ab3967cb67
  21:        0x1086abdbf - rustc_ast::visit::walk_expr::h97e76480f5144919
  22:        0x108663867 - <rustc_lint::early::EarlyContextAndPass<T> as rustc_ast::visit::Visitor>::visit_expr::h4b47e9ab3967cb67
  23:        0x108663af7 - <rustc_lint::early::EarlyContextAndPass<T> as rustc_ast::visit::Visitor>::visit_local::h74043354c7c706e8
  24:        0x1086ab5b4 - rustc_ast::visit::walk_expr::h97e76480f5144919
  25:        0x108663867 - <rustc_lint::early::EarlyContextAndPass<T> as rustc_ast::visit::Visitor>::visit_expr::h4b47e9ab3967cb67
  26:        0x1086a71f4 - rustc_ast::visit::walk_fn::h55031f4d5a60b400
  27:        0x1086a3037 - rustc_ast::visit::walk_assoc_item::hbf628ce1f1f9957e
  28:        0x1086aced0 - rustc_ast::visit::walk_item::h7a136d18b8588e0c
  29:        0x1086a876c - rustc_ast::visit::walk_mod::hfbde1f9aff7e959b
  30:        0x1086ac30c - rustc_ast::visit::walk_item::h7a136d18b8588e0c
  31:        0x1086a876c - rustc_ast::visit::walk_mod::hfbde1f9aff7e959b
  32:        0x10863f4fb - rustc_lint::early::early_lint_crate::hdf7efd504097e6ab
  33:        0x10863de7b - rustc_lint::early::check_ast_crate::haad559391831f24a
  34:        0x1086b3021 - rustc_session::utils::<impl rustc_session::session::Session>::time::h5e7252e0109052eb
  35:        0x108622795 - rustc_interface::passes::BoxedResolver::access::{{closure}}::hc4a3435e78c7ad36
  36:        0x10867c778 - rustc_interface::passes::configure_and_expand::{{closure}}::h00aafd017f5e3ca5
  37:        0x1086224c9 - rustc_interface::passes::BoxedResolver::access::h8fb09d2d154da189
  38:        0x10863b27d - rustc_interface::queries::Queries::lower_to_hir::haf4b7b12b1399e6e
  39:        0x10863be6f - rustc_interface::queries::Queries::global_ctxt::h71bc8858bfbb1f2b
  40:        0x108490d46 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h7b04855e89777cfa
  41:        0x10851b51e - rustc_span::with_source_map::heb2b51a1f3d09b82
  42:        0x108491d0a - rustc_interface::interface::create_compiler_and_run::h0dccc09f3a41f199
  43:        0x1084b9e79 - scoped_tls::ScopedKey<T>::set::h237c5aede1b35167
  44:        0x1084dc3e7 - std::sys_common::backtrace::__rust_begin_short_backtrace::h7836bf6fd1bfeba7
  45:        0x10849ef1c - core::ops::function::FnOnce::call_once{{vtable.shim}}::h2c6f48c5993204b0
  46:        0x10f49bb9d - std::sys::unix::thread::Thread::new::thread_start::h545d31fdf79b3d9e
  47:     0x7fff73dff2eb - AssociationsManager::_map
  48:     0x7fff73e02249 - AssociationsManager::_map

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.0.212 (346aec9b0 2020-07-11)

query stack during panic:
end of query stack

Let me know if there's something else I can assist you with in figuring this out.

@flip1995 flip1995 added the I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ label Jul 17, 2020
@flip1995
Copy link
Member

flip1995 commented Jul 17, 2020

Can you give a minimal example or share the code base? Otherwise this is nearly impossible to debug.

@flip1995
Copy link
Member

Nvm, this was already fixed in #5784. I try to get this into nightly Clippy ASAP.

@flip1995 flip1995 mentioned this issue Jul 17, 2020
bors added a commit that referenced this issue Jul 17, 2020
Rustup

r? @ghost

Preparation for emergency Clippyup to fix an ICE #5816

changelog: none
bors added a commit that referenced this issue Jul 17, 2020
Rustup

r? @ghost

Preparation for emergency Clippyup to fix an ICE #5816

changelog: none
@flip1995
Copy link
Member

I just noticed, that this fix is already in the current nightly. So updating your toolchain should solve this problem.

@yan-zaretskiy
Copy link
Author

rustup update skips a bunch of nightly versions, could explain why I still see the issue...

@flip1995
Copy link
Member

That's because rustfmt is currently missing in nightly. If you don't need rustfmt, you can rustup component remove rustfmt --toolchain=nightly and then rustup update.

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

2 participants