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 "no entry found for key" on src/tools/clippy/clippy_dev/src/lib.rs #72911

Closed
matthiaskrgr opened this issue Jun 2, 2020 · 3 comments · Fixed by #74772
Closed

ICE "no entry found for key" on src/tools/clippy/clippy_dev/src/lib.rs #72911

matthiaskrgr opened this issue Jun 2, 2020 · 3 comments · Fixed by #74772
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. glacier ICE tracked in rust-lang/glacier. 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

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Jun 2, 2020

EDIT: code:

pub struct Lint {}

impl Lint {}

/// Gathers all files in `src/clippy_lints` and gathers all lints inside
pub fn gather_all() -> impl Iterator<Item = Lint> {
    lint_files().flat_map(|f| gather_from_file(&f))
}

fn gather_from_file(dir_entry: &walkdir::DirEntry) -> impl Iterator<Item = Lint> {
    unimplemented!()
}

/// Collects all .rs files in the `clippy_lints/src` directory
fn lint_files() -> impl Iterator<Item = walkdir::DirEntry> {
    unimplemented!()
}

pub fn main() {}

rustc repo @ 10c2316

build/x86_64-unknown-linux-gnu/stage2/bin/rustc ./src/tools/clippy/clippy_dev/src/lib.rs

ICEs:

thread 'rustc' panicked at 'no entry found for key', src/librustc_mir_build/build/mod.rs:340:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

rustc --version --verbose:

rustc 1.45.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.45.0-dev
LLVM version: 10.0

Error output

...
error[E0601]: `main` function not found in crate `lib`
   --> ./src/tools/clippy/clippy_dev/src/lib.rs:1:1
    |
1   | / #![cfg_attr(feature = "deny-warnings", deny(warnings))]
2   | |
3   | | use itertools::Itertools;
4   | | use lazy_static::lazy_static;
...   |
523 | |     assert_eq!(expected, gen_lint_group_list(lints.iter()));
524 | | }
    | |_^ consider adding a `main` function to `./src/tools/clippy/clippy_dev/src/lib.rs`

thread 'rustc' panicked at 'no entry found for key', src/librustc_mir_build/build/mod.rs:340:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.45.0-dev running on x86_64-unknown-linux-gnu

error: aborting due to 18 previous errors

Some errors have detailed explanations: E0425, E0432, E0433, E0601.
For more information about an error, try `rustc --explain E0425`.
Backtrace

error[E0432]: unresolved import `itertools`
 --> ./src/tools/clippy/clippy_dev/src/lib.rs:3:5
  |
3 | use itertools::Itertools;
  |     ^^^^^^^^^ maybe a missing crate `itertools`?

error[E0432]: unresolved import `lazy_static`
 --> ./src/tools/clippy/clippy_dev/src/lib.rs:4:5
  |
4 | use lazy_static::lazy_static;
  |     ^^^^^^^^^^^ maybe a missing crate `lazy_static`?

error[E0432]: unresolved import `regex`
 --> ./src/tools/clippy/clippy_dev/src/lib.rs:5:5
  |
5 | use regex::Regex;
  |     ^^^^^ maybe a missing crate `regex`?

error[E0432]: unresolved import `walkdir`
  --> ./src/tools/clippy/clippy_dev/src/lib.rs:10:5
   |
10 | use walkdir::WalkDir;
   |     ^^^^^^^ maybe a missing crate `walkdir`?

error[E0432]: unresolved import `shell_escape`
 --> ./src/tools/clippy/clippy_dev/src/fmt.rs:2:5
  |
2 | use shell_escape::escape;
  |     ^^^^^^^^^^^^ maybe a missing crate `shell_escape`?

error[E0432]: unresolved import `walkdir`
 --> ./src/tools/clippy/clippy_dev/src/fmt.rs:7:5
  |
7 | use walkdir::WalkDir;
  |     ^^^^^^^ maybe a missing crate `walkdir`?

error[E0432]: unresolved import `walkdir`
 --> ./src/tools/clippy/clippy_dev/src/stderr_length_check.rs:5:5
  |
5 | use walkdir::WalkDir;
  |     ^^^^^^^ maybe a missing crate `walkdir`?

error: cannot determine resolution for the macro `lazy_static`
  --> ./src/tools/clippy/clippy_dev/src/lib.rs:17:1
   |
17 | lazy_static! {
   | ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error[E0433]: failed to resolve: use of undeclared type or module `walkdir`
  --> ./src/tools/clippy/clippy_dev/src/fmt.rs:14:18
   |
14 |     WalkDirError(walkdir::Error),
   |                  ^^^^^^^ use of undeclared type or module `walkdir`

error[E0433]: failed to resolve: use of undeclared type or module `walkdir`
  --> ./src/tools/clippy/clippy_dev/src/fmt.rs:23:11
   |
23 | impl From<walkdir::Error> for CliError {
   |           ^^^^^^^ use of undeclared type or module `walkdir`

error[E0433]: failed to resolve: use of undeclared type or module `walkdir`
  --> ./src/tools/clippy/clippy_dev/src/fmt.rs:24:20
   |
24 |     fn from(error: walkdir::Error) -> Self {
   |                    ^^^^^^^ use of undeclared type or module `walkdir`

error[E0433]: failed to resolve: use of undeclared type or module `bytecount`
  --> ./src/tools/clippy/clippy_dev/src/stderr_length_check.rs:45:24
   |
45 |         Ok(content) => bytecount::count(&content, b'\n'),
   |                        ^^^^^^^^^ use of undeclared type or module `bytecount`

error[E0433]: failed to resolve: use of undeclared type or module `walkdir`
   --> ./src/tools/clippy/clippy_dev/src/lib.rs:160:33
    |
160 | fn gather_from_file(dir_entry: &walkdir::DirEntry) -> impl Iterator<Item = Lint> {
    |                                 ^^^^^^^ use of undeclared type or module `walkdir`

error[E0433]: failed to resolve: use of undeclared type or module `walkdir`
   --> ./src/tools/clippy/clippy_dev/src/lib.rs:195:41
    |
195 | fn lint_files() -> impl Iterator<Item = walkdir::DirEntry> {
    |                                         ^^^^^^^ use of undeclared type or module `walkdir`

error[E0425]: cannot find value `NL_ESCAPE_RE` in this scope
  --> ./src/tools/clippy/clippy_dev/src/lib.rs:58:19
   |
58 |             desc: NL_ESCAPE_RE.replace(&desc.replace("\\\"", "\""), "").to_string(),
   |                   ^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `DEC_CLIPPY_LINT_RE` in this scope
   --> ./src/tools/clippy/clippy_dev/src/lib.rs:184:17
    |
184 |     let lints = DEC_CLIPPY_LINT_RE
    |                 ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `DEC_DEPRECATED_LINT_RE` in this scope
   --> ./src/tools/clippy/clippy_dev/src/lib.rs:187:22
    |
187 |     let deprecated = DEC_DEPRECATED_LINT_RE
    |                      ^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0601]: `main` function not found in crate `lib`
   --> ./src/tools/clippy/clippy_dev/src/lib.rs:1:1
    |
1   | / #![cfg_attr(feature = "deny-warnings", deny(warnings))]
2   | |
3   | | use itertools::Itertools;
4   | | use lazy_static::lazy_static;
...   |
523 | |     assert_eq!(expected, gen_lint_group_list(lints.iter()));
524 | | }
    | |_^ consider adding a `main` function to `./src/tools/clippy/clippy_dev/src/lib.rs`

thread 'rustc' panicked at 'no entry found for key', src/librustc_mir_build/build/mod.rs:340:9
stack backtrace:
   0:     0x7f5650e2bef7 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h6129db55f2395b00
   1:     0x7f5650e788cd - core::fmt::write::h65255e7874586eb2
   2:     0x7f5650dfcb95 - std::io::Write::write_fmt::hbf3ccd0f0d2c8616
   3:     0x7f5650e0fe70 - std::panicking::default_hook::{{closure}}::h74fe3c93ec09b89c
   4:     0x7f5650e0fbba - std::panicking::default_hook::h18ec94680373bfcc
   5:     0x7f56527d1293 - rustc_driver::report_ice::h4fc186d9ba1d4385
   6:     0x7f5650e1055c - std::panicking::rust_panic_with_hook::hb1014dbead89930a
   7:     0x7f5650e1012b - rust_begin_unwind
   8:     0x7f5650e76671 - core::panicking::panic_fmt::h95ae6ee01add471a
   9:     0x7f5650e68a63 - core::option::expect_failed::h093d0a97ca73f248
  10:     0x7f5654d98fcf - rustc_mir_build::build::expr::as_place::<impl rustc_mir_build::build::Builder>::expr_as_place::h1c13398a7c87d379
  11:     0x7f5654d98f0f - rustc_mir_build::build::expr::as_place::<impl rustc_mir_build::build::Builder>::expr_as_place::h1c13398a7c87d379
  12:     0x7f5654da4f74 - rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr::hdb98c6605086577d
  13:     0x7f5654d9eafa - rustc_mir_build::build::expr::as_temp::<impl rustc_mir_build::build::Builder>::expr_as_temp::h06b8826d9bb0b73a
  14:     0x7f5654de411e - rustc_data_structures::stack::ensure_sufficient_stack::h5cecd1edc75b06c3
  15:     0x7f5654d9716f - rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::expr_as_operand::h7d81bbfbfe6dab9d
  16:     0x7f5654d96b58 - rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::as_call_operand::ha7613a30d4bd8f78
  17:     0x7f5654d96d8f - rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::as_call_operand::ha7613a30d4bd8f78
  18:     0x7f5654e0a8c3 - <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold::he6121e23ad6d330b
  19:     0x7f5654da2a18 - rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr::hdb98c6605086577d
  20:     0x7f5654da49f2 - rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr::hdb98c6605086577d
  21:     0x7f5654da49f2 - rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr::hdb98c6605086577d
  22:     0x7f5654d9065a - rustc_mir_build::build::construct_fn::h4095ecf25b6b8d0d
  23:     0x7f5654e10e89 - rustc_middle::ty::context::GlobalCtxt::enter_local::h156c1764260fb589
  24:     0x7f5654d8f156 - rustc_mir_build::build::mir_built::ha0819662bbdd92fb
  25:     0x7f56552e2302 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_built>::compute::h95d3b3ed1092ac52
  26:     0x7f5655265139 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h9fb57a387dba9a52
  27:     0x7f56551f1ee1 - rustc_query_system::query::plumbing::get_query_impl::{{closure}}::hc22802c48d4c6850
  28:     0x7f565517fa20 - rustc_query_system::query::plumbing::get_query_impl::hbfa9c70bab87273c
  29:     0x7f5655331275 - rustc_mir::transform::check_unsafety::unsafety_check_result::h3331fda2807e32e1
  30:     0x7f56552e32c2 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::unsafety_check_result>::compute::h75615250617048ba
  31:     0x7f565525dd39 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h43cac2b3b58c6bc1
  32:     0x7f56551a5f4f - rustc_query_system::query::plumbing::get_query_impl::{{closure}}::h419735eb7309d02d
  33:     0x7f565517e310 - rustc_query_system::query::plumbing::get_query_impl::h98110b1fac1f500e
  34:     0x7f565532fb0b - <rustc_mir::transform::check_unsafety::UnsafetyChecker as rustc_middle::mir::visit::Visitor>::visit_rvalue::hb23036c23810dc29
  35:     0x7f565533159f - rustc_mir::transform::check_unsafety::unsafety_check_result::h3331fda2807e32e1
  36:     0x7f56552e32c2 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::unsafety_check_result>::compute::h75615250617048ba
  37:     0x7f565525dd39 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h43cac2b3b58c6bc1
  38:     0x7f56551a5f4f - rustc_query_system::query::plumbing::get_query_impl::{{closure}}::h419735eb7309d02d
  39:     0x7f565517e310 - rustc_query_system::query::plumbing::get_query_impl::h98110b1fac1f500e
  40:     0x7f565533f9ea - rustc_mir::transform::mir_const::h6e06810c86a8460a
  41:     0x7f56552e23de - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_const>::compute::h0d0160a62726735c
  42:     0x7f5655265ba7 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::ha1d4ce085efc652e
  43:     0x7f56551ca8df - rustc_query_system::query::plumbing::get_query_impl::{{closure}}::h8362a188b17ba5a1
  44:     0x7f565517f0cb - rustc_query_system::query::plumbing::get_query_impl::hb43871b4e989ce46
  45:     0x7f565533fcd1 - rustc_mir::transform::mir_validated::h906caf79da4cfc9a
  46:     0x7f5654eeaa32 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_validated>::compute::ha9dc333bb2d43e1a
  47:     0x7f5655265669 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::ha1863a2de5fd299c
  48:     0x7f56552097c1 - rustc_query_system::query::plumbing::get_query_impl::{{closure}}::heb30eaeac460f90a
  49:     0x7f565517e960 - rustc_query_system::query::plumbing::get_query_impl::ha7836b453883e5fb
  50:     0x7f5654f25c8d - rustc_mir::borrow_check::mir_borrowck::h327d3f62f8487e32
  51:     0x7f5654753642 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_borrowck>::compute::h6adcbf363fd6f6ec
  52:     0x7f56548ef5c9 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h43eb278673f13fb4
  53:     0x7f56548046fb - rustc_data_structures::stack::ensure_sufficient_stack::h20178a162de014f1
  54:     0x7f565485eece - rustc_query_system::query::plumbing::get_query_impl::h336805c45b098bf6
  55:     0x7f565476652a - rustc_typeck::collect::type_of::type_of::hd67b523a83d167d4
  56:     0x7f56562a0a43 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hd3a593fa23604af1
  57:     0x7f56563f36b8 - rustc_data_structures::stack::ensure_sufficient_stack::h013c8b9fd7c45dc0
  58:     0x7f56563139d9 - rustc_query_system::query::plumbing::get_query_impl::h7789acbbd63c5d69
  59:     0x7f565667ebed - rustc_middle::ty::util::<impl rustc_middle::ty::context::TyCtxt>::try_expand_impl_trait_type::OpaqueTypeExpander::expand_opaque_ty::h7c4a8469aa7aa6f4
  60:     0x7f56564633e0 - rustc_middle::ty::util::<impl rustc_middle::ty::context::TyCtxt>::try_expand_impl_trait_type::h97a1eeb862d1db52
  61:     0x7f5654737df2 - rustc_typeck::check::check_item_type::h293dacbceceadd90
  62:     0x7f56547dd4eb - rustc_middle::hir::map::Map::visit_item_likes_in_module::h5ae6e59b2da54bd6
  63:     0x7f56547339dd - rustc_typeck::check::check_mod_item_types::h871753fb3a38ea84
  64:     0x7f565495f042 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_mod_item_types>::compute::h2c337a7156ab21be
  65:     0x7f56548f55b4 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hbdcdac35be0adca2
  66:     0x7f5654817c46 - rustc_data_structures::stack::ensure_sufficient_stack::hb39336b2d0696419
  67:     0x7f56548a16f8 - rustc_query_system::query::plumbing::get_query_impl::hf855eb642440f0c7
  68:     0x7f56548a8a57 - rustc_query_system::query::plumbing::ensure_query_impl::h8dbfe8b2fa22fd6f
  69:     0x7f56549622f7 - rustc_session::utils::<impl rustc_session::session::Session>::time::h0ae987c003b08a5d
  70:     0x7f5654946289 - rustc_typeck::check_crate::ha36b17f26d6316a9
  71:     0x7f5652975842 - rustc_interface::passes::analysis::hf91078b01ea2824a
  72:     0x7f56527a285b - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute::hc01390c48a09dbe3
  73:     0x7f5652827c67 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h3d733212d18f580a
  74:     0x7f5652835479 - rustc_query_system::query::plumbing::get_query_impl::hd41a95c8caea7b20
  75:     0x7f56527a3044 - rustc_middle::ty::context::tls::enter_global::hbe6e6cb9121674a9
  76:     0x7f56527a56d4 - rustc_interface::interface::run_compiler_in_existing_thread_pool::he10d9dfcb60e9bff
  77:     0x7f56527e2460 - rustc_ast::attr::with_globals::h1df959b8a9a2dc54
  78:     0x7f56527e4138 - std::sys_common::backtrace::__rust_begin_short_backtrace::h1fd3c02dac5c3d0e
  79:     0x7f565279422e - core::ops::function::FnOnce::call_once{{vtable.shim}}::h17f6d80818e9b275
  80:     0x7f5650e10cea - std::sys::unix::thread::Thread::new::thread_start::h00452227f2552ee2
  81:     0x7f5650b37422 - start_thread
  82:     0x7f5650c55bf3 - __GI___clone
  83:                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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.45.0-dev running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [mir_built] building MIR for `gather_all::{{closure}}#0`
#1 [unsafety_check_result] unsafety-checking `gather_all::{{closure}}#0`
#2 [unsafety_check_result] unsafety-checking `gather_all`
#3 [mir_const] processing MIR for `gather_all`
#4 [mir_validated] processing `gather_all`
#5 [mir_borrowck] borrow-checking `gather_all`
#6 [type_of] computing type of `gather_all::{{opaque}}#0`
#7 [check_mod_item_types] checking item types in top-level module
#8 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 18 previous errors

Some errors have detailed explanations: E0425, E0432, E0433, E0601.
For more information about an error, try `rustc --explain E0425`.

@matthiaskrgr matthiaskrgr 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 Jun 2, 2020
@matthiaskrgr
Copy link
Member Author

Also happens with nightly

rustc 1.45.0-nightly (ad4bc3323 2020-06-01)
binary: rustc
commit-hash: ad4bc3323b9299d867697e9653dcea1b5e1ad283
commit-date: 2020-06-01
host: x86_64-unknown-linux-gnu
release: 1.45.0-nightly
LLVM version: 10.0

@matthiaskrgr
Copy link
Member Author

reduced:

pub struct Lint {}

impl Lint {}

/// Gathers all files in `src/clippy_lints` and gathers all lints inside
pub fn gather_all() -> impl Iterator<Item = Lint> {
    lint_files().flat_map(|f| gather_from_file(&f))
}

fn gather_from_file(dir_entry: &walkdir::DirEntry) -> impl Iterator<Item = Lint> {
    unimplemented!()
}

/// Collects all .rs files in the `clippy_lints/src` directory
fn lint_files() -> impl Iterator<Item = walkdir::DirEntry> {
    unimplemented!()
}

pub fn main() {}

there are errors but it still reproduces the ice.

@JohnTitor
Copy link
Member

The ICE no longer occurs with the latest nightly, marking as E-needs-test.

@JohnTitor JohnTitor added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Jul 25, 2020
@bors bors closed this as completed in 6239296 Jul 26, 2020
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. glacier ICE tracked in rust-lang/glacier. 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

Successfully merging a pull request may close this issue.

3 participants