E0310 - Invalid suggestion when type is a function with a dyn
return type
#120223
Labels
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.
Code
Current output
Desired output
Rationale and extra context
The issue is that the diagnostic suggests adding
+ 'static
However performing this modification exactly as specified results in a syntax error:
And then if you follow this syntax error's suggestion, you get back to the original state:
However if instead it suggested wrapping the return value in
()
and then adding+ static
- you'd get to the right state immediately (I think? I'm still a rust newbie)Other cases
No response
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: