1 #![feature(associated_type_defaults)]
2 
3 // This used to cause an ICE because assoc. type defaults weren't properly
4 // type-checked.
5 
6 trait Foo<T: Default + ToString> {
7     type Out: Default + ToString + ?Sized = dyn ToString;  //~ ERROR not satisfied
8 }
9 
10 impl Foo<u32> for () {}
11 impl Foo<u64> for () {}
12 
main()13 fn main() {
14     assert_eq!(<() as Foo<u32>>::Out::default().to_string(), "false");
15     //~^ ERROR no function or associated item named `default` found for trait object
16 }
17