Skip to content

Chalk: panicked at 'not implemented' #6134

@cynecx

Description

@cynecx
use std::thread::spawn;
fn it_works() {
    let x = spawn(|x| {});
}

The thread closure doesn't take any arguments, so this is code that doesn't type check, however rust-analyzer/chalk shouldn't panic in this case.

thread '<unnamed>' panicked at 'not implemented', /home/cynecx/dev/chalk/chalk-solve/src/clauses.rs:60:40
stack backtrace:
   0: std::panicking::begin_panic
   1: chalk_solve::clauses::push_auto_trait_impls
   2: chalk_solve::clauses::builder::ClauseBuilder<I>::push_binders
   3: chalk_solve::clauses::program_clauses_for_goal
   4: chalk_recursive::recursive::Solver<I>::solve_new_subgoal
   5: <chalk_recursive::recursive::Solver<I> as chalk_recursive::solve::SolveDatabase<I>>::solve_goal
   6: <chalk_recursive::recursive::RecursiveSolver<I> as chalk_solve::solve::Solver<I>>::solve_limited
   7: hir_ty::traits::trait_solve_query
   8: salsa::runtime::Runtime::execute_query_implementation
   9: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  10: salsa::derived::slot::Slot<Q,MP>::read
  11: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  12: <DB as hir_ty::db::HirDatabase>::trait_solve::__shim
  13: <DB as hir_ty::db::HirDatabase>::trait_solve
  14: hir_ty::infer::InferenceContext::resolve_ty_as_possible
  15: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  16: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  17: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::check_call_arguments
  18: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  19: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  20: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  21: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  22: hir_ty::infer::infer_query
  23: salsa::runtime::Runtime::execute_query_implementation
  24: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  25: salsa::derived::slot::Slot<Q,MP>::read
  26: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  27: <DB as hir_ty::db::HirDatabase>::infer_query::__shim
  28: hir_ty::db::infer_wait
  29: hir_ty::diagnostics::validate_body
  30: hir::code_model::Module::diagnostics
  31: ide::diagnostics::diagnostics
  32: std::panicking::try
  33: ide::Analysis::diagnostics
  34: rust_analyzer::handlers::publish_diagnostics
  35: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
  36: <alloc::vec::Vec<T> as alloc::vec::SpecFromIter<T,I>>::from_iter
  37: <F as threadpool::FnBox>::call_box

rust-analyzer: e5f252a

@flodiebold?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tytype system / type inference / traits / method resolution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions