1 // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
15 pub favorite_integer: isize,
16 secret_integer: isize,
17 pub innocently_misspellable: (),
19 yet_another_field: bool,
20 always_more_fields: bool,
25 fn new_with_secret_two() -> Self {
26 Self { secret_integer: 2, inocently_mispellable: () }
29 fn new_with_secret_three() -> Self {
30 Self { secret_integer: 3, egregiously_nonexistent_field: () }
39 let demo = Demo::default();
40 let innocent_field_misaccess = demo.inocently_mispellable;
41 // note shouldn't suggest private fields
42 let egregious_field_misaccess = demo.egregiously_nonexistent_field;