rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.29k stars 1.61k forks source link

VSCode extension stopped working #14915

Open alucryd opened 1 year ago

alucryd commented 1 year ago

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)

0.3.1524-standalone

rustc version: (eg. output of rustc -V)

1.69.0 (84c898d65 2023-04-16)

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)

No special settings, everything is default.

I've been using the extension for a long time, however it recently stopped working on all my machines. Completely resetting VSCode to factory and reinstalling the extension doesn't help. It is loaded and indexes the workspace correctly, but none of the IDE features are available, autocompletion, formatting, refactoring, nothing works.

Running VSCode 1.78.2 on Arch Linux.

lnicola commented 1 year ago

Does it work in another project? Do you have anything in the logs?

alucryd commented 1 year ago

Nothing in the logs unfortunately. But I think I found the issue, I have several rust projects in my workspace, it seems the extension is stuck the very first alphabetically, even when I'm working on a file from another one down the list. Deleting all projects but the current one restores functionnality.

lnicola commented 1 year ago

Does that one work if you open it by itself?

alucryd commented 1 year ago

Yes it does.

alucryd commented 1 year ago

Seems to be reproducible, if I try to add another project to the workspace, the second one doesn't work. It starts working only if I delete the first one.

blu-dev commented 1 year ago

Running into a similar issue, it doesn't appear to be the exact same as this one, or at least I cannot reproduce the alphabetical ordering thing locally.

Have tested on both latest stable and latest pre-release, as well as VS Code versions 1.78.0 and 1.78.2 on Ubuntu 22.04. My project is a workspace with 28 crates inside of it.

The output from the Rust Analyzer Language Server produces this every time I open a file:

rustc version: rustc 1.71.0-nightly (1a5f8bce7 2023-05-26)

Language Server Output ``` thread 'Worker' panicked at 'index out of bounds: the len is 0 but the index is 0', /github/home/.cargo/registry/src/github.com-1ecc6299db9ec823/chalk-ir-0.89.0/src/fold/subst.rs:55:19 stack backtrace: 0: rust_begin_unwind at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5 1: core::panicking::panic_fmt at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14 2: core::panicking::panic_bounds_check at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:159:5 3: as chalk_ir::fold::TypeFolder>::fold_free_var_ty 4: chalk_ir::fold::TypeSuperFoldable::super_fold_with 5: chalk_ir::fold::TypeSuperFoldable::super_fold_with 6: chalk_ir::fold::boring_impls:: for chalk_ir::GenericArg>::try_fold_with 7: as core::iter::traits::iterator::Iterator>::next 8: as core::iter::traits::collect::Extend<::Item>>::extend 9: chalk_ir::fold::boring_impls:: for chalk_ir::Substitution>::try_fold_with 10: chalk_ir::fold::TypeSuperFoldable::super_fold_with 11: chalk_ir::fold::boring_impls:: for chalk_ir::GenericArg>::try_fold_with 12: as core::iter::traits::iterator::Iterator>::next 13: as core::iter::traits::collect::Extend<::Item>>::extend 14: chalk_ir::fold::boring_impls:: for chalk_ir::Substitution>::try_fold_with 15: chalk_ir::_:: for chalk_ir::WhereClause>::try_fold_with 16: chalk_solve::infer::instantiate::>::instantiate_binders_universally 17: as chalk_ir::zip::Zipper>::zip_binders 18: as chalk_ir::zip::Zipper>::zip_binders 19: chalk_solve::infer::unify::Unifier::relate_ty_ty 20: as chalk_ir::zip::Zipper>::zip_tys 21: chalk_ir::zip::Zipper::zip_substs 22: chalk_solve::infer::unify::Unifier::relate_ty_ty 23: as chalk_ir::zip::Zipper>::zip_tys 24: chalk_solve::infer::unify::Unifier::relate_ty_ty 25: chalk_solve::infer::unify::Unifier::relate_var_ty 26: chalk_solve::infer::unify::Unifier::relate_ty_ty 27: as chalk_ir::zip::Zipper>::zip_tys 28: chalk_ir::zip::Zipper::zip_substs 29: chalk_ir::_:: for chalk_ir::WhereClause>::zip_with 30: chalk_ir::_:: for chalk_ir::DomainGoal>::zip_with 31: chalk_solve::infer::unify::Unifier::relate 32: chalk_recursive::fulfill::Fulfill::new_with_clause 33: chalk_recursive::solve::SolveIterationHelpers::solve_from_clauses 34: chalk_recursive::solve::SolveIteration::solve_iteration 35: chalk_recursive::fixed_point::RecursiveContext::solve_goal 36: chalk_recursive::fixed_point::RecursiveContext::solve_root_goal 37: hir_ty::traits::trait_solve_query 38: salsa::runtime::Runtime::execute_query_implementation 39: salsa::derived::slot::Slot::read_upgrade 40: salsa::derived::slot::Slot::read 41: as salsa::plumbing::QueryStorageOps>::try_fetch 42: salsa::QueryTable::get 43: ::trait_solve_query 44: hir_ty::db::trait_solve_wait 45: ::trait_solve 46: as hir_ty::chalk_ext::TyExt>::is_copy 47: hir_ty::mir::lower::MirLowerCtx::emit_drop_and_storage_dead_for_scope 48: hir_ty::mir::lower::MirLowerCtx::pop_drop_scope 49: hir_ty::mir::lower::MirLowerCtx::lower_loop 50: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 51: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_with_adjust 52: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place 53: hir_ty::mir::lower::MirLowerCtx::lower_block_to_place 54: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 55: hir_ty::mir::lower::as_place::::lower_expr_to_some_place_without_adjust 56: hir_ty::mir::lower::MirLowerCtx::lower_loop 57: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 58: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_with_adjust 59: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place 60: hir_ty::mir::lower::MirLowerCtx::lower_block_to_place 61: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 62: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_with_adjust 63: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place 64: hir_ty::mir::lower::mir_body_for_closure_query 65: salsa::runtime::Runtime::execute_query_implementation 66: salsa::derived::slot::Slot::read_upgrade 67: salsa::derived::slot::Slot::read 68: as salsa::plumbing::QueryStorageOps>::try_fetch 69: ::mir_body_for_closure::__shim 70: ::mir_body_for_closure 71: hir_ty::mir::borrowck::all_mir_bodies::for_closure 72: as core::iter::traits::iterator::Iterator>::next 73: as core::iter::traits::iterator::Iterator>::next 74: as core::iter::traits::iterator::Iterator>::next 75: as core::iter::traits::iterator::Iterator>::next 76: as core::iter::traits::iterator::Iterator>::try_fold 77: as alloc::vec::spec_from_iter::SpecFromIter>::from_iter 78: core::iter::adapters::try_process 79: hir_ty::mir::borrowck::borrowck_query 80: salsa::runtime::Runtime::execute_query_implementation 81: salsa::derived::slot::Slot::read_upgrade 82: salsa::derived::slot::Slot::read 83: as salsa::plumbing::QueryStorageOps>::try_fetch 84: ::borrowck::__shim 85: ::borrowck 86: hir::DefWithBody::diagnostics 87: hir::Module::diagnostics 88: ide_diagnostics::diagnostics 89: salsa::Cancelled::catch 90: ide::Analysis::diagnostics note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. ```

Here is the language server output from the beginning of my session (I started on one file and then opened another file):

Language Server Output ``` Panic context: > version: 0.4.1530-standalone request: textDocument/codeAction CodeActionParams { text_document: TextDocumentIdentifier { uri: Url { scheme: "file", cannot_be_a_base: false, username: "", password: None, host: None, port: None, path: "/home/blujay/dev/sentinels/crates/tooling/script-editor/src/attributes.rs", query: None, fragment: None, }, }, range: Range { start: Position { line: 0, character: 0, }, end: Position { line: 0, character: 0, }, }, context: CodeActionContext { diagnostics: [], only: None, trigger_kind: Some( Automatic, ), }, work_done_progress_params: WorkDoneProgressParams { work_done_token: None, }, partial_result_params: PartialResultParams { partial_result_token: None, }, } thread 'Worker' panicked at 'index out of bounds: the len is 0 but the index is 0', /github/home/.cargo/registry/src/github.com-1ecc6299db9ec823/chalk-ir-0.89.0/src/fold/subst.rs:55:19 stack backtrace: 0: rust_begin_unwind at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5 1: core::panicking::panic_fmt at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14 2: core::panicking::panic_bounds_check at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:159:5 3: as chalk_ir::fold::TypeFolder>::fold_free_var_ty 4: chalk_ir::fold::TypeSuperFoldable::super_fold_with 5: chalk_ir::fold::TypeSuperFoldable::super_fold_with 6: chalk_ir::fold::boring_impls:: for chalk_ir::GenericArg>::try_fold_with 7: as core::iter::traits::iterator::Iterator>::next 8: as core::iter::traits::collect::Extend<::Item>>::extend 9: chalk_ir::fold::boring_impls:: for chalk_ir::Substitution>::try_fold_with 10: chalk_ir::fold::TypeSuperFoldable::super_fold_with 11: chalk_ir::fold::boring_impls:: for chalk_ir::GenericArg>::try_fold_with 12: as core::iter::traits::iterator::Iterator>::next 13: as core::iter::traits::collect::Extend<::Item>>::extend 14: chalk_ir::fold::boring_impls:: for chalk_ir::Substitution>::try_fold_with 15: chalk_ir::_:: for chalk_ir::WhereClause>::try_fold_with 16: chalk_solve::infer::instantiate::>::instantiate_binders_universally 17: as chalk_ir::zip::Zipper>::zip_binders 18: as chalk_ir::zip::Zipper>::zip_binders 19: chalk_solve::infer::unify::Unifier::relate_ty_ty 20: as chalk_ir::zip::Zipper>::zip_tys 21: chalk_ir::zip::Zipper::zip_substs 22: chalk_solve::infer::unify::Unifier::relate_ty_ty 23: as chalk_ir::zip::Zipper>::zip_tys 24: chalk_solve::infer::unify::Unifier::relate_ty_ty 25: chalk_solve::infer::unify::Unifier::relate_var_ty 26: chalk_solve::infer::unify::Unifier::relate_ty_ty 27: as chalk_ir::zip::Zipper>::zip_tys 28: chalk_ir::zip::Zipper::zip_substs 29: chalk_ir::_:: for chalk_ir::WhereClause>::zip_with 30: chalk_ir::_:: for chalk_ir::DomainGoal>::zip_with 31: chalk_solve::infer::unify::Unifier::relate 32: chalk_recursive::fulfill::Fulfill::new_with_clause 33: chalk_recursive::solve::SolveIterationHelpers::solve_from_clauses 34: chalk_recursive::solve::SolveIteration::solve_iteration 35: chalk_recursive::fixed_point::RecursiveContext::solve_goal 36: chalk_recursive::fixed_point::RecursiveContext::solve_root_goal 37: hir_ty::traits::trait_solve_query 38: salsa::runtime::Runtime::execute_query_implementation 39: salsa::derived::slot::Slot::read_upgrade 40: salsa::derived::slot::Slot::read 41: as salsa::plumbing::QueryStorageOps>::try_fetch 42: salsa::QueryTable::get 43: ::trait_solve_query 44: hir_ty::db::trait_solve_wait 45: ::trait_solve 46: as hir_ty::chalk_ext::TyExt>::is_copy 47: hir_ty::mir::lower::MirLowerCtx::emit_drop_and_storage_dead_for_scope 48: hir_ty::mir::lower::MirLowerCtx::pop_drop_scope 49: hir_ty::mir::lower::MirLowerCtx::lower_loop 50: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 51: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_with_adjust 52: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place 53: hir_ty::mir::lower::MirLowerCtx::lower_block_to_place 54: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 55: hir_ty::mir::lower::as_place::::lower_expr_to_some_place_without_adjust 56: hir_ty::mir::lower::MirLowerCtx::lower_loop 57: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 58: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_with_adjust 59: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place 60: hir_ty::mir::lower::MirLowerCtx::lower_block_to_place 61: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 62: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_with_adjust 63: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place 64: hir_ty::mir::lower::mir_body_for_closure_query 65: salsa::runtime::Runtime::execute_query_implementation 66: salsa::derived::slot::Slot::read_upgrade 67: salsa::derived::slot::Slot::read 68: as salsa::plumbing::QueryStorageOps>::try_fetch 69: ::mir_body_for_closure::__shim 70: ::mir_body_for_closure 71: hir_ty::mir::borrowck::all_mir_bodies::for_closure 72: as core::iter::traits::iterator::Iterator>::next 73: as core::iter::traits::iterator::Iterator>::next 74: as core::iter::traits::iterator::Iterator>::next 75: as core::iter::traits::iterator::Iterator>::next 76: as core::iter::traits::iterator::Iterator>::try_fold 77: as alloc::vec::spec_from_iter::SpecFromIter>::from_iter 78: core::iter::adapters::try_process 79: hir_ty::mir::borrowck::borrowck_query 80: salsa::runtime::Runtime::execute_query_implementation 81: salsa::derived::slot::Slot::read_upgrade 82: salsa::derived::slot::Slot::read 83: as salsa::plumbing::QueryStorageOps>::try_fetch 84: ::borrowck::__shim 85: ::borrowck 86: hir::DefWithBody::diagnostics 87: hir::Module::diagnostics 88: ide_diagnostics::diagnostics 89: std::panicking::try 90: ide::Analysis::assists_with_fixes note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. Panic context: > version: 0.4.1530-standalone request: textDocument/codeAction CodeActionParams { text_document: TextDocumentIdentifier { uri: Url { scheme: "file", cannot_be_a_base: false, username: "", password: None, host: None, port: None, path: "/home/blujay/dev/sentinels/crates/tooling/script-editor/src/attributes.rs", query: None, fragment: None, }, }, range: Range { start: Position { line: 0, character: 0, }, end: Position { line: 0, character: 0, }, }, context: CodeActionContext { diagnostics: [], only: None, trigger_kind: Some( Automatic, ), }, work_done_progress_params: WorkDoneProgressParams { work_done_token: None, }, partial_result_params: PartialResultParams { partial_result_token: None, }, } thread 'Worker' panicked at 'index out of bounds: the len is 0 but the index is 0', /github/home/.cargo/registry/src/github.com-1ecc6299db9ec823/chalk-ir-0.89.0/src/fold/subst.rs:55:19 stack backtrace: 0: rust_begin_unwind at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5 1: core::panicking::panic_fmt at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14 2: core::panicking::panic_bounds_check at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:159:5 3: as chalk_ir::fold::TypeFolder>::fold_free_var_ty 4: chalk_ir::fold::TypeSuperFoldable::super_fold_with 5: chalk_ir::fold::TypeSuperFoldable::super_fold_with 6: chalk_ir::fold::boring_impls:: for chalk_ir::GenericArg>::try_fold_with 7: as core::iter::traits::iterator::Iterator>::next 8: as core::iter::traits::collect::Extend<::Item>>::extend 9: chalk_ir::fold::boring_impls:: for chalk_ir::Substitution>::try_fold_with 10: chalk_ir::fold::TypeSuperFoldable::super_fold_with 11: chalk_ir::fold::boring_impls:: for chalk_ir::GenericArg>::try_fold_with 12: as core::iter::traits::iterator::Iterator>::next 13: as core::iter::traits::collect::Extend<::Item>>::extend 14: chalk_ir::fold::boring_impls:: for chalk_ir::Substitution>::try_fold_with 15: chalk_ir::_:: for chalk_ir::WhereClause>::try_fold_with 16: chalk_solve::infer::instantiate::>::instantiate_binders_universally 17: as chalk_ir::zip::Zipper>::zip_binders 18: as chalk_ir::zip::Zipper>::zip_binders 19: chalk_solve::infer::unify::Unifier::relate_ty_ty 20: as chalk_ir::zip::Zipper>::zip_tys 21: chalk_ir::zip::Zipper::zip_substs 22: chalk_solve::infer::unify::Unifier::relate_ty_ty 23: as chalk_ir::zip::Zipper>::zip_tys 24: chalk_solve::infer::unify::Unifier::relate_ty_ty 25: chalk_solve::infer::unify::Unifier::relate_var_ty 26: chalk_solve::infer::unify::Unifier::relate_ty_ty 27: as chalk_ir::zip::Zipper>::zip_tys 28: chalk_ir::zip::Zipper::zip_substs 29: chalk_ir::_:: for chalk_ir::WhereClause>::zip_with 30: chalk_ir::_:: for chalk_ir::DomainGoal>::zip_with 31: chalk_solve::infer::unify::Unifier::relate 32: chalk_recursive::fulfill::Fulfill::new_with_clause 33: chalk_recursive::solve::SolveIterationHelpers::solve_from_clauses 34: chalk_recursive::solve::SolveIteration::solve_iteration 35: chalk_recursive::fixed_point::RecursiveContext::solve_goal 36: chalk_recursive::fixed_point::RecursiveContext::solve_root_goal 37: hir_ty::traits::trait_solve_query 38: salsa::runtime::Runtime::execute_query_implementation 39: salsa::derived::slot::Slot::read_upgrade 40: salsa::derived::slot::Slot::read 41: as salsa::plumbing::QueryStorageOps>::try_fetch 42: salsa::QueryTable::get 43: ::trait_solve_query 44: hir_ty::db::trait_solve_wait 45: ::trait_solve 46: as hir_ty::chalk_ext::TyExt>::is_copy 47: hir_ty::mir::lower::MirLowerCtx::emit_drop_and_storage_dead_for_scope 48: hir_ty::mir::lower::MirLowerCtx::pop_drop_scope 49: hir_ty::mir::lower::MirLowerCtx::lower_loop 50: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 51: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_with_adjust 52: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place 53: hir_ty::mir::lower::MirLowerCtx::lower_block_to_place 54: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 55: hir_ty::mir::lower::as_place::::lower_expr_to_some_place_without_adjust 56: hir_ty::mir::lower::MirLowerCtx::lower_loop 57: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 58: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_with_adjust 59: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place 60: hir_ty::mir::lower::MirLowerCtx::lower_block_to_place 61: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 62: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_with_adjust 63: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place 64: hir_ty::mir::lower::mir_body_for_closure_query 65: salsa::runtime::Runtime::execute_query_implementation 66: salsa::derived::slot::Slot::read_upgrade 67: salsa::derived::slot::Slot::read 68: as salsa::plumbing::QueryStorageOps>::try_fetch 69: ::mir_body_for_closure::__shim 70: ::mir_body_for_closure 71: hir_ty::mir::borrowck::all_mir_bodies::for_closure 72: as core::iter::traits::iterator::Iterator>::next 73: as core::iter::traits::iterator::Iterator>::next 74: as core::iter::traits::iterator::Iterator>::next 75: as core::iter::traits::iterator::Iterator>::next 76: as core::iter::traits::iterator::Iterator>::try_fold 77: as alloc::vec::spec_from_iter::SpecFromIter>::from_iter 78: core::iter::adapters::try_process 79: hir_ty::mir::borrowck::borrowck_query 80: salsa::runtime::Runtime::execute_query_implementation 81: salsa::derived::slot::Slot::read_upgrade 82: salsa::derived::slot::Slot::read 83: as salsa::plumbing::QueryStorageOps>::try_fetch 84: ::borrowck::__shim 85: ::borrowck 86: hir::DefWithBody::diagnostics 87: hir::Module::diagnostics 88: ide_diagnostics::diagnostics 89: std::panicking::try 90: ide::Analysis::assists_with_fixes note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. thread 'Worker' panicked at 'index out of bounds: the len is 0 but the index is 0', /github/home/.cargo/registry/src/github.com-1ecc6299db9ec823/chalk-ir-0.89.0/src/fold/subst.rs:55:19 stack backtrace: 0: rust_begin_unwind at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5 1: core::panicking::panic_fmt at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14 2: core::panicking::panic_bounds_check at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:159:5 3: as chalk_ir::fold::TypeFolder>::fold_free_var_ty 4: chalk_ir::fold::TypeSuperFoldable::super_fold_with 5: chalk_ir::fold::TypeSuperFoldable::super_fold_with 6: chalk_ir::fold::boring_impls:: for chalk_ir::GenericArg>::try_fold_with 7: as core::iter::traits::iterator::Iterator>::next 8: as core::iter::traits::collect::Extend<::Item>>::extend 9: chalk_ir::fold::boring_impls:: for chalk_ir::Substitution>::try_fold_with 10: chalk_ir::fold::TypeSuperFoldable::super_fold_with 11: chalk_ir::fold::boring_impls:: for chalk_ir::GenericArg>::try_fold_with 12: as core::iter::traits::iterator::Iterator>::next 13: as core::iter::traits::collect::Extend<::Item>>::extend 14: chalk_ir::fold::boring_impls:: for chalk_ir::Substitution>::try_fold_with 15: chalk_ir::_:: for chalk_ir::WhereClause>::try_fold_with 16: chalk_solve::infer::instantiate::>::instantiate_binders_universally 17: as chalk_ir::zip::Zipper>::zip_binders 18: as chalk_ir::zip::Zipper>::zip_binders 19: chalk_solve::infer::unify::Unifier::relate_ty_ty 20: as chalk_ir::zip::Zipper>::zip_tys 21: chalk_ir::zip::Zipper::zip_substs 22: chalk_solve::infer::unify::Unifier::relate_ty_ty 23: as chalk_ir::zip::Zipper>::zip_tys 24: chalk_solve::infer::unify::Unifier::relate_ty_ty 25: chalk_solve::infer::unify::Unifier::relate_var_ty 26: chalk_solve::infer::unify::Unifier::relate_ty_ty 27: as chalk_ir::zip::Zipper>::zip_tys 28: chalk_ir::zip::Zipper::zip_substs 29: chalk_ir::_:: for chalk_ir::WhereClause>::zip_with 30: chalk_ir::_:: for chalk_ir::DomainGoal>::zip_with 31: chalk_solve::infer::unify::Unifier::relate 32: chalk_recursive::fulfill::Fulfill::new_with_clause 33: chalk_recursive::solve::SolveIterationHelpers::solve_from_clauses 34: chalk_recursive::solve::SolveIteration::solve_iteration 35: chalk_recursive::fixed_point::RecursiveContext::solve_goal 36: chalk_recursive::fixed_point::RecursiveContext::solve_root_goal 37: hir_ty::traits::trait_solve_query 38: salsa::runtime::Runtime::execute_query_implementation 39: salsa::derived::slot::Slot::read_upgrade 40: salsa::derived::slot::Slot::read 41: as salsa::plumbing::QueryStorageOps>::try_fetch 42: salsa::QueryTable::get 43: ::trait_solve_query 44: hir_ty::db::trait_solve_wait 45: ::trait_solve 46: as hir_ty::chalk_ext::TyExt>::is_copy 47: hir_ty::mir::lower::MirLowerCtx::emit_drop_and_storage_dead_for_scope 48: hir_ty::mir::lower::MirLowerCtx::pop_drop_scope 49: hir_ty::mir::lower::MirLowerCtx::lower_loop 50: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 51: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_with_adjust 52: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place 53: hir_ty::mir::lower::MirLowerCtx::lower_block_to_place 54: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 55: hir_ty::mir::lower::as_place::::lower_expr_to_some_place_without_adjust 56: hir_ty::mir::lower::MirLowerCtx::lower_loop 57: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 58: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_with_adjust 59: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place 60: hir_ty::mir::lower::MirLowerCtx::lower_block_to_place 61: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 62: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_with_adjust 63: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place 64: hir_ty::mir::lower::mir_body_for_closure_query 65: salsa::runtime::Runtime::execute_query_implementation 66: salsa::derived::slot::Slot::read_upgrade 67: salsa::derived::slot::Slot::read 68: as salsa::plumbing::QueryStorageOps>::try_fetch 69: ::mir_body_for_closure::__shim 70: ::mir_body_for_closure 71: hir_ty::mir::borrowck::all_mir_bodies::for_closure 72: as core::iter::traits::iterator::Iterator>::next 73: as core::iter::traits::iterator::Iterator>::next 74: as core::iter::traits::iterator::Iterator>::next 75: as core::iter::traits::iterator::Iterator>::next 76: as core::iter::traits::iterator::Iterator>::try_fold 77: as alloc::vec::spec_from_iter::SpecFromIter>::from_iter 78: core::iter::adapters::try_process 79: hir_ty::mir::borrowck::borrowck_query 80: salsa::runtime::Runtime::execute_query_implementation 81: salsa::derived::slot::Slot::read_upgrade 82: salsa::derived::slot::Slot::read 83: as salsa::plumbing::QueryStorageOps>::try_fetch 84: ::borrowck::__shim 85: ::borrowck 86: hir::DefWithBody::diagnostics 87: hir::Module::diagnostics 88: ide_diagnostics::diagnostics 89: salsa::Cancelled::catch 90: ide::Analysis::diagnostics note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. thread 'Worker' panicked at 'index out of bounds: the len is 0 but the index is 0', /github/home/.cargo/registry/src/github.com-1ecc6299db9ec823/chalk-ir-0.89.0/src/fold/subst.rs:55:19 stack backtrace: 0: rust_begin_unwind at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5 1: core::panicking::panic_fmt at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14 2: core::panicking::panic_bounds_check at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:159:5 3: as chalk_ir::fold::TypeFolder>::fold_free_var_ty 4: chalk_ir::fold::TypeSuperFoldable::super_fold_with 5: chalk_ir::fold::TypeSuperFoldable::super_fold_with 6: chalk_ir::fold::boring_impls:: for chalk_ir::GenericArg>::try_fold_with 7: as core::iter::traits::iterator::Iterator>::next 8: as core::iter::traits::collect::Extend<::Item>>::extend 9: chalk_ir::fold::boring_impls:: for chalk_ir::Substitution>::try_fold_with 10: chalk_ir::fold::TypeSuperFoldable::super_fold_with 11: chalk_ir::fold::boring_impls:: for chalk_ir::GenericArg>::try_fold_with 12: as core::iter::traits::iterator::Iterator>::next 13: as core::iter::traits::collect::Extend<::Item>>::extend 14: chalk_ir::fold::boring_impls:: for chalk_ir::Substitution>::try_fold_with 15: chalk_ir::_:: for chalk_ir::WhereClause>::try_fold_with 16: chalk_solve::infer::instantiate::>::instantiate_binders_universally 17: as chalk_ir::zip::Zipper>::zip_binders 18: as chalk_ir::zip::Zipper>::zip_binders 19: chalk_solve::infer::unify::Unifier::relate_ty_ty 20: as chalk_ir::zip::Zipper>::zip_tys 21: chalk_ir::zip::Zipper::zip_substs 22: chalk_solve::infer::unify::Unifier::relate_ty_ty 23: as chalk_ir::zip::Zipper>::zip_tys 24: chalk_solve::infer::unify::Unifier::relate_ty_ty 25: chalk_solve::infer::unify::Unifier::relate_var_ty 26: chalk_solve::infer::unify::Unifier::relate_ty_ty 27: as chalk_ir::zip::Zipper>::zip_tys 28: chalk_ir::zip::Zipper::zip_substs 29: chalk_ir::_:: for chalk_ir::WhereClause>::zip_with 30: chalk_ir::_:: for chalk_ir::DomainGoal>::zip_with 31: chalk_solve::infer::unify::Unifier::relate 32: chalk_recursive::fulfill::Fulfill::new_with_clause 33: chalk_recursive::solve::SolveIterationHelpers::solve_from_clauses 34: chalk_recursive::solve::SolveIteration::solve_iteration 35: chalk_recursive::fixed_point::RecursiveContext::solve_goal 36: chalk_recursive::fixed_point::RecursiveContext::solve_root_goal 37: hir_ty::traits::trait_solve_query 38: salsa::runtime::Runtime::execute_query_implementation 39: salsa::derived::slot::Slot::read_upgrade 40: salsa::derived::slot::Slot::read 41: as salsa::plumbing::QueryStorageOps>::try_fetch 42: salsa::QueryTable::get 43: ::trait_solve_query 44: hir_ty::db::trait_solve_wait 45: ::trait_solve 46: as hir_ty::chalk_ext::TyExt>::is_copy 47: hir_ty::mir::lower::MirLowerCtx::emit_drop_and_storage_dead_for_scope 48: hir_ty::mir::lower::MirLowerCtx::pop_drop_scope 49: hir_ty::mir::lower::MirLowerCtx::lower_loop 50: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 51: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_with_adjust 52: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place 53: hir_ty::mir::lower::MirLowerCtx::lower_block_to_place 54: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 55: hir_ty::mir::lower::as_place::::lower_expr_to_some_place_without_adjust 56: hir_ty::mir::lower::MirLowerCtx::lower_loop 57: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 58: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_with_adjust 59: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place 60: hir_ty::mir::lower::MirLowerCtx::lower_block_to_place 61: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_without_adjust 62: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place_with_adjust 63: hir_ty::mir::lower::MirLowerCtx::lower_expr_to_place 64: hir_ty::mir::lower::mir_body_for_closure_query 65: salsa::runtime::Runtime::execute_query_implementation 66: salsa::derived::slot::Slot::read_upgrade 67: salsa::derived::slot::Slot::read 68: as salsa::plumbing::QueryStorageOps>::try_fetch 69: ::mir_body_for_closure::__shim 70: ::mir_body_for_closure 71: hir_ty::mir::borrowck::all_mir_bodies::for_closure 72: as core::iter::traits::iterator::Iterator>::next 73: as core::iter::traits::iterator::Iterator>::next 74: as core::iter::traits::iterator::Iterator>::next 75: as core::iter::traits::iterator::Iterator>::next 76: as core::iter::traits::iterator::Iterator>::try_fold 77: as alloc::vec::spec_from_iter::SpecFromIter>::from_iter 78: core::iter::adapters::try_process 79: hir_ty::mir::borrowck::borrowck_query 80: salsa::runtime::Runtime::execute_query_implementation 81: salsa::derived::slot::Slot::read_upgrade 82: salsa::derived::slot::Slot::read 83: as salsa::plumbing::QueryStorageOps>::try_fetch 84: ::borrowck::__shim 85: ::borrowck 86: hir::DefWithBody::diagnostics 87: hir::Module::diagnostics 88: ide_diagnostics::diagnostics 89: salsa::Cancelled::catch 90: ide::Analysis::diagnostics note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. ```

EDIT: As for behavior, I'm able to do things like symbol renaming, Format on Save is working as expected, auto-complete, etc. Errors are inconsistently reported, and when they are reported 90% of the time they don't go away once the error is corrected

Persisting Error (Note that the file is saved) ![image](https://github.com/rust-lang/rust-analyzer/assets/42755519/7a849c03-4c4f-406c-a1e0-b138d5253c15)

It seems that it only reports syntax errors as well, as I currently have a lifetime error in one of my signatures and it is not reflected in RA:

Missing Error The error as reported by `cargo check -p attribute-editor` ``` error: lifetime may not live long enough --> crates/tooling/attribute-editor/src/lib.rs:47:9 | 44 | &mut self, | - let's call the lifetime of this reference `'1` 45 | args: as AttributeBuilder>::Args, | ---- has type `<>::Builder<'2> as AttributeBuilder>::Args` 46 | ) -> AttributeBuilderWrapper<'_, A::Builder<'_>, T> { 47 | / AttributeBuilderWrapper { 48 | | section: self, 49 | | builder: Some( as AttributeBuilder>::from_args(args)), 50 | | } | |_________^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` error: lifetime may not live long enough --> crates/tooling/attribute-editor/src/lib.rs:47:9 | 44 | &mut self, | - let's call the lifetime of this reference `'1` 45 | args: as AttributeBuilder>::Args, | ---- has type `<>::Builder<'2> as AttributeBuilder>::Args` 46 | ) -> AttributeBuilderWrapper<'_, A::Builder<'_>, T> { 47 | / AttributeBuilderWrapper { 48 | | section: self, 49 | | builder: Some( as AttributeBuilder>::from_args(args)), 50 | | } | |_________^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'2` ``` In-editor ![image](https://github.com/rust-lang/rust-analyzer/assets/42755519/d038348b-dce7-4ba8-8081-d625eb908f74)
blu-dev commented 1 year ago

Update, I messed around with it this morning, after a rustup update + cargo update everything seems to be running fine again. Not sure what happened, or if it was my own fault, but you can count me out of this discussion, sorry!

lnicola commented 3 months ago

@alucryd does this still happen? Can you prepare a workspace showing the issue?

alucryd commented 3 months ago

@alucryd does this still happen? Can you prepare a workspace showing the issue?

Had the issue not too long ago still, I can only have one working rust project in a single workspace.