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

Error[E0658] is broken #72611

Closed
Ogromny opened this issue May 26, 2020 · 0 comments · Fixed by #72668
Closed

Error[E0658] is broken #72611

Ogromny opened this issue May 26, 2020 · 0 comments · Fixed by #72668
Labels
A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` C-bug Category: This is a bug. D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Ogromny
Copy link

Ogromny commented May 26, 2020

fn apply_to_3<F>(f: F) -> i32 where
    F: Fn<i32, Output=i32> {
    f(3)
}

doesn't compile, it's normal but, the error message isn't right:

error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change
  --> src/main.rs:12:8
   |
12 |     F: Fn<i32, Output=i32> {
   |        ^^ help: use parenthetical notation instead: `Fni32 -> i32`
   |
   = note: see issue #29625 <https://github.com/rust-lang/rust/issues/29625> for more information

Fni32 -> i32 is missing parentheses. And E0658 is not an error about Fn-family traits.

@jonas-schievink jonas-schievink added A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` C-bug Category: This is a bug. D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 26, 2020
@bors bors closed this as completed in 65a02f1 May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` C-bug Category: This is a bug. D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants