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: thread 'rustc' panicked at 'internal error: entered unreachable code', src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:379:17 #7126

Closed
toku-sa-n opened this issue Apr 25, 2021 · 0 comments · Fixed by #7128
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@toku-sa-n
Copy link

Code

#![feature(const_btree_new)]

use std::collections::BTreeMap;

struct Foo(BTreeMap<i32, i32>);
impl Foo {
    fn new() -> Self {
        Self(BTreeMap::new())
    }
}

Meta

  • cargo clippy -V:
    clippy 0.1.53 (42816d6 2021-04-24)
  • rustc -Vv:
rustc 1.53.0-nightly (42816d61e 2021-04-24)
binary: rustc
commit-hash: 42816d61ead7e46d462df997958ccfd514f8c21c
commit-date: 2021-04-24
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0

Error output

    Checking foo v0.1.0 (/tmp/tmp.Pk5eOrniDd/foo)
warning: struct is never constructed: `Foo`
 --> src/lib.rs:5:8
  |
5 | struct Foo(BTreeMap<i32, i32>);
  |        ^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: associated function is never used: `new`
 --> src/lib.rs:7:8
  |
7 |     fn new() -> Self {
  |        ^^^

thread 'rustc' panicked at 'internal error: entered unreachable code', src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:379:17
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-clippy/issues/new

note: Clippy version: clippy 0.1.53 (42816d6 2021-04-24)

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

error: could not compile `foo`

To learn more, run the command again with --verbose.

Backtrace

  Checking foo v0.1.0 (/tmp/tmp.Pk5eOrniDd/foo)
warning: struct is never constructed: `Foo`
--> src/lib.rs:5:8
|
5 | struct Foo(BTreeMap<i32, i32>);
|        ^^^
|
= note: `#[warn(dead_code)]` on by default

warning: associated function is never used: `new`
--> src/lib.rs:7:8
|
7 |     fn new() -> Self {
|        ^^^

thread 'rustc' panicked at 'internal error: entered unreachable code', src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:379:17
stack backtrace:
 0: rust_begin_unwind
           at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c/library/std/src/panicking.rs:493:5
 1: core::panicking::panic_fmt
           at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c/library/core/src/panicking.rs:92:14
 2: core::panicking::panic
           at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c/library/core/src/panicking.rs:50:5
 3: clippy_utils::qualify_min_const_fn::is_min_const_fn
 4: <clippy_lints::missing_const_for_fn::MissingConstForFn as rustc_lint::passes::LateLintPass>::check_fn
 5: <rustc_lint::late::LateLintPassObjects as rustc_lint::passes::LateLintPass>::check_fn
 6: <rustc_lint::late::LateContextAndPass<T> as rustc_hir::intravisit::Visitor>::visit_fn
 7: rustc_hir::intravisit::walk_impl_item
 8: rustc_hir::intravisit::Visitor::visit_nested_impl_item
 9: rustc_hir::intravisit::walk_impl_item_ref
10: rustc_hir::intravisit::walk_item
11: rustc_hir::intravisit::Visitor::visit_nested_item
12: rustc_hir::intravisit::walk_mod
13: <rustc_lint::late::LateContextAndPass<T> as rustc_hir::intravisit::Visitor>::visit_mod
14: rustc_hir::intravisit::walk_crate
15: rustc_lint::late::late_lint_pass_crate
16: rustc_lint::late::late_lint_crate
17: rustc_session::utils::<impl rustc_session::session::Session>::time
18: std::panic::catch_unwind
19: rustc_session::utils::<impl rustc_session::session::Session>::time
20: rustc_interface::passes::analysis
21: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
22: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
23: rustc_data_structures::stack::ensure_sufficient_stack
24: rustc_query_system::query::plumbing::force_query_with_job
25: rustc_query_system::query::plumbing::get_query_impl
26: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
27: rustc_interface::passes::QueryContext::enter
28: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
29: rustc_span::with_source_map
30: rustc_interface::interface::create_compiler_and_run
31: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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-clippy/issues/new

note: Clippy version: clippy 0.1.53 (42816d6 2021-04-24)

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

error: could not compile `foo`

To learn more, run the command again with --verbose.

@toku-sa-n toku-sa-n added C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ labels Apr 25, 2021
@bors bors closed this as completed in 7c7683c Apr 27, 2021
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