10 fn get_a(&self) -> &String;
13 trait UseString: std::fmt::Debug {
14 fn use_string(&self) {
15 println!("{:?}", self.get_a()); //~ ERROR no method named `get_a` found
20 fn use_string(&self) {
21 println!("{:?}", self.get_a()); //~ ERROR no method named `get_a` found
25 impl GetString for Demo {
26 fn get_a(&self) -> &String {
31 impl UseString for Demo {}
32 impl UseString2 for Demo {}
37 use crate::{Demo, UseString};
41 let d = Demo { a: "test".to_string() };