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 running clippy master on rustc master while checking libcore #6302

Closed
matthiaskrgr opened this issue Nov 6, 2020 · 0 comments · Fixed by #6304
Closed

ICE running clippy master on rustc master while checking libcore #6302

matthiaskrgr opened this issue Nov 6, 2020 · 0 comments · Fixed by #6304
Assignees
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Nov 6, 2020

When running clippy from the master toolchain of dc06a36 on the rustc repo dc06a36 as part of "./x.py clippy"

rustup-toolchain-install-master -n master  -f  -c rustc-dev llvm-tools rust-src clippy
rustup default master
./x.py clippy

clippy crashes:

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/tools/clippy/clippy_lints/src/methods/mod.rs:3904:68
stack backtrace:
   0:     0x7f1ee71d5a50 - std::backtrace_rs::backtrace::libunwind::trace::h448c56741b6011d3
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/std/src/../../backtrace/src/backtrace/libunwind.rs:100:5
   1:     0x7f1ee71d5a50 - std::backtrace_rs::backtrace::trace_unsynchronized::h2d26397c5720fdbb
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f1ee71d5a50 - std::sys_common::backtrace::_print_fmt::h720a2f61f75b9f58
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f1ee71d5a50 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8d62bbfda6d5c836
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7f1ee724594c - core::fmt::write::h1857a60b204f1b6a
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/core/src/fmt/mod.rs:1078:17
   5:     0x7f1ee71c76b2 - std::io::Write::write_fmt::h16a9fe7680ac245c
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/std/src/io/mod.rs:1518:15
   6:     0x7f1ee71daa05 - std::sys_common::backtrace::_print::h9ba51a6db618de7d
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7f1ee71daa05 - std::sys_common::backtrace::print::h5f20e41c85e91716
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7f1ee71daa05 - std::panicking::default_hook::{{closure}}::h5b7294ca19e8edab
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/std/src/panicking.rs:208:50
   9:     0x7f1ee71da6a8 - std::panicking::default_hook::hb3948d1f74b6ff4c
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/std/src/panicking.rs:227:9
  10:     0x55f6887c7047 - clippy_driver::ICE_HOOK::{{closure}}::{{closure}}::h122956879ca6eec9
  11:     0x7f1ee71db306 - std::panicking::rust_panic_with_hook::h55d23fef0ad751bc
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/std/src/panicking.rs:597:17
  12:     0x7f1ee71dadf7 - std::panicking::begin_panic_handler::{{closure}}::h56ae74c6dea6e141
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/std/src/panicking.rs:497:13
  13:     0x7f1ee71d5eec - std::sys_common::backtrace::__rust_end_short_backtrace::h3c4721f56689fae4
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/std/src/sys_common/backtrace.rs:141:18
  14:     0x7f1ee71dad89 - rust_begin_unwind
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/std/src/panicking.rs:495:5
  15:     0x7f1ee7241d01 - core::panicking::panic_fmt::hb15d6f55e8472f62
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/core/src/panicking.rs:92:14
  16:     0x7f1ee7241c4d - core::panicking::panic::h5d1c61fed2502a5f
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/core/src/panicking.rs:50:5
  17:     0x55f688ac79cf - <clippy_lints::methods::Methods as rustc_lint::passes::LateLintPass>::check_expr::h99d74553241d2575
  18:     0x7f1ee9d88b73 - <rustc_lint::late::LateLintPassObjects as rustc_lint::passes::LateLintPass>::check_expr::he3144499b1dcd448
  19:     0x7f1ee7cad6b2 - <rustc_lint::late::LateContextAndPass<T> as rustc_hir::intravisit::Visitor>::visit_expr::h0a6dd4669b4f10f8
  20:     0x7f1ee7c1f616 - rustc_hir::intravisit::walk_expr::heb5bc03511c2a4bc
  21:     0x7f1ee7cad6bd - <rustc_lint::late::LateContextAndPass<T> as rustc_hir::intravisit::Visitor>::visit_expr::h0a6dd4669b4f10f8
  22:     0x7f1ee7cae35b - <rustc_lint::late::LateContextAndPass<T> as rustc_hir::intravisit::Visitor>::visit_nested_body::h946d9211bc0824c0
  23:     0x7f1ee7caef1f - <rustc_lint::late::LateContextAndPass<T> as rustc_hir::intravisit::Visitor>::visit_fn::h7cd97ce0ae5ba7ad
  24:     0x7f1ee7c1b981 - rustc_hir::intravisit::walk_trait_item::hcd65d9e8f7096ba1
  25:     0x7f1ee7cb9487 - rustc_hir::intravisit::Visitor::visit_nested_trait_item::h31a41a6f15437e64
  26:     0x7f1ee7c20e0f - rustc_hir::intravisit::walk_item::h57f578932ecee482
  27:     0x7f1ee7cb8257 - rustc_hir::intravisit::Visitor::visit_nested_item::h2d55836cfb6db2fa
  28:     0x7f1ee7c208bd - rustc_hir::intravisit::walk_item::h57f578932ecee482
  29:     0x7f1ee7cb8257 - rustc_hir::intravisit::Visitor::visit_nested_item::h2d55836cfb6db2fa
  30:     0x7f1ee7c208bd - rustc_hir::intravisit::walk_item::h57f578932ecee482
  31:     0x7f1ee7cb8257 - rustc_hir::intravisit::Visitor::visit_nested_item::h2d55836cfb6db2fa
  32:     0x7f1ee7c208bd - rustc_hir::intravisit::walk_item::h57f578932ecee482
  33:     0x7f1ee7cb8257 - rustc_hir::intravisit::Visitor::visit_nested_item::h2d55836cfb6db2fa
  34:     0x7f1ee7c19d0e - rustc_hir::intravisit::walk_crate::h3d0e00d2d4ed5f04
  35:     0x7f1ee7c95dec - rustc_lint::late::late_lint_pass_crate::h67d5347e9d57d45f
  36:     0x7f1ee7ca0571 - rustc_session::utils::<impl rustc_session::session::Session>::time::ha3e6bfc654c22c80
  37:     0x7f1ee7cfc918 - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h8801e446040c7969
  38:     0x7f1ee7ca17c8 - rustc_session::utils::<impl rustc_session::session::Session>::time::hf99264d6a60ed711
  39:     0x7f1ee7cef930 - rustc_interface::passes::analysis::hb95cd6a24d9e58e8
  40:     0x7f1ee7aec662 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute::h57444fd30e6b9480
  41:     0x7f1ee7acae67 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h59648201bf333d56
  42:     0x7f1ee7aced50 - rustc_data_structures::stack::ensure_sufficient_stack::haaef65f4d139b2eb
  43:     0x7f1ee7a5c300 - rustc_query_system::query::plumbing::get_query_impl::h575b7d195440d3f8
  44:     0x7f1ee7aef77f - rustc_interface::passes::QueryContext::enter::h00e32ffb9191862b
  45:     0x7f1ee7ac87ae - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::he64904fbdfb4cee6
  46:     0x7f1ee7ab697e - rustc_span::with_source_map::hd76fd45eb14de398
  47:     0x7f1ee7ac95c2 - rustc_interface::interface::create_compiler_and_run::h317a7634b2ab920f
  48:     0x7f1ee7ab755a - rustc_span::with_session_globals::h3150758f701c91e1
  49:     0x7f1ee7acf361 - std::sys_common::backtrace::__rust_begin_short_backtrace::h4c60100569fb08e7
  50:     0x7f1ee7a367a8 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h14346b04353fa08b
  51:     0x7f1ee71ea30a - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9e7afb7a0a438236
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/alloc/src/boxed.rs:1307:9
  52:     0x7f1ee71ea30a - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h70c646c4271337a1
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/alloc/src/boxed.rs:1307:9
  53:     0x7f1ee71ea30a - std::sys::unix::thread::Thread::new::thread_start::h35d2b8d36f210d02
                               at /rustc/dc06a36074f04c6a77b5834f2950011d49607898/library/std/src/sys/unix/thread.rs:89:17
  54:     0x7f1ee70cb3e9 - start_thread
  55:     0x7f1ee6eb3293 - __GI___clone
  56:                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.0.212 (dc06a36 2020-11-06)

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
warning: 224 warnings emitted

error: could not compile `core`

To learn more, run the command again with --verbose.
command did not execute successfully: "/home/matthias/vcs/github/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "clippy" "--target" "x86_64-unknown-linux-gnu" "-Zunstable-options" "-Zbinary-dep-depinfo" "-j" "4" "--release" "--features" "panic-unwind backtrace profiler compiler-builtins-c" "--manifest-path" "/home/matthias/vcs/github/rust/library/test/Cargo.toml" "--message-format" "json-render-diagnostics" "--" "--cap-lints" "warn"
expected success, got: exit code: 101
failed to run: /home/matthias/vcs/github/rust/build/bootstrap/debug/bootstrap clippy
Build completed unsuccessfully in 0:00:23

let from_iter_id = get_trait_def_id(cx, &paths::FROM_ITERATOR).unwrap();

@matthiaskrgr matthiaskrgr added C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ labels Nov 6, 2020
@matthiaskrgr matthiaskrgr self-assigned this Nov 6, 2020
bors added a commit that referenced this issue Nov 7, 2020
FROM_ITER_INSTEAD_OF_COLLECT: avoid unwrapping unconditionally

Fixes #6302

changelog: fix unwrap of None when checking libcore with clippy
@bors bors closed this as completed in 5253595 Nov 7, 2020
Ryan1729 pushed a commit to Ryan1729/rust-clippy that referenced this issue Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant