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

What is the key reason this generic function can be monomorphized but its `dyn` equivalent cannot use the same calling mechanism?

fn print_all<T: std::fmt::Display>(items: &[T]) { for i in items { println!("{i}"); } }