Skip to content

"The parser seems stuck" on recent versions of ra #3861

@imtsuki

Description

@imtsuki

The output is like:

[ERROR rust_analyzer::main_loop] overly long loop turn: 2.110227582s
thread '<unnamed>' panicked at 'the parser seems stuck', crates/ra_parser/src/parser.rs:51:9
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic
   7: ra_parser::grammar::expressions::atom::atom_expr
   8: ra_parser::grammar::expressions::lhs
   9: ra_parser::grammar::expressions::expr_bp
  10: ra_parser::grammar::expressions::stmt
  11: ra_parser::grammar::expressions::naked_block
  12: ra_parser::grammar::expressions::atom::block_expr
  13: ra_parser::grammar::items::maybe_item
  14: ra_parser::grammar::items::item_or_macro
  15: ra_parser::grammar::items::traits::impl_item_list
  16: ra_parser::grammar::items::maybe_item
  17: ra_parser::grammar::items::item_or_macro
  18: ra_parser::grammar::items::mod_contents
  19: ra_parser::grammar::fragments::macro_items
  20: ra_parser::parse_fragment
  21: ra_mbe::syntax_bridge::token_tree_to_syntax_node
  22: ra_hir_expand::db::parse_macro_with_arg
  23: ra_hir_expand::db::parse_macro
  24: salsa::runtime::Runtime<DB>::execute_query_implementation
  25: salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade
  26: salsa::derived::slot::Slot<DB,Q,MP>::read
  27: <salsa::derived::DerivedStorage<DB,Q,MP> as salsa::plumbing::QueryStorageOps<DB,Q>>::try_fetch
  28: <T as ra_hir_expand::db::AstDatabase>::parse_macro
  29: ra_hir_expand::db::parse_or_expand
  30: <T as ra_hir_expand::db::AstDatabase>::parse_or_expand
  31: ra_hir_expand::db::ast_id_map
  32: salsa::runtime::Runtime<DB>::execute_query_implementation
  33: salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade
  34: salsa::derived::slot::Slot<DB,Q,MP>::read
  35: <salsa::derived::DerivedStorage<DB,Q,MP> as salsa::plumbing::QueryStorageOps<DB,Q>>::try_fetch
  36: <T as ra_hir_expand::db::AstDatabase>::ast_id_map
  37: ra_hir_def::nameres::raw::RawItems::raw_items_query
  38: salsa::runtime::Runtime<DB>::execute_query_implementation
  39: salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade
  40: salsa::derived::slot::Slot<DB,Q,MP>::read
  41: <salsa::derived::DerivedStorage<DB,Q,MP> as salsa::plumbing::QueryStorageOps<DB,Q>>::try_fetch
  42: <T as ra_hir_def::db::DefDatabase>::raw_items
  43: ra_hir_def::nameres::collector::collect_defs
  44: ra_hir_def::nameres::CrateDefMap::crate_def_map_query
  45: salsa::runtime::Runtime<DB>::execute_query_implementation
  46: salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade
  47: salsa::derived::slot::Slot<DB,Q,MP>::read
  48: <salsa::derived::DerivedStorage<DB,Q,MP> as salsa::plumbing::QueryStorageOps<DB,Q>>::try_fetch
  49: <T as ra_hir_def::db::DefDatabase>::crate_def_map_query
  50: <T as ra_hir_def::db::DefDatabase>::crate_def_map
  51: ra_hir_def::nameres::collector::collect_defs
  52: ra_hir_def::nameres::CrateDefMap::crate_def_map_query
  53: salsa::runtime::Runtime<DB>::execute_query_implementation
  54: salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade
  55: salsa::derived::slot::Slot<DB,Q,MP>::read
  56: <salsa::derived::DerivedStorage<DB,Q,MP> as salsa::plumbing::QueryStorageOps<DB,Q>>::try_fetch
  57: <T as ra_hir_def::db::DefDatabase>::crate_def_map_query
  58: <T as ra_hir_def::db::DefDatabase>::crate_def_map
  59: ra_hir::semantics::source_to_def::SourceToDefCtx::file_to_def
  60: ra_hir::semantics::Semantics<DB>::to_module_def
  61: ra_ide::diagnostics::diagnostics
  62: std::panicking::try::do_call
  63: __rust_maybe_catch_panic
  64: ra_ide::Analysis::diagnostics
  65: rust_analyzer::main_loop::handlers::publish_diagnostics
  66: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[ERROR rust_analyzer::main_loop] overly long loop turn: 2.110227582s

Can be reproduced on this repo:

https://github.com/imtsuki/xv7

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