1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
// check-pass // revisions: current next //[next] compile-flags: -Znext-solver fn main() { let vec: Vec<Box<dyn Trait>> = Vec::new(); for i in vec { i.fn_2(); } } trait OtherTrait {} trait Trait { fn fn_1(&self) -> impl OtherTrait where Self: Sized; fn fn_2(&self) -> bool; }