2022-03-14 13:46:12 -05:00
|
|
|
//@ run-rustfix
|
|
|
|
#[derive(Debug, Default, Eq, PartialEq)]
|
|
|
|
struct A {
|
|
|
|
b: u32,
|
|
|
|
c: u64,
|
|
|
|
d: usize,
|
|
|
|
}
|
|
|
|
|
2022-08-09 02:04:37 -05:00
|
|
|
fn a() {
|
2022-11-16 13:10:38 -06:00
|
|
|
let q = A { c: 5, ..Default::default() };
|
|
|
|
//~^ ERROR missing fields
|
2022-03-14 13:46:12 -05:00
|
|
|
//~| HELP separate the last named field with a comma
|
2022-08-09 02:04:37 -05:00
|
|
|
let r = A { c: 5, ..Default::default() };
|
2022-03-14 13:46:12 -05:00
|
|
|
assert_eq!(q, r);
|
|
|
|
}
|
2022-08-09 02:04:37 -05:00
|
|
|
|
|
|
|
#[derive(Debug, Default, Eq, PartialEq)]
|
|
|
|
struct B {
|
|
|
|
b: u32,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn b() {
|
2022-11-16 13:10:38 -06:00
|
|
|
let q = B { b: 1, ..Default::default() };
|
2022-08-09 02:04:37 -05:00
|
|
|
//~^ ERROR mismatched types
|
|
|
|
//~| HELP separate the last named field with a comma
|
|
|
|
let r = B { b: 1 };
|
|
|
|
assert_eq!(q, r);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
a();
|
|
|
|
b();
|
|
|
|
}
|