We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22e8175 commit ed778f9Copy full SHA for ed778f9
src/test/compile-fail/suggest-private-fields.rs
@@ -4,10 +4,23 @@ extern crate "struct-field-privacy" as xc;
4
5
use xc::B;
6
7
+struct A {
8
+ pub a: u32,
9
+ b: u32,
10
+}
11
+
12
fn main () {
13
+ // external crate struct
14
let k = B {
15
aa: 20, //~ ERROR structure `struct-field-privacy::B` has no field named `aa`
16
//~^ HELP did you mean `a`?
17
bb: 20, //~ ERROR structure `struct-field-privacy::B` has no field named `bb`
18
};
19
+ // local crate struct
20
+ let l = A {
21
+ aa: 20, //~ ERROR structure `A` has no field named `aa`
22
+ //~^ HELP did you mean `a`?
23
+ bb: 20, //~ ERROR structure `A` has no field named `bb`
24
+ //~^ HELP did you mean `b`?
25
+ };
26
}
0 commit comments