-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Incorrect syntax when suggesting the use of Fn*
traits as supertraits
#118225
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
xmh0511
added
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Nov 24, 2023
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Nov 24, 2023
A copy-pastable example: pub fn a() -> Box<dyn Fn(u8) + Clone> {
todo!()
} suggests |
clubby789
added
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Nov 24, 2023
clubby789
changed the title
A wrong suggestion to use
Incorrect syntax when suggesting the use of Nov 24, 2023
Fn*
as supertrait Fn*
traits as supertrait s
clubby789
changed the title
Incorrect syntax when suggesting the use of
Incorrect syntax when suggesting the use of Nov 24, 2023
Fn*
traits as supertrait sFn*
traits as supertraits
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 29, 2023
…tebank Pretty print `Fn<(..., ...)>` trait refs with parentheses (almost) always It's almost always better, at least in diagnostics, to print `Fn(i32, u32)` instead of `Fn<(i32, u32)>`. Related to but doesn't fix rust-lang#118225. That needs a separate fix.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 29, 2023
…tebank Pretty print `Fn<(..., ...)>` trait refs with parentheses (almost) always It's almost always better, at least in diagnostics, to print `Fn(i32, u32)` instead of `Fn<(i32, u32)>`. Related to but doesn't fix rust-lang#118225. That needs a separate fix.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Dec 5, 2023
…tebank Pretty print `Fn<(..., ...)>` trait refs with parentheses (almost) always It's almost always better, at least in diagnostics, to print `Fn(i32, u32)` instead of `Fn<(i32, u32)>`. Related to but doesn't fix rust-lang#118225. That needs a separate fix.
compiler-errors
added a commit
to compiler-errors/rust
that referenced
this issue
Dec 5, 2023
…tebank Pretty print `Fn<(..., ...)>` trait refs with parentheses (almost) always It's almost always better, at least in diagnostics, to print `Fn(i32, u32)` instead of `Fn<(i32, u32)>`. Related to but doesn't fix rust-lang#118225. That needs a separate fix.
compiler-errors
added a commit
to compiler-errors/rust
that referenced
this issue
Dec 5, 2023
…tebank Pretty print `Fn<(..., ...)>` trait refs with parentheses (almost) always It's almost always better, at least in diagnostics, to print `Fn(i32, u32)` instead of `Fn<(i32, u32)>`. Related to but doesn't fix rust-lang#118225. That needs a separate fix.
compiler-errors
added a commit
to compiler-errors/rust
that referenced
this issue
Dec 5, 2023
…tebank Pretty print `Fn<(..., ...)>` trait refs with parentheses (almost) always It's almost always better, at least in diagnostics, to print `Fn(i32, u32)` instead of `Fn<(i32, u32)>`. Related to but doesn't fix rust-lang#118225. That needs a separate fix.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Dec 6, 2023
Rollup merge of rust-lang#118268 - compiler-errors:pretty-print, r=estebank Pretty print `Fn<(..., ...)>` trait refs with parentheses (almost) always It's almost always better, at least in diagnostics, to print `Fn(i32, u32)` instead of `Fn<(i32, u32)>`. Related to but doesn't fix rust-lang#118225. That needs a separate fix.
Oops, this shouldn't have closed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
The diagnosis suggests writing this code: only auto traits can be used as additional traits in a trait object consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Fn<(Vec<AstValueExpr>, )>+ Clone {}`
Desired output
Rationale and extra context
Other cases
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: