Update the wording for E0063. This will truncate the fields to 3.

Instead of listing every field it will now show missing `a`, `z`, `b`, and 1 other field
This commit is contained in:
Jared Wyles 2016-08-06 08:26:09 +10:00
parent 1df64450ec
commit 0e32d11868
2 changed files with 71 additions and 13 deletions

View file

@ -8,11 +8,47 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
struct Foo {
x: i32,
y: i32
// ignore-tidy-linelength
struct SingleFoo {
x: i32
}
fn main() {
let x = Foo { x: 0 }; //~ ERROR E0063
struct PluralFoo {
x: i32,
y: i32,
z: i32
}
struct TruncatedFoo {
a: i32,
b: i32,
x: i32,
y: i32,
z: i32
}
struct TruncatedPluralFoo {
a: i32,
b: i32,
c: i32,
x: i32,
y: i32,
z: i32
}
fn main() {
let w = SingleFoo { };
//~^ ERROR missing field `x` in initializer of `SingleFoo`
//~| NOTE missing `x`
let x = PluralFoo {x: 1};
//~^ ERROR missing fields `y`, `z` in initializer of `PluralFoo`
//~| NOTE missing `y`, `z`
let y = TruncatedFoo{x:1};
//~^ missing fields `a`, `b`, `y` and 1 other field in initializer of `TruncatedFoo`
//~| NOTE `a`, `b`, `y` and 1 other field
let z = TruncatedPluralFoo{x:1};
//~^ ERROR missing fields `a`, `b`, `c` and 2 other fields in initializer of `TruncatedPluralFoo`
//~| NOTE missing `a`, `b`, `c` and 2 other fields
}