mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-24 06:24:35 +00:00
added local crate struct with priv field to test
This commit is contained in:
parent
85069e0529
commit
3419d51199
@ -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…
Reference in New Issue
Block a user