Skip to content

False type-mismatch for derive(Hash) for structs with fields called "state" #14860

Closed as not planned
@valyagolev

Description

@valyagolev

As minimal reproduction as it gets: cargo new --lib repro, then:

#[derive(Hash)]
pub enum BgGameState {
    Over, // you can comment it out as well
}

#[derive(Hash)]
pub struct BgGame {
    pub state: BgGameState, // rename it, it will go away
}
repro

rust-analyzer version: 0.4.1521-standalone, also some earlier versions

rustc version: tried with rustc 1.69.0 (84c898d65 2023-04-16), rustc 1.71.0-nightly (521f4dae1 2023-05-19), also some earlier versions

relevant settings: It's VS Code remote on my box, via SSH, but I've been running it without issues for many months

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macromacro expansionC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions