Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRustObject safety rulesSingle-choice MCQ

Rust now allows certain dyn-compatible traits to have methods returning `impl Trait` or to be used as `dyn Trait` where the trait itself has a supertrait. Considering a trait with a method `fn make() -> Self;` (no receiver), why is it specifically not dyn-compatible?

trait Factory { fn make() -> Self; } fn build(_: &dyn Factory) {}