-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-verboseDiagnostics: Too much output caused by a single piece of incorrect code.Diagnostics: Too much output caused by a single piece of 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
The following code:
struct Foo {
val: MissingType
}
fn make_it() {
Foo { val: Default::default() };
}
produces the following errors:
error[E0412]: cannot find type `MissingType` in this scope
--> src/lib.rs:2:10
|
2 | val: MissingType
| ^^^^^^^^^^^ not found in this scope
error[E0283]: type annotations needed
--> src/lib.rs:6:16
|
6 | Foo { val: Default::default() };
| ^^^^^^^^^^^^^^^^ cannot infer type
|
= note: cannot satisfy `_: std::default::Default`
= note: required by `std::default::Default::default`
We should suppress the 'type annotations needed' message, since it will likely be resolved by fixing the type of val
.
estebank
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-verboseDiagnostics: Too much output caused by a single piece of incorrect code.Diagnostics: Too much output caused by a single piece of 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.