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
summary: rust-analyzer gives a diagnostic with severity of Error that a struct field doesn't exist at a point of use of the field, but the field does in fact exist, and the use is correct, and building the crate with cargo build or cargo check succeeds without issue.
rust-analyzer version: (03d2d90 2024-03-11) or 1.76.0 (07dca48 2024-02-04)
I tried to make a simpler reproduction but didn't find one. The bug seems to be triggered by the specific nature of what I did in my crate. My crate is relatively simple already and doesn't have dependencies.
In the below, the issue at hand is the Diagnostic with message: "no field `namespace_id` on type `&Entry<N, S, Pe, D>`".
(When I'd first encountered this bug, it was not with the rust-analyzer diagnostics CLI, it was with using rust-analyzer normally as an LSP server with my editor (Emacs with lsp-mode) where it shows the same diagnostic error message.)
The text was updated successfully, but these errors were encountered:
DerickEddington
changed the title
"no field on type" error, but field does exist correctly
"no field on type" error diagnostic, but field does exist correctly
Mar 11, 2024
You can work around this by writing let entry: &Entry<N, S, Pe, D> = entry.borrow();, which is a little surprising since we already show that as an inlay hint.
summary: rust-analyzer gives a diagnostic with severity of Error that a struct field doesn't exist at a point of use of the field, but the field does in fact exist, and the use is correct, and building the crate with
cargo build
orcargo check
succeeds without issue.rust-analyzer version:
(03d2d90 2024-03-11)
or1.76.0 (07dca48 2024-02-04)
rustc version:
1.76.0 (07dca489a 2024-02-04)
repository link: https://github.com/DerickEddington/sailce/blob/71aaaa2dafeccab8a5b7cd9fe00f4fffee4c1fdd/crates/data_model/src/group/area/of_interest.rs#L59
code snippet to reproduce:
I tried to make a simpler reproduction but didn't find one. The bug seems to be triggered by the specific nature of what I did in my crate. My crate is relatively simple already and doesn't have dependencies.
In the below, the issue at hand is the
Diagnostic
withmessage: "no field `namespace_id` on type `&Entry<N, S, Pe, D>`"
.(When I'd first encountered this bug, it was not with the
rust-analyzer diagnostics
CLI, it was with using rust-analyzer normally as an LSP server with my editor (Emacs withlsp-mode
) where it shows the same diagnostic error message.)The text was updated successfully, but these errors were encountered: