added local crate struct with priv field to test

This commit is contained in:
Junseok Lee 2015-02-18 17:58:15 -08:00
parent 85069e0529
commit 3419d51199

View File

@ -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`?
};
}