Closed
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
.