Closed
Description
Given the following code: [Playground]
#[derive(Default)]
struct Defaultable;
#[derive(Default)]
struct HoldsDefaultable {
defaultable: Defaultable,
}
fn main() {
HoldsDefaultable {
defaultable: Defaultable
..Default::default()
};
}
The current output is:
Compiling playground v0.0.1 (/playground)
error[[E0308]](https://doc.rust-lang.org/stable/error-index.html#E0308): mismatched types
--> src/main.rs:11:20
|
11 | defaultable: Defaultable
| ____________________^
12 | | ..Default::default()
| |__________________________^ expected struct `Defaultable`, found struct `std::ops::Range`
|
= note: expected struct `Defaultable`
found struct `std::ops::Range<Defaultable>`
For more information about this error, try `rustc --explain E0308`.
error: could not compile `playground` due to previous error
Ideally the output should suggest adding a comma after Defaultable
on line 11 if doing so would solve the type error.