-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Given the following code:
fn make() -> Option<_> {}
The current output is:
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
--> src/lib.rs:1:21
|
1 | fn make() -> Option<_> {}
| -------^-
| | |
| | not allowed in type signatures
| help: replace with the correct return type: `Option<[type error]>`
Ideally the output should look like:
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
--> src/lib.rs:1:21
|
1 | fn make() -> Option<_> {}
| -------^-
| | |
| | not allowed in type signatures
| help: put a fully specified type here
this issue might be related/helpful.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.