Skip to content

ICE: compiler/rustc_typeck/src/check/callee.rs:591:17: failed to find an overloaded call trait for closure call #86238

Closed
@Cancelll

Description

@Cancelll

Code

#![no_core]
fn main() {
    let one = || {};
    one()
}
#[lang = "sized"]
trait Sized {}
#[lang = "copy"]
trait Copy {}

Meta

rustc --version --verbose:

rustc 1.54.0-nightly (0a8629bff 2021-06-11)
binary: rustc
commit-hash: 0a8629bff642c3c3b84bb644c0099194f063b627
commit-date: 2021-06-11
host: x86_64-unknown-linux-gnu
release: 1.54.0-nightly
LLVM version: 12.0.1

Error output

error[E0658]: language items are subject to change
 --> mutant.rs:6:1
  |
6 | #[lang = "sized"]
  | ^^^^^^^^^^^^^^^^^
  |
  = help: add `#![feature(lang_items)]` to the crate attributes to enable

error[E0658]: language items are subject to change
 --> mutant.rs:8:1
  |
8 | #[lang = "copy"]
  | ^^^^^^^^^^^^^^^^
  |
  = help: add `#![feature(lang_items)]` to the crate attributes to enable

error[E0658]: the `#[no_core]` attribute is an experimental feature
 --> mutant.rs:1:1
  |
1 | #![no_core]
  | ^^^^^^^^^^^
  |
  = note: see issue #29639 <https://github.com/rust-lang/rust/issues/29639> for more information
  = help: add `#![feature(no_core)]` to the crate attributes to enable

error: internal compiler error: compiler/rustc_typeck/src/check/callee.rs:591:17: failed to find an overloaded call trait for closure call
 --> mutant.rs:4:5
  |
4 |     one()
  |     ^^^^^

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/0a8629bff642c3c3b84bb644c0099194f063b627/compiler/rustc_errors/src/lib.rs:953: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.54.0-nightly (0a8629bff 2021-06-11) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z mir-opt-level=3 -Z new-llvm-pass-manager=yes -Z unsound-mir-opts=yes -Z polonius=yes -Z polymorphize=yes -C debuginfo=2 -C opt-level=3 --crate-type staticlib

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

For more information about this error, try `rustc --explain E0658`.
Backtrace

error[E0658]: language items are subject to change
 --> mutant.rs:6:1
  |
6 | #[lang = "sized"]
  | ^^^^^^^^^^^^^^^^^
  |
  = help: add `#![feature(lang_items)]` to the crate attributes to enable

error[E0658]: language items are subject to change
 --> mutant.rs:8:1
  |
8 | #[lang = "copy"]
  | ^^^^^^^^^^^^^^^^
  |
  = help: add `#![feature(lang_items)]` to the crate attributes to enable

error[E0658]: the `#[no_core]` attribute is an experimental feature
 --> mutant.rs:1:1
  |
1 | #![no_core]
  | ^^^^^^^^^^^
  |
  = note: see issue #29639 <https://github.com/rust-lang/rust/issues/29639> for more information
  = help: add `#![feature(no_core)]` to the crate attributes to enable

error: internal compiler error: compiler/rustc_typeck/src/check/callee.rs:591:17: failed to find an overloaded call trait for closure call
 --> mutant.rs:4:5
  |
4 |     one()
  |     ^^^^^

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/0a8629bff642c3c3b84bb644c0099194f063b627/compiler/rustc_errors/src/lib.rs:953:9
stack backtrace:
   0: std::panicking::begin_panic
   1: std::panic::panic_any
   2: rustc_errors::HandlerInner::span_bug
   3: rustc_errors::Handler::span_bug
   4: rustc_middle::ty::context::tls::with_opt
   5: rustc_middle::util::bug::opt_span_bug_fmt
   6: rustc_middle::util::bug::span_bug_fmt
   7: rustc_typeck::check::callee::DeferredCallResolution::resolve
   8: rustc_typeck::check::upvar::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::analyze_closure
   9: <rustc_typeck::check::upvar::InferBorrowKindVisitor as rustc_hir::intravisit::Visitor>::visit_expr
  10: rustc_hir::intravisit::walk_stmt
  11: rustc_hir::intravisit::walk_expr
  12: <rustc_typeck::check::upvar::InferBorrowKindVisitor as rustc_hir::intravisit::Visitor>::visit_expr
  13: rustc_typeck::check::upvar::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::closure_analyze
  14: rustc_typeck::check::inherited::InheritedBuilder::enter
  15: rustc_typeck::check::typeck
  16: rustc_query_system::query::plumbing::get_query_impl
  17: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
  18: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::par_body_owners
  19: rustc_typeck::check::typeck_item_bodies
  20: rustc_query_system::query::plumbing::get_query_impl
  21: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
  22: rustc_session::utils::<impl rustc_session::session::Session>::time
  23: rustc_typeck::check_crate
  24: rustc_interface::passes::analysis
  25: rustc_query_system::query::plumbing::get_query_impl
  26: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  27: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  28: rustc_span::with_source_map
  29: rustc_interface::interface::create_compiler_and_run
  30: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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.54.0-nightly (0a8629bff 2021-06-11) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z mir-opt-level=3 -Z new-llvm-pass-manager=yes -Z unsound-mir-opts=yes -Z polonius=yes -Z polymorphize=yes -C debuginfo=2 -C opt-level=3 --crate-type staticlib

query stack during panic:
#0 [typeck] type-checking `main`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0658`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions