mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-25 22:22:44 +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;
|
use xc::B;
|
||||||
|
|
||||||
|
struct A {
|
||||||
|
pub a: u32,
|
||||||
|
b: u32,
|
||||||
|
}
|
||||||
|
|
||||||
fn main () {
|
fn main () {
|
||||||
|
// external crate struct
|
||||||
let k = B {
|
let k = B {
|
||||||
aa: 20, //~ ERROR structure `struct-field-privacy::B` has no field named `aa`
|
aa: 20, //~ ERROR structure `struct-field-privacy::B` has no field named `aa`
|
||||||
//~^ HELP did you mean `a`?
|
//~^ HELP did you mean `a`?
|
||||||
bb: 20, //~ ERROR structure `struct-field-privacy::B` has no field named `bb`
|
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