Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRusttrait objects dyn vs genericsSingle-choice MCQ

Which of these traits is NOT object-safe and therefore cannot be used as `dyn Trait`?

trait A { fn clone_box(&self) -> Box<dyn A>; } trait B { fn make() -> Self; } trait C { fn name(&self) -> &str; } trait D { fn run(&self, x: i32); }