added local crate struct with priv field to test
This commit is contained in:
parent
85069e0529
commit
3419d51199
1 changed files with 13 additions and 0 deletions
|
@ -4,10 +4,23 @@ extern crate "struct-field-privacy" as xc;
|
|||
|
||||
use xc::B;
|
||||
|
||||
struct A {
|
||||
pub a: u32,
|
||||
b: u32,
|
||||
}
|
||||
|
||||
fn main () {
|
||||
// external crate struct
|
||||
let k = B {
|
||||
aa: 20, //~ ERROR structure `struct-field-privacy::B` has no field named `aa`
|
||||
//~^ HELP did you mean `a`?
|
||||
bb: 20, //~ ERROR structure `struct-field-privacy::B` has no field named `bb`
|
||||
};
|
||||
// local crate struct
|
||||
let l = A {
|
||||
aa: 20, //~ ERROR structure `A` has no field named `aa`
|
||||
//~^ HELP did you mean `a`?
|
||||
bb: 20, //~ ERROR structure `A` has no field named `bb`
|
||||
//~^ HELP did you mean `b`?
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue