1 // It might be intuitive for a user coming from languages like Java
2 // to declare a method directly in a struct's definition. Make sure
3 // rustc can give a helpful suggestion.
4 // Suggested in issue #76421
9 //~^ ERROR functions are not allowed in struct definitions
10 //~| HELP unlike in C++, Java, and C#, functions are declared in `impl` blocks
11 //~| HELP see https://doc.rust-lang.org/book/ch05-03-method-syntax.html for more information