-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 '<unnamed>' panicked at 'index out of bounds: the len is 1 but the index is 1', crates/hir/src/semantics.rs:934:36 #11298
Comments
Ah, ye this seems to happen with |
Ye the problem is this here https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/attr.rs#L87-L93 |
11334: fix: don't panic in semantics due to `cfg_attr` disrupting offsets r=Veykril a=Veykril Reduces the panic in #11298 to an early return, that means we won't resolve these cases again for now, but this is better than constantly panicking in highlighting and hovering. bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-01-24 11334: fix: don't panic in semantics due to `cfg_attr` disrupting offsets Reduces the panic in rust-lang/rust-analyzer#11298 to an early return, that means we won't resolve these cases again for now, but this is better than constantly panicking in highlighting and hovering. 2022-01-17 11287: fix: rust-analyzer spamming overly error message when workspace not being loaded Fixes #10120
The panic was fixed by #11334 |
2022-01-31 fix: Fix `cfg_attr` invalidating derive identifier IDE functionalities r=Veykril a=Veykril Proper fix for rust-lang/rust-analyzer#11298 bors r+
rust-analyzer version: 7a52f83 2022-01-16 nightly
rustc version: rustc 1.60.0-nightly (ec4bcaac4 2022-01-15)
What's happening: VSCode keeps saying
A request has failed. See the output for more information.
when scrolling or triggering highlight in a file containg some code snippet.Code to reproduce this:
Backtrace:
Information maybe useful:
This panic only happens when
#[cfg_attr]
is placed in front of a#[derive]
. If the order is reversed then everything works. I also found a colorized tokenization difference:#[derive]
is placed in front of#[cfg_attr]
. Everything works and VSCode'sInspect editor tokens and scopes
works properly.#[cfg_attr]
is placed in front of#[derive]
. This will cause a panic andInspect editor tokens and scopes
does not work either.The text was updated successfully, but these errors were encountered: