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

Panic (Code: -32603) when editing proc-macro invocation #18513

Open
NekoiNemo opened this issue Nov 14, 2024 · 2 comments
Open

Panic (Code: -32603) when editing proc-macro invocation #18513

NekoiNemo opened this issue Nov 14, 2024 · 2 comments
Assignees
Labels
C-bug Category: bug

Comments

@NekoiNemo
Copy link

NekoiNemo commented Nov 14, 2024

rust-analyzer version: 0.3.2180-standalone

rustc version: 1.82.0 (f6e511eec 2024-10-15)

editor or extension: VSCode, v0.3.2180

Attempting to write/edit procedural macro invocation causes a immediate crash of RA

code snippet to reproduce:

[dependencies]
log = "0.4"
fn main() {
    log::error!("foo // attempting to finish this line will cause the panic
}

Log

Panic context:
> 
version: 0.3.2180-standalone
request: textDocument/diagnostic DocumentDiagnosticParams {
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/home/nekoinemo/projects/ra_fail/src/main.rs",
            query: None,
            fragment: None,
        },
    },
    identifier: None,
    previous_result_id: None,
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
}

thread 'Worker' panicked at /github/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/line-index-0.1.2/src/lib.rs:111:35:
invalid offset
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::option::expect_failed
   3: rust_analyzer::lsp::to_proto::range
   4: rust_analyzer::diagnostics::convert_diagnostic
   5: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
   6: alloc::vec::in_place_collect::<impl alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
   7: rust_analyzer::handlers::request::handle_document_diagnostics
   8: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 23:14:02] Request textDocument/diagnostic failed.
  Message: request handler panicked: invalid offset
  Code: -32603 
[Error - 23:14:02] Document pull failed for text document file:///home/nekoinemo/projects/ra_fail/src/main.rs
  Message: request handler panicked: invalid offset
  Code: -32603
@NekoiNemo NekoiNemo added the C-bug Category: bug label Nov 14, 2024
@NekoiNemo
Copy link
Author

Downgraded extension to v0.3.2154 and this no longer happens. Seems like the issue started with 2162

@ChayimFriedman2
Copy link
Contributor

@rustbot claim

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

No branches or pull requests

2 participants