Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRustgeneric bounds and whereSingle-choice MCQ

Why does the second impl block below fail to compile while the first is fine?

struct Wrapper<T>(T); impl<T: Clone> Wrapper<T> { fn dup(&self) -> (T, T) { (self.0.clone(), self.0.clone()) } } impl<T> Wrapper<T> where T: Clone { fn dup(&self) -> (T, T) { (self.0.clone(), self.0.clone()) } }