Incorrect syntax when suggesting the use of Fn*
traits as supertraits · Issue #118225 · rust-lang/rust (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
Code
Box<dyn Fn(Vec<AstValueExpr>)->AstValueExpr + Clone>
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
However, the use of Fn*
series traits should be used as Fn(Vec<AstValueExpr>)
, that is, the correct suggestion should be trait NewTrait: Fn(Vec<AstValueExpr>)->AstValueExpr + Clone{}
Rationale and extra context
Other cases
No response
Anything else?
No response