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

thread 'Worker' panicked: called Option::unwrap() on a None value #18898

Closed
danfabo opened this issue Jan 9, 2025 · 2 comments · Fixed by #18899
Closed

thread 'Worker' panicked: called Option::unwrap() on a None value #18898

danfabo opened this issue Jan 9, 2025 · 2 comments · Fixed by #18899
Assignees
Labels
C-bug Category: bug

Comments

@danfabo
Copy link

danfabo commented Jan 9, 2025

The following error messages are displayed each time the tokio main function is edited, e.g. start writing let.

  • Request textDocument/semanticTokens/full/delta failed.
  • Request textDocument/inlayHint failed.
  • Request textDocument/codeLens failed.
  • Request textDocument/diagnostic failed.
  • Request textDocument/completion failed.

Installed tokio using cargo add tokio -F full. Last working version is 0.3.2237.

rust-analyzer version: rust-analyzer version: 0.3.2257-standalone (238ccb6 2025-01-08)

rustc version: rustc 1.84.0 (9fc6b4312 2025-01-07)

editor or extension: VSCode, rust-analyzer v0.3.2257

code snippet to reproduce:

#[tokio::main]
async fn main() {
    let
}

Output:

thread 'Worker' panicked at crates\hir-expand\src\fixup.rs:445:65:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/std\src\panicking.rs:665
   1: core::panicking::panic_fmt
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\panicking.rs:74
   2: core::panicking::panic
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\panicking.rs:148
   3: core::option::unwrap_failed
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\option.rs:2012
   4: hir_expand::fixup::reverse_fixups
   5: <hir_expand::db::ExpandProcMacroQuery as ra_salsa::plumbing::QueryFunction>::execute
   6: ra_salsa::Cycle::catch
   7: ra_salsa::derived::slot::Slot<Q>::read
   8: ra_salsa::derived::slot::Slot<Q>::maybe_changed_after
   9: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::maybe_changed_after
  10: hir_expand::db::ExpandDatabaseGroupStorage__::maybe_changed_after
  11: <ide_db::RootDatabase as ra_salsa::plumbing::DatabaseOps>::maybe_changed_after
  12: core::slice::sort::shared::pivot::median3_rec
  13: ra_salsa::derived_lru::slot::Slot<Q,MP>::maybe_changed_after
  14: <ra_salsa::derived_lru::DerivedStorage<Q,MP> as ra_salsa::plumbing::QueryStorageOps<Q>>::maybe_changed_after
  15: hir_expand::db::ExpandDatabaseGroupStorage__::maybe_changed_after
  16: <ide_db::RootDatabase as ra_salsa::plumbing::DatabaseOps>::maybe_changed_after
  17: <hir_def::hir::type_ref::FnType as core::fmt::Debug>::fmt
  18: ra_salsa::derived::slot::Slot<Q>::maybe_changed_after
  19: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::maybe_changed_after
  20: hir_expand::db::ExpandDatabaseGroupStorage__::maybe_changed_after
  21: <ide_db::RootDatabase as ra_salsa::plumbing::DatabaseOps>::maybe_changed_after
  22: core::ptr::drop_in_place<hir_def::attr::Attrs>
  23: ra_salsa::derived::slot::Slot<Q>::maybe_changed_after
  24: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::maybe_changed_after
  25: hir_def::db::DefDatabaseGroupStorage__::maybe_changed_after
  26: <ide_db::RootDatabase as ra_salsa::plumbing::DatabaseOps>::maybe_changed_after
  27: core::ptr::drop_in_place<hir_def::attr::Attrs>
  28: ra_salsa::derived::slot::Slot<Q>::maybe_changed_after
  29: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::maybe_changed_after
  30: hir_def::db::DefDatabaseGroupStorage__::maybe_changed_after
  31: <ide_db::RootDatabase as ra_salsa::plumbing::DatabaseOps>::maybe_changed_after
  32: core::ptr::drop_in_place<hir_def::attr::Attrs>
  33: ra_salsa::derived::slot::Slot<Q>::read
  34: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  35: <DB as hir_def::db::DefDatabase>::crate_def_map
  36: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
  37: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
  38: ide::parent_module::crates_for
  39: ide::Analysis::crates_for
  40: <alloc::vec::into_iter::IntoIter<T,A> as core::iter::traits::iterator::Iterator>::try_fold
  41: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Panic context:
> 
version: 0.3.2257-standalone (238ccb628b 2025-01-08)
request: textDocument/semanticTokens/full/delta SemanticTokensDeltaParams {
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/c%3A/Users/***/rust-test/src/main.rs",
            query: None,
            fragment: None,
        },
    },
    previous_result_id: "45",
}

thread 'Worker' panicked at crates\hir-expand\src\fixup.rs:445:65:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/std\src\panicking.rs:665
   1: core::panicking::panic_fmt
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\panicking.rs:74
   2: core::panicking::panic
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\panicking.rs:148
   3: core::option::unwrap_failed
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\option.rs:2012
   4: hir_expand::fixup::reverse_fixups
   5: <hir_expand::db::ExpandProcMacroQuery as ra_salsa::plumbing::QueryFunction>::execute
   6: ra_salsa::Cycle::catch
   7: ra_salsa::derived::slot::Slot<Q>::read
   8: ra_salsa::derived::slot::Slot<Q>::read
   9: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  10: <DB as hir_expand::db::ExpandDatabase>::expand_proc_macro
  11: <hir_expand::db::ParseMacroExpansionQuery as ra_salsa::plumbing::QueryFunction>::execute
  12: ra_salsa::Cycle::catch
  13: ra_salsa::derived_lru::slot::Slot<Q,MP>::maybe_changed_after
  14: <ra_salsa::derived_lru::DerivedStorage<Q,MP> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  15: <DB as hir_expand::db::ExpandDatabase>::parse_macro_expansion
  16: hir_expand::db::parse_or_expand
  17: <hir_expand::db::AstIdMapQuery as ra_salsa::plumbing::QueryFunction>::execute
  18: ra_salsa::Cycle::catch
  19: ra_salsa::derived::slot::Slot<Q>::read
  20: ra_salsa::derived::slot::Slot<Q>::read
  21: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  22: <DB as hir_expand::db::ExpandDatabase>::ast_id_map
  23: hir_def::item_tree::ItemTree::file_item_tree_with_source_map_query
  24: ra_salsa::Cycle::catch
  25: ra_salsa::derived::slot::Slot<Q>::read
  26: ra_salsa::derived::slot::Slot<Q>::read
  27: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  28: <DB as hir_def::db::DefDatabase>::file_item_tree_with_source_map
  29: ra_salsa::Cycle::catch
  30: ra_salsa::derived::slot::Slot<Q>::read
  31: ra_salsa::derived::slot::Slot<Q>::read
  32: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  33: <DB as hir_def::db::DefDatabase>::file_item_tree
  34: hir_def::nameres::collector::DefCollector::record_resolved_import
  35: hir_def::nameres::collector::collect_defs
  36: hir_def::nameres::DefMap::crate_def_map_query
  37: ra_salsa::Cycle::catch
  38: ra_salsa::derived::slot::Slot<Q>::read
  39: ra_salsa::derived::slot::Slot<Q>::read
  40: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  41: <DB as hir_def::db::DefDatabase>::crate_def_map
  42: hir::semantics::source_to_def::SourceToDefCtx::file_to_def
  43: hir::semantics::SemanticsImpl::file_to_module_defs
  44: hir::semantics::SemanticsImpl::attach_first_edition
  45: ide::syntax_highlighting::highlight
  46: ide::Analysis::highlight
  47: rust_analyzer::handlers::request::handle_semantic_tokens_full_delta
  48: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 4:58:05 PM] Request textDocument/semanticTokens/full/delta failed.
  Message: request handler panicked: called `Option::unwrap()` on a `None` value
  Code: -32603 
Panic context:
> 
version: 0.3.2257-standalone (238ccb628b 2025-01-08)
request: textDocument/completion CompletionParams {
    text_document_position: TextDocumentPositionParams {
        text_document: TextDocumentIdentifier {
            uri: Url {
                scheme: "file",
                cannot_be_a_base: false,
                username: "",
                password: None,
                host: None,
                port: None,
                path: "/c%3A/Users/***/rust-test/src/main.rs",
                query: None,
                fragment: None,
            },
        },
        position: Position {
            line: 3,
            character: 6,
        },
    },
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
    context: Some(
        CompletionContext {
            trigger_kind: TriggerCharacter,
            trigger_character: Some(
                ".",
            ),
        },
    ),
}

thread 'Worker' panicked at crates\hir-expand\src\fixup.rs:445:65:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/std\src\panicking.rs:665
   1: core::panicking::panic_fmt
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\panicking.rs:74
   2: core::panicking::panic
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\panicking.rs:148
   3: core::option::unwrap_failed
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\option.rs:2012
   4: hir_expand::fixup::reverse_fixups
   5: <hir_expand::db::ExpandProcMacroQuery as ra_salsa::plumbing::QueryFunction>::execute
   6: ra_salsa::Cycle::catch
   7: ra_salsa::derived::slot::Slot<Q>::read
   8: ra_salsa::derived::slot::Slot<Q>::read
   9: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  10: <DB as hir_expand::db::ExpandDatabase>::expand_proc_macro
  11: <hir_expand::db::ParseMacroExpansionQuery as ra_salsa::plumbing::QueryFunction>::execute
  12: ra_salsa::Cycle::catch
  13: ra_salsa::derived_lru::slot::Slot<Q,MP>::maybe_changed_after
  14: <ra_salsa::derived_lru::DerivedStorage<Q,MP> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  15: <DB as hir_expand::db::ExpandDatabase>::parse_macro_expansion
  16: hir_expand::db::parse_or_expand
  17: <hir_expand::db::AstIdMapQuery as ra_salsa::plumbing::QueryFunction>::execute
  18: ra_salsa::Cycle::catch
  19: ra_salsa::derived::slot::Slot<Q>::read
  20: ra_salsa::derived::slot::Slot<Q>::read
  21: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  22: <DB as hir_expand::db::ExpandDatabase>::ast_id_map
  23: hir_def::item_tree::ItemTree::file_item_tree_with_source_map_query
  24: ra_salsa::Cycle::catch
  25: ra_salsa::derived::slot::Slot<Q>::read
  26: ra_salsa::derived::slot::Slot<Q>::read
  27: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  28: <DB as hir_def::db::DefDatabase>::file_item_tree_with_source_map
  29: ra_salsa::Cycle::catch
  30: ra_salsa::derived::slot::Slot<Q>::read
  31: ra_salsa::derived::slot::Slot<Q>::read
  32: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  33: <DB as hir_def::db::DefDatabase>::file_item_tree
  34: hir_def::nameres::collector::DefCollector::record_resolved_import
  35: hir_def::nameres::collector::collect_defs
  36: hir_def::nameres::DefMap::crate_def_map_query
  37: ra_salsa::Cycle::catch
  38: ra_salsa::derived::slot::Slot<Q>::read
  39: ra_salsa::derived::slot::Slot<Q>::read
  40: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  41: <DB as hir_def::db::DefDatabase>::crate_def_map
  42: hir::semantics::source_to_def::SourceToDefCtx::file_to_def
  43: hir::semantics::SemanticsImpl::file_to_module_defs
  44: hir::semantics::SemanticsImpl::attach_first_edition
  45: ide_completion::context::CompletionContext::new
  46: ide_completion::completions
  47: ide::Analysis::completions
  48: rust_analyzer::handlers::request::handle_completion
  49: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 4:58:05 PM] Request textDocument/completion failed.
  Message: request handler panicked: called `Option::unwrap()` on a `None` value
  Code: -32603 
Panic context:
> 
version: 0.3.2257-standalone (238ccb628b 2025-01-08)
request: textDocument/codeAction CodeActionParams {
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/c%3A/Users/***/rust-test/src/main.rs",
            query: None,
            fragment: None,
        },
    },
    range: Range {
        start: Position {
            line: 3,
            character: 6,
        },
        end: Position {
            line: 3,
            character: 6,
        },
    },
    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 crates\hir-expand\src\fixup.rs:445:65:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/std\src\panicking.rs:665
   1: core::panicking::panic_fmt
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\panicking.rs:74
   2: core::panicking::panic
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\panicking.rs:148
   3: core::option::unwrap_failed
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\option.rs:2012
   4: hir_expand::fixup::reverse_fixups
   5: <hir_expand::db::ExpandProcMacroQuery as ra_salsa::plumbing::QueryFunction>::execute
   6: ra_salsa::Cycle::catch
   7: ra_salsa::derived::slot::Slot<Q>::read
   8: ra_salsa::derived::slot::Slot<Q>::read
   9: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  10: <DB as hir_expand::db::ExpandDatabase>::expand_proc_macro
  11: <hir_expand::db::ParseMacroExpansionQuery as ra_salsa::plumbing::QueryFunction>::execute
  12: ra_salsa::Cycle::catch
  13: ra_salsa::derived_lru::slot::Slot<Q,MP>::maybe_changed_after
  14: <ra_salsa::derived_lru::DerivedStorage<Q,MP> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  15: <DB as hir_expand::db::ExpandDatabase>::parse_macro_expansion
  16: hir_expand::db::parse_or_expand
  17: <hir_expand::db::AstIdMapQuery as ra_salsa::plumbing::QueryFunction>::execute
  18: ra_salsa::Cycle::catch
  19: ra_salsa::derived::slot::Slot<Q>::read
  20: ra_salsa::derived::slot::Slot<Q>::read
  21: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  22: <DB as hir_expand::db::ExpandDatabase>::ast_id_map
  23: hir_def::item_tree::ItemTree::file_item_tree_with_source_map_query
  24: ra_salsa::Cycle::catch
  25: ra_salsa::derived::slot::Slot<Q>::read
  26: ra_salsa::derived::slot::Slot<Q>::read
  27: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  28: <DB as hir_def::db::DefDatabase>::file_item_tree_with_source_map
  29: ra_salsa::Cycle::catch
  30: ra_salsa::derived::slot::Slot<Q>::read
  31: ra_salsa::derived::slot::Slot<Q>::read
  32: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  33: <DB as hir_def::db::DefDatabase>::file_item_tree
  34: hir_def::nameres::collector::DefCollector::record_resolved_import
  35: hir_def::nameres::collector::collect_defs
  36: hir_def::nameres::DefMap::crate_def_map_query
  37: ra_salsa::Cycle::catch
  38: ra_salsa::derived::slot::Slot<Q>::read
  39: ra_salsa::derived::slot::Slot<Q>::read
  40: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  41: <DB as hir_def::db::DefDatabase>::crate_def_map
  42: hir::semantics::source_to_def::SourceToDefCtx::file_to_def
  43: hir::semantics::SemanticsImpl::file_to_module_defs
  44: hir::semantics::SemanticsImpl::attach_first_edition
  45: ide_diagnostics::syntax_diagnostics
  46: ide_diagnostics::full_diagnostics
  47: ide::Analysis::assists_with_fixes
  48: rust_analyzer::handlers::request::handle_code_action
  49: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Panic context:
> 
version: 0.3.2257-standalone (238ccb628b 2025-01-08)
request: textDocument/inlayHint InlayHintParams {
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/c%3A/Users/***/rust-test/src/main.rs",
            query: None,
            fragment: None,
        },
    },
    range: Range {
        start: Position {
            line: 0,
            character: 0,
        },
        end: Position {
            line: 5,
            character: 0,
        },
    },
}

thread 'Worker' panicked at crates\hir-expand\src\fixup.rs:445:65:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/std\src\panicking.rs:665
   1: core::panicking::panic_fmt
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\panicking.rs:74
   2: core::panicking::panic
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\panicking.rs:148
   3: core::option::unwrap_failed
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\option.rs:2012
   4: hir_expand::fixup::reverse_fixups
   5: <hir_expand::db::ExpandProcMacroQuery as ra_salsa::plumbing::QueryFunction>::execute
   6: ra_salsa::Cycle::catch
   7: ra_salsa::derived::slot::Slot<Q>::read
   8: ra_salsa::derived::slot::Slot<Q>::read
   9: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  10: <DB as hir_expand::db::ExpandDatabase>::expand_proc_macro
  11: <hir_expand::db::ParseMacroExpansionQuery as ra_salsa::plumbing::QueryFunction>::execute
  12: ra_salsa::Cycle::catch
  13: ra_salsa::derived_lru::slot::Slot<Q,MP>::maybe_changed_after
  14: <ra_salsa::derived_lru::DerivedStorage<Q,MP> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  15: <DB as hir_expand::db::ExpandDatabase>::parse_macro_expansion
  16: hir_expand::db::parse_or_expand
  17: <hir_expand::db::AstIdMapQuery as ra_salsa::plumbing::QueryFunction>::execute
  18: ra_salsa::Cycle::catch
  19: ra_salsa::derived::slot::Slot<Q>::read
  20: ra_salsa::derived::slot::Slot<Q>::read
  21: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  22: <DB as hir_expand::db::ExpandDatabase>::ast_id_map
  23: hir_def::item_tree::ItemTree::file_item_tree_with_source_map_query
  24: ra_salsa::Cycle::catch
  25: ra_salsa::derived::slot::Slot<Q>::read
  26: ra_salsa::derived::slot::Slot<Q>::read
  27: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  28: <DB as hir_def::db::DefDatabase>::file_item_tree_with_source_map
  29: ra_salsa::Cycle::catch
  30: ra_salsa::derived::slot::Slot<Q>::read
  31: ra_salsa::derived::slot::Slot<Q>::read
  32: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  33: <DB as hir_def::db::DefDatabase>::file_item_tree
  34: hir_def::nameres::collector::DefCollector::record_resolved_import
  35: hir_def::nameres::collector::collect_defs
  36: hir_def::nameres::DefMap::crate_def_map_query
  37: ra_salsa::Cycle::catch
  38: ra_salsa::derived::slot::Slot<Q>::read
  39: ra_salsa::derived::slot::Slot<Q>::read
  40: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  41: <DB as hir_def::db::DefDatabase>::crate_def_map
  42: hir::semantics::source_to_def::SourceToDefCtx::file_to_def
  43: hir::semantics::SemanticsImpl::file_to_module_defs
  44: hir::semantics::SemanticsImpl::attach_first_edition
  45: ide::inlay_hints::inlay_hints
  46: ide::Analysis::inlay_hints
  47: rust_analyzer::handlers::request::handle_inlay_hints
  48: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 4:58:06 PM] Request textDocument/inlayHint failed.
  Message: request handler panicked: called `Option::unwrap()` on a `None` value
  Code: -32603 
Panic context:
> 
version: 0.3.2257-standalone (238ccb628b 2025-01-08)
request: textDocument/inlayHint InlayHintParams {
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/c%3A/Users/***/rust-test/src/main.rs",
            query: None,
            fragment: None,
        },
    },
    range: Range {
        start: Position {
            line: 0,
            character: 0,
        },
        end: Position {
            line: 5,
            character: 0,
        },
    },
}

thread 'Worker' panicked at crates\hir-expand\src\fixup.rs:445:65:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/std\src\panicking.rs:665
   1: core::panicking::panic_fmt
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\panicking.rs:74
   2: core::panicking::panic
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\panicking.rs:148
   3: core::option::unwrap_failed
             at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\option.rs:2012
   4: hir_expand::fixup::reverse_fixups
   5: <hir_expand::db::ExpandProcMacroQuery as ra_salsa::plumbing::QueryFunction>::execute
   6: ra_salsa::Cycle::catch
   7: ra_salsa::derived::slot::Slot<Q>::read
   8: ra_salsa::derived::slot::Slot<Q>::read
   9: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  10: <DB as hir_expand::db::ExpandDatabase>::expand_proc_macro
  11: <hir_expand::db::ParseMacroExpansionQuery as ra_salsa::plumbing::QueryFunction>::execute
  12: ra_salsa::Cycle::catch
  13: ra_salsa::derived_lru::slot::Slot<Q,MP>::maybe_changed_after
  14: <ra_salsa::derived_lru::DerivedStorage<Q,MP> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  15: <DB as hir_expand::db::ExpandDatabase>::parse_macro_expansion
  16: hir_expand::db::parse_or_expand
  17: <hir_expand::db::AstIdMapQuery as ra_salsa::plumbing::QueryFunction>::execute
  18: ra_salsa::Cycle::catch
  19: ra_salsa::derived::slot::Slot<Q>::read
  20: ra_salsa::derived::slot::Slot<Q>::read
  21: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  22: <DB as hir_expand::db::ExpandDatabase>::ast_id_map
  23: hir_def::item_tree::ItemTree::file_item_tree_with_source_map_query
  24: ra_salsa::Cycle::catch
  25: ra_salsa::derived::slot::Slot<Q>::read
  26: ra_salsa::derived::slot::Slot<Q>::read
  27: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  28: <DB as hir_def::db::DefDatabase>::file_item_tree_with_source_map
  29: ra_salsa::Cycle::catch
  30: ra_salsa::derived::slot::Slot<Q>::read
  31: ra_salsa::derived::slot::Slot<Q>::read
  32: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  33: <DB as hir_def::db::DefDatabase>::file_item_tree
  34: hir_def::nameres::collector::DefCollector::record_resolved_import
  35: hir_def::nameres::collector::collect_defs
  36: hir_def::nameres::DefMap::crate_def_map_query
  37: ra_salsa::Cycle::catch
  38: ra_salsa::derived::slot::Slot<Q>::read
  39: ra_salsa::derived::slot::Slot<Q>::read
  40: <ra_salsa::derived::DerivedStorage<Q> as ra_salsa::plumbing::QueryStorageOps<Q>>::fetch
  41: <DB as hir_def::db::DefDatabase>::crate_def_map
  42: hir::semantics::source_to_def::SourceToDefCtx::file_to_def
  43: hir::semantics::SemanticsImpl::file_to_module_defs
  44: hir::semantics::SemanticsImpl::attach_first_edition
  45: ide::inlay_hints::inlay_hints
  46: ide::Analysis::inlay_hints
  47: rust_analyzer::handlers::request::handle_inlay_hints
  48: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 4:58:06 PM] Request textDocument/inlayHint failed.
  Message: request handler panicked: called `Option::unwrap()` on a `None` value
  Code: -32603 

@danfabo danfabo added the C-bug Category: bug label Jan 9, 2025
@ChayimFriedman2
Copy link
Contributor

Are you sure it's not #18840? Try with the latest release.

@danfabo
Copy link
Author

danfabo commented Jan 9, 2025

Same problem with 0.4.2258-standalone (32b86a8 2025-01-08)

Fix for #18840 was merged before 0.3.2257 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants