-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # 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
A copy-pastable example: pub fn a() -> Box<dyn Fn(u8) + Clone> {
todo!()
} suggests |
Fn*
as supertrait Fn*
traits as supertrait s
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 |
# for free
to join this conversation on GitHub.
Already have an account?
# 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: