-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Incorrect understanding of private member access for locally defined structs within blocks #14047
Comments
I'm having this issue as well when using |
I'm also observing this behavior when using |
To the |
@Veykril was there a fix in RA that resolved the original issue? That PR I submitted to the rtt-target repo fixes the issue from that side in newer versions, but I think it would still reproduce with an older pinned version (though I have not verified) |
I got the |
Sorry I didn't realize this was "fixed" in a new rtt-target version, I'll try it out on an earlier version then. |
Okay, minimal repro: fn main() {
let strukt = {
use crate as ForceParentBlockDefMap;
{
pub struct Struct {
field: (),
}
Struct { field: () }
}
};
strukt.field;
} |
Thank you! |
Thanks! |
rust-analyzer version: rust-analyzer version: 0.3.1377-standalone (daa0138 2023-01-21)
rustc version: rustc 1.69.0-nightly (5e37043d6 2023-01-22)
This is mostly copied from my issue here: probe-rs/rtt-target#30
RA seems to struggle with expanded private members within blocks. Example code, with dependencies
cortex-m-runtime
andrtt-target
with thecortex-m
feature:RA claims that a private member cannot be accessed, and places the error squiggle over
#[cortex_m_rt::entry]
There are two errors here:
rtt_init_print
macro and notcortex_m_rt::entry
.Relevant section of expansion:
Full expansion
The text was updated successfully, but these errors were encountered: