Skip to content

Code action breaks when using git dependency #6179

@beemdvp

Description

@beemdvp

Hi all,
For context, im using coc-rust-analyzer and im unsure if this is a coc issue or not. I've raised the issue here on the library as well: fannheyward/coc-rust-analyzer#405

Lets say im using an unreleased crate using master branch

lambda_http = { git = "https://github.com/awslabs/aws-lambda-rust-runtime.git", branch = "master" }

This completely breaks coc-action with the following log:

2020-10-06T22:54:29.528 ERROR (pid:110118) [attach] - Notification error: codeAction [ '' ] ResponseError: canceled by client
    at handleResponse (/home/beem/.vim/plugged/coc.nvim/build/index.js:17144:48)
    at processMessageQueue (/home/beem/.vim/plugged/coc.nvim/build/index.js:16971:17)
    at Immediate.<anonymous> (/home/beem/.vim/plugged/coc.nvim/build/index.js:16955:13)
    at processImmediate (internal/timers.js:456:21) {
  code: -32800,
  data: undefined
}

This problem goes away when I use a published crate for lambda_http

Found logs using CocInfo

request: textDocument/codeAction CodeActionParams {
    text_document: TextDocumentIdentifier {
        uri: "file:///home/beem/Projects/lambda/rust-lambda/src/main.rs",
    },
    range: Range {
        start: Position {
            line: 12,
            character: 74,
        },
        end: Position {
            line: 12,
            character: 75,
        },
    },
    context: CodeActionContext {
        diagnostics: [
            Diagnostic {
                range: Range {
                    start: Position {
                        line: 12,
                        character: 74,
                    },
                    end: Position {
                        line: 12,
                        character: 84,
                    },
                },
                severity: Some(
                    Warning,
                ),
                code: Some(
                    String(
                        "unused_imports",
                    ),
                ),
                source: Some(
                    "rustc",
                ),
                message: "unused import: `ScanOutput`\n`#[warn(unused_imports)]` on by default",
                related_information: None,
                tags: Some(
                    [
                        Unnecessary,
                    ],
                ),
            },
        ],
        only: None,
    },
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
}

thread '<unnamed>' panicked at 'not implemented', /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libstd/macros.rs:13:23
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/git.colasdn.top-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/git.colasdn.top-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1076
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1537
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{
{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:217
  10: std::thread::local::LocalKey<T>::with
  11: stdx::panic_context::PanicContext::init::{{closure}}
  12: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:530

  13: std::panicking::begin_panic
  14: chalk_solve::clauses::push_auto_trait_impls
  15: chalk_solve::clauses::builder::ClauseBuilder<I>::push_binders
  16: chalk_solve::clauses::program_clauses_that_could_match
  17: chalk_solve::clauses::program_clauses_for_goal
  18: <chalk_recursive::recursive::Solver<I> as chalk_recursive::solve::SolveDatabase<I>>::solve_goal
  19: chalk_recursive::fulfill::Fulfill<I,Solver,Infer>::prove
  20: chalk_recursive::fulfill::Fulfill<I,Solver,Infer>::solve
  21: <chalk_recursive::recursive::Solver<I> as chalk_recursive::solve::SolveDatabase<I>>::solve_goal
  22: <chalk_recursive::recursive::RecursiveSolver<I> as chalk_solve::solve::Solver<I>>::solve_limited
  23: hir_ty::traits::
trait_solve_query
  24: salsa::runtime::Runtime::execute_query_implementation
  25: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  26: salsa::derived::slot::Slot<Q,MP>::read
  27: <salsa::
derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  28: salsa::QueryTable<Q>::get
  29: <DB as hir_ty::db::HirDatabase>::trait_solve::__shim
  30: <DB as hir_ty::db::HirDatabase>::trait_solve
  31: hir_ty::infer::InferenceContext::resolve_ty_as_possible
  32: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  33: hir_ty
::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  34: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  35: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  36: hir_ty::infer::
expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  37: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::check_call_arguments
  38: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  39
: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  40: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::check_call_arguments
  41: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  42: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  43: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  44: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr
  45: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  46: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  47: hir_ty::infer::infer_query
  48: salsa::runtime::Runtime::execute_query_implementation
  49: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  50: salsa::derived::slot::Slot<Q,MP>::read
  51: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::
try_fetch
  52: <DB as hir_ty::db::HirDatabase>::infer_query::__shim
  53: hir_ty::db::infer_wait
  54: hir_ty::diagnostics::validate_body
  55: hir::code_model::Module::diagnostics
  56: ide::diagnostics::diagnostics
  57: ide::Analysis::diagnostics
  58: rust_analyzer::handlers::handle_code_action
  59: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions