Skip to content
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

Warnings when it shouldn't #15039

Closed
Migorithm opened this issue Jun 13, 2023 · 4 comments · Fixed by #15040
Closed

Warnings when it shouldn't #15039

Migorithm opened this issue Jun 13, 2023 · 4 comments · Fixed by #15040
Labels
C-bug Category: bug

Comments

@Migorithm
Copy link

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)

rustc version: (eg. output of rustc -V)

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)

Version

  • 3.1549

Problem

  • it warns when using derive Hash on enum and it is used in different type

Minimum Reproducible Example

#[derive(Eq,Hash,PartialEq)]
enum State{
    A,
    B,
    C
}

#[derive(Eq,Hash,PartialEq)]
struct User{
    state : State,
    name : String,
}

You will get scribbly line on derive part of User type.

@Migorithm Migorithm added the C-bug Category: bug label Jun 13, 2023
@lnicola
Copy link
Member

lnicola commented Jun 13, 2023

What do the errors say, and what is your rustc version?

@Migorithm
Copy link
Author

@lnicola

The error says: "expected &mut {unknown}, found &State"

And my current rustc version is 1.70.0.

@lnicola
Copy link
Member

lnicola commented Jun 13, 2023

Duplicate of #14860 / #11681.

@lnicola lnicola closed this as completed Jun 13, 2023
@lnicola lnicola reopened this Jun 13, 2023
@lnicola
Copy link
Member

lnicola commented Jun 13, 2023

Actually, we can probably work around this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants