You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am hitting a crash in rust-analyzer with some unreachable code inside a crate, which is part of a workspace. I minimized it to the following setup, with no dependencies:
[package]
name = "ra-crash"version = "0.1.0"edition = "2021"
[dependencies]
ra-crash/src/lib.rs
pubfnf(){panic!();for _ in0..2{}}
When opening the project in vscode, and when clicking/modifying lib.rs in any way, I get this stacktrace:
Panic context:
> publish_diagnostics
thread 'Worker' panicked at 'called `Result::unwrap()` on an `Err` value: SyntheticSyntax', crates/hir/src/lib.rs:2823:61
stack backtrace:
0: rust_begin_unwind
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:578:5
1: core::panicking::panic_fmt
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:67:14
2: core::result::unwrap_failed
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/result.rs:1687:5
3: hir::Local::primary_source
4: ide_diagnostics::handlers::mutability_errors::unused_mut
5: ide_diagnostics::diagnostics
6: std::panicking::try
7: ide::Analysis::diagnostics
8: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
9: alloc::vec::in_place_collect::<impl alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
10: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
The same behaviour happens with a binary crate (renaming lib.rs to main.rs), but it does not crash if the crate is by itself and not inside a workspace. Commenting out the panic!() call also stops the crash from happening.
I'm happy to help to get this fixed, but have never touched the rust-analyzer codebase, so I'd need a few pointers to fix this on my own (and it might be faster if someone else is available to work on it). Please let me know if/how I should provide more details as well.
The text was updated successfully, but these errors were encountered:
rust-analyzer version: 0.3.1557-standalone
rustc version: rustc 1.70.0 (90c541806 2023-05-31)
relevant settings: All default settings
Hi,
I am hitting a crash in rust-analyzer with some unreachable code inside a crate, which is part of a workspace. I minimized it to the following setup, with no dependencies:
Cargo.toml
ra-crash/Cargo.toml
ra-crash/src/lib.rs
When opening the project in vscode, and when clicking/modifying
lib.rs
in any way, I get this stacktrace:The crash happens at an
unwrap()
with a suspicious looking comment: https://github.com/rust-lang/rust-analyzer/blob/master/crates/hir/src/lib.rs#L2823The same behaviour happens with a binary crate (renaming
lib.rs
tomain.rs
), but it does not crash if the crate is by itself and not inside a workspace. Commenting out thepanic!()
call also stops the crash from happening.I'm happy to help to get this fixed, but have never touched the rust-analyzer codebase, so I'd need a few pointers to fix this on my own (and it might be faster if someone else is available to work on it). Please let me know if/how I should provide more details as well.
The text was updated successfully, but these errors were encountered: