Skip to content

False positive private-assoc-item error #14046

Closed
@EFanZh

Description

@EFanZh
  • rust-analyzer version: 0.3.1377-standalone (daa0138 2023-01-21)
  • rustc version: 1.67.0 (fc594f156 2023-01-24)

Create a project with the following code in src/main.rs:

mod foo {
    pub struct Foo;

    const _: () = {
        impl Foo {
            pub(crate) fn bar(self) {}
        }
    };
}

fn main() {
    foo::Foo.bar()
}

cargo run executes successfully, but I get the following error in the IDE:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsdiagnostics / error reportingA-nameresname, path and module resolutionC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions