limit and delimit available fields in note
Also, don't show the note if no fields are available (usually due to privacy).
This commit is contained in:
parent
bf7e91f61d
commit
2dbfa3995e
11 changed files with 46 additions and 29 deletions
|
|
@ -16,5 +16,5 @@ fn main() {
|
|||
let s = Field::Fool { joke: 0 };
|
||||
//~^ ERROR E0559
|
||||
//~| NOTE `Field::Fool` does not have this field
|
||||
//~| NOTE available fields are: x
|
||||
//~| NOTE available fields are: `x`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@ fn main() {
|
|||
let s = Simba { mother: 1, father: 0 };
|
||||
//~^ ERROR E0560
|
||||
//~| NOTE `Simba` does not have this field
|
||||
//~| NOTE available fields are: mother
|
||||
//~| NOTE available fields are: `mother`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@ fn main() {
|
|||
let homura = Homura::Akemi { kaname: () };
|
||||
//~^ ERROR variant `Homura::Akemi` has no field named `kaname`
|
||||
//~| NOTE `Homura::Akemi` does not have this field
|
||||
//~| NOTE available fields are: madoka
|
||||
//~| NOTE available fields are: `madoka`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ fn main() {
|
|||
let s = S{0b1: 10, 0: 11};
|
||||
//~^ ERROR struct `S` has no field named `0b1`
|
||||
//~| NOTE `S` does not have this field
|
||||
//~| NOTE available fields are: 0, 1
|
||||
//~| NOTE available fields are: `0`, `1`
|
||||
match s {
|
||||
S{0: a, 0x1: b, ..} => {}
|
||||
//~^ ERROR does not have a field named `0x1`
|
||||
|
|
|
|||
|
|
@ -18,6 +18,6 @@ fn main() {
|
|||
bar: 0
|
||||
//~^ ERROR struct `BuildData` has no field named `bar`
|
||||
//~| NOTE `BuildData` does not have this field
|
||||
//~| NOTE available fields are: foo
|
||||
//~| NOTE available fields are: `foo`
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ fn main () {
|
|||
bb: 20,
|
||||
//~^ ERROR struct `xc::B` has no field named `bb`
|
||||
//~| NOTE `xc::B` does not have this field
|
||||
//~| NOTE available fields are: a
|
||||
//~| NOTE available fields are: `a`
|
||||
};
|
||||
// local crate struct
|
||||
let l = A {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ fn main() {
|
|||
let u = U { a: 0, b: 1, c: 2 }; //~ ERROR union expressions should have exactly one field
|
||||
//~^ ERROR union `U` has no field named `c`
|
||||
//~| NOTE `U` does not have this field
|
||||
//~| NOTE available fields are: a, b
|
||||
//~| NOTE available fields are: `a`, `b`
|
||||
let u = U { ..u }; //~ ERROR union expressions should have exactly one field
|
||||
//~^ ERROR functional record update syntax requires a struct
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue