Skip to content

ICE: compiler/rustc_typeck/src/check/check.rs:108:25: Item being checked wasn't a function/closure: #79688

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

Closed
chengniansun opened this issue Dec 4, 2020 · 1 comment
Labels
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.

Comments

@chengniansun
Copy link

Code

trait Tr {
    extern "rust-call" fn dm4() {}
}

Meta

rustc --version --verbose:

rustc 1.50.0-nightly (5be3f9f10 2020-12-03)
binary: rustc
commit-hash: 5be3f9f10e9fd59ea03816840a6051413fbdefae
commit-date: 2020-12-03
host: x86_64-unknown-linux-gnu
release: 1.50.0-nightly

Error output

error[E0658]: rust-call ABI is subject to change
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:12
  |
2 |     extern "rust-call" fn dm4() {}
  |            ^^^^^^^^^^^
  |
  = note: see issue #29625 <https://github.com/rust-lang/rust/issues/29625> for more information
  = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable

error[E0601]: `main` function not found in crate `perses_node_priority_with_dfs_delta_reduced_mutant`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | / trait Tr {
2 | |     extern "rust-call" fn dm4() {}
3 | | }
  | |_^ consider adding a `main` function to `perses_node_priority_with_dfs_delta_reduced_mutant.rs`

error: internal compiler error: compiler/rustc_typeck/src/check/check.rs:108:25: Item being checked wasn't a function/closure: TraitItem(TraitItem { ident: dm4#0, hir_id: HirId { owner: DefId(0:4 ~ perses_node_priority_with_dfs_delta_reduced_mutant[317d]::Tr::dm4), local_id: 0 }, attrs: [], generics: Generics { params: [], where_clause: WhereClause { predicates: [], span: perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:32: 2:32 (#0) }, span: perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:30: 2:30 (#0) }, kind: Fn(FnSig { header: FnHeader { unsafety: Normal, constness: NotConst, asyncness: NotAsync, abi: RustCall }, decl: FnDecl { inputs: [], output: DefaultReturn(perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:33: 2:33 (#0)), c_variadic: false, implicit_self: None }, span: perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:5: 2:32 (#0) }, Provided(BodyId { hir_id: HirId { owner: DefId(0:4 ~ perses_node_priority_with_dfs_delta_reduced_mutant[317d]::Tr::dm4), local_id: 2 } })), span: perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:5: 2:35 (#0) })

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:958:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.50.0-nightly (5be3f9f10 2020-12-03) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck] type-checking `Tr::dm4`
#1 [typeck_item_bodies] type-checking all item bodies
end of query stack
error: aborting due to 3 previous errors

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

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:958:9
stack backtrace:
   0: std::panicking::begin_panic
   1: rustc_errors::HandlerInner::bug
   2: rustc_errors::Handler::bug
   3: rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}
   4: rustc_middle::ty::context::tls::with_opt::{{closure}}
   5: rustc_middle::ty::context::tls::with_opt
   6: rustc_middle::util::bug::opt_span_bug_fmt
   7: rustc_middle::util::bug::bug_fmt
   8: rustc_typeck::check::check::check_fn
   9: rustc_infer::infer::InferCtxtBuilder::enter
  10: rustc_typeck::check::typeck
  11: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::typeck>::compute
  12: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
  13: rustc_data_structures::stack::ensure_sufficient_stack
  14: rustc_query_system::query::plumbing::get_query_impl
  15: rustc_query_system::query::plumbing::ensure_query_impl
  16: rustc_typeck::check::typeck_item_bodies
  17: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::typeck_item_bodies>::compute
  18: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
  19: rustc_data_structures::stack::ensure_sufficient_stack
  20: rustc_query_system::query::plumbing::get_query_impl
  21: rustc_typeck::check_crate
  22: rustc_interface::passes::analysis
  23: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  24: rustc_query_system::dep_graph::graph::DepGraph<K>::with_eval_always_task
  25: rustc_data_structures::stack::ensure_sufficient_stack
  26: rustc_query_system::query::plumbing::get_query_impl
  27: rustc_interface::passes::QueryContext::enter
  28: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  29: rustc_span::with_source_map
  30: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@chengniansun chengniansun 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 Dec 4, 2020
@camelid
Copy link
Member

camelid commented Dec 4, 2020

Duplicate of #79669.

@camelid camelid closed this as completed Dec 4, 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. 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

No branches or pull requests

2 participants