]> git.proxmox.com Git - rustc.git/blob - src/doc/book/listings/ch19-advanced-features/listing-19-20/output.txt
New upstream version 1.67.1+dfsg1
[rustc.git] / src / doc / book / listings / ch19-advanced-features / listing-19-20 / output.txt
1 $ cargo run
2 Compiling traits-example v0.1.0 (file:///projects/traits-example)
3 error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
4 --> src/main.rs:20:43
5 |
6 2 | fn baby_name() -> String;
7 | ------------------------- `Animal::baby_name` defined here
8 ...
9 20 | println!("A baby dog is called a {}", Animal::baby_name());
10 | ^^^^^^^^^^^^^^^^^ cannot call associated function of trait
11 |
12 help: use the fully-qualified path to the only available implementation
13 |
14 20 | println!("A baby dog is called a {}", <::Dog as Animal>::baby_name());
15 | +++++++++ +
16
17 For more information about this error, try `rustc --explain E0790`.
18 error: could not compile `traits-example` due to previous error