1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
use std::fmt::Debug; fn main() { let p = test::<Person>(); } fn test<F>() -> impl Debug { Person } trait Fly {} #[derive(Debug)] struct Person; impl Fly for Person {}