use std::fmt::Debug; #[derive(Debug)] struct A where T: Debug { a: T, } impl A where T: Debug { fn a(a: T) -> Self { A { a: a, } } } impl B for A where T: Debug { fn a(&self) -> Option { None } } trait B : Debug where T: Debug { fn a(&self) -> Option; } impl B { fn a(&self) -> Option { None } }