-
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.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
#[derive(Default)]
struct A {
b: u32,
c: u64,
d: usize,
}
fn main() {
let q = A { c: 5 .. Default::default() };
}
error[E0308]: mismatched types
--> src/main.rs:9:20
|
9 | let q = A { c: 5 .. Default::default() };
| ^^^^^^^^^^^^^^^^^^^^^^^ expected u64, found struct `std::ops::Range`
|
= note: expected type `u64`
found type `std::ops::Range<{integer}>`
error[E0063]: missing fields `b`, `d` in initializer of `A`
--> src/main.rs:9:13
|
9 | let q = A { c: 5 .. Default::default() };
| ^ missing `b`, `d`
error: aborting due to 2 previous errors
Maybe it should suggest proper syntax when there are both missing fields and std::ops::Range
-related error somewhere?
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.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.