// build-pass (FIXME(62277): could be check-pass?) #![feature(associated_type_bounds)] trait Tr1: Sized { type As1; } trait Tr2<'a>: Sized { type As2; } trait ObjTr1 { fn foo() -> Self where Self: Tr1; } fn _assert_obj_safe_1(_: Box) {} trait ObjTr2 { fn foo() -> Self where Self: Tr1; } fn _assert_obj_safe_2(_: Box) {} trait ObjTr3 { fn foo() -> Self where Self: Tr1 + 'static + Copy>; } fn _assert_obj_safe_3(_: Box) {} trait ObjTr4 { fn foo() -> Self where Self: Tr1 Tr2<'a>>; } fn _assert_obj_safe_4(_: Box) {} trait ObjTr5 { fn foo() -> Self where for<'a> Self: Tr1>; } fn _assert_obj_safe_5(_: Box) {} trait ObjTr6 { fn foo() -> Self where Self: for<'a> Tr1 Tr2<'b>>>; } fn _assert_obj_safe_6(_: Box) {} fn main() {}