]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-suggest-field.rs
Merge commit '3e7c6dec244539970b593824334876f8b6ed0b18' into clippyup
[rust.git] / src / test / ui / union / union-suggest-field.rs
1 union U {
2     principal: u8,
3 }
4
5 impl U {
6     fn calculate(&self) {}
7 }
8
9 fn main() {
10     let u = U { principle: 0 };
11     //~^ ERROR union `U` has no field named `principle`
12     //~| HELP a field with a similar name exists
13     //~| SUGGESTION principal
14     let w = u.principial; //~ ERROR no field `principial` on type `U`
15                           //~| HELP a field with a similar name exists
16                           //~| SUGGESTION principal
17
18     let y = u.calculate; //~ ERROR attempted to take value of method `calculate` on type `U`
19                          //~| HELP use parentheses to call the method
20                          //~| SUGGESTION ()
21 }