Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyRusttraits basics and implSingle-choice MCQ

This code fails to compile. What is the reason?

// trait Greet { fn greet(&self) -> String; } // impl Greet for Person defined in another module, not imported let p = Person { name: "Ada".into() }; let s = p.greet(); // error: no method named `greet`