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

Missing PartialEq for function pointers containing &mut #74776

Closed
kstrafe opened this issue Jul 26, 2020 · 2 comments
Closed

Missing PartialEq for function pointers containing &mut #74776

kstrafe opened this issue Jul 26, 2020 · 2 comments
Labels
C-bug Category: This is a bug.

Comments

@kstrafe
Copy link

kstrafe commented Jul 26, 2020

I tried this code:

fn main() {
    fn f(_: &mut ()) {}
    let x: fn(&mut ()) = f;
    let y: fn(&mut ()) = f;
    y == x;
}

I expected to see this happen: Successful compile.

Instead, this happened:

error[E0369]: binary operation `==` cannot be applied to type `for<'r> fn(&'r mut ())`
  --> src/main.rs:94:7
   |
94 |     y == x;
   |     - ^^ - for<'r> fn(&'r mut ())
   |     |
   |     for<'r> fn(&'r mut ())

error: aborting due to previous error

For more information about this error, try `rustc --explain E0369`.
error: could not compile `executor`.

To learn more, run the command again with --verbose.

Meta

rustc --version --verbose:

rustc 1.46.0-nightly (6bb3dbfc6 2020-06-22)
@kstrafe kstrafe added the C-bug Category: This is a bug. label Jul 26, 2020
@WaffleLapkin
Copy link
Member

Duplicate of #54508

@kstrafe
Copy link
Author

kstrafe commented Jul 26, 2020

Closed in light of @WaffleLapkin's comment

@kstrafe kstrafe closed this as completed Jul 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants