]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/issue-43924.rs
Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyup
[rust.git] / src / test / ui / associated-types / issue-43924.rs
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 () {}  //~ error: not satisfied
11 impl Foo<u64> for () {}  //~ error: not satisfied
12
13 fn main() {
14     assert_eq!(<() as Foo<u32>>::Out::default().to_string(), "false");
15 }