]> git.lizzy.rs Git - rust.git/blob - tests/ui/confuse-field-and-method/private-field.rs
Rollup merge of #107201 - compiler-errors:confusing-async-fn-note, r=estebank
[rust.git] / tests / ui / confuse-field-and-method / private-field.rs
1 pub mod animal {
2     pub struct Dog {
3         pub age: usize,
4         dog_age: usize,
5     }
6
7     impl Dog {
8         pub fn new(age: usize) -> Dog {
9             Dog { age: age, dog_age: age * 7 }
10         }
11     }
12 }
13
14 fn main() {
15     let dog = animal::Dog::new(3);
16     let dog_age = dog.dog_age(); //~ ERROR no method
17     //let dog_age = dog.dog_age;
18     println!("{}", dog_age);
19 }