Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panics when vstd is explicitly added in Cargo.toml #25

Open
ouuan opened this issue May 19, 2024 · 0 comments
Open

Panics when vstd is explicitly added in Cargo.toml #25

ouuan opened this issue May 19, 2024 · 0 comments

Comments

@ouuan
Copy link

ouuan commented May 19, 2024

When vstd is explicitly added in Cargo.toml as a dependency, verus-analyzer panics while indexing vstd. It works (although reports some false syntax errors) if vstd is not specified in Cargo.toml.

I'm using verus-analyzer with neovim and nvim-lspconfig. Haven't tried VS Code yet.

Relevant logs
thread 'Worker' panicked at crates/syntax/src/ast/expr_ext.rs:306:14:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
   2: core::panicking::panic
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:145:5
   3: core::option::unwrap_failed
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/option.rs:1985:5
   4: syntax::ast::expr_ext::<impl syntax::ast::generated::nodes::Literal>::token
   5: syntax::validation::validate
   6: syntax::<impl syntax::ast::generated::nodes::SourceFile>::parse
   7: <base_db::ParseQuery as salsa::plumbing::QueryFunction>::execute
   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 base_db::SourceDatabase>::parse::__shim
  13: hir_expand::db::parse_or_expand
  14: hir_def::item_tree::ItemTree::file_item_tree_query
  15: salsa::runtime::Runtime::execute_query_implementation
  16: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  17: salsa::derived::slot::Slot<Q,MP>::read
  18: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  19: <DB as hir_def::db::DefDatabase>::file_item_tree
  20: hir_def::nameres::collector::ModCollector::collect
  21: hir_def::nameres::collector::ModCollector::collect
  22: hir_def::nameres::collector::collect_defs
  23: hir_def::nameres::DefMap::crate_def_map_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: <DB as hir_def::db::DefDatabase>::crate_def_map_query
  29: hir_def::db::crate_def_map_wait
  30: hir_def::nameres::collector::collect_defs
  31: hir_def::nameres::DefMap::crate_def_map_query
  32: salsa::runtime::Runtime::execute_query_implementation
  33: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  34: salsa::derived::slot::Slot<Q,MP>::read
  35: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  36: <DB as hir_def::db::DefDatabase>::crate_def_map_query
  37: hir_def::db::crate_def_map_wait
  38: hir::semantics::source_to_def::SourceToDefCtx::file_to_def
  39: ide_diagnostics::diagnostics
  40: salsa::Cancelled::catch
  41: ide::Analysis::diagnostics
  42: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
  43: alloc::vec::in_place_collect::<impl alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
  44: <F as threadpool::FnBox>::call_box

note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Panic context:
version: 0.0.0-standalone (23eeb081c 2024-04-07)
request: textDocument/signatureHelp SignatureHelpParams {
    context: None,
    text_document_position_params: TextDocumentPositionParams {
        text_document: TextDocumentIdentifier {
            uri: Url {
                scheme: "file",
                cannot_be_a_base: false,
                username: "",
                password: None,
                host: None,
                port: None,
                path: "/../verified-allocator/src/bitmap/allocator.rs",
                query: None,
                fragment: None,
            },
        },
        position: Position {
            line: 373,
            character: 8,
        },
    },
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
}

thread 'Worker' panicked at crates/syntax/src/ast/expr_ext.rs:306:14:
called `Option::unwrap()` on a `None` value
stack backtrace:

   0: rust_begin_unwind
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:
645:5
   1: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
   2: core::panicking::panic
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:145:5
   3: core::option::unwrap_failed
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/option.rs:1985:5
   4: syntax::ast::expr_ext::<impl syntax::ast::generated
::nodes::Literal>::token
   5: syntax::validation::validate
   6: syntax::<impl syntax::ast::generated::nodes::SourceFile>::parse
   7: <base_db::ParseQuery as salsa::plumbing::QueryFunction>::
execute
   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 base_db::SourceDatabase>::parse::__shim
  13: hir_expand::db::parse_or_expand
  14: hir_def::item_tree::ItemTree::file_item_tree_query
  15: salsa::runtime::Runtime::execute_query_implementation
  16: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  17: salsa::derived::slot::Slot<Q,MP>::read
  18: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  19: <DB as hir_def
::db::DefDatabase>::file_item_tree
  20: hir_def::nameres::collector::ModCollector::collect
  21: hir_def::nameres::collector::ModCollector::collect
  22: hir_def::nameres::collector::collect_defs
  23: hir_def::nameres::DefMap::crate_def_map_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: <DB as hir_def::db::DefDatabase>::crate_def_map_query
  29: hir_def::db::crate_def_map_wait
  30: hir_def::nameres::collector::collect_defs
  31: hir_def::nameres::DefMap
::crate_def_map_query
  32: salsa::runtime::Runtime::execute_query_implementation
  33: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  34: salsa::derived::slot::Slot<Q,MP>::read
  35: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  36: <DB as hir_def::db::DefDatabase>::crate_def_map_query
  37: hir_def::db::crate_def_map_wait
  38: hir::semantics::source_to_def::SourceToDefCtx::file_to_def
  39: hir::semantics::source_to_def::SourceToDefCtx::find_container
  40: hir::semantics::source_to_def::SourceToDefCtx::to_def
  41: hir::semantics::source_to_def::SourceToDefCtx::find_container
  42: hir::semantics::source_to_def::SourceToDefCtx::to_def
  43: hir::semantics::source_to_def::SourceToDefCtx::find_container
  44: hir::semantics::SemanticsImpl::analyze_impl
  45: hir::semantics::SemanticsImpl::descend_into_macros_impl
  46: ide::signature_help::signature_help
  47: std::panicking::try
  48: rust_analyzer::handlers::request::handle_signature_help
  49: std::panicking::try
  50: <F as threadpool::FnBox>::call_box

note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant