]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/issue-43924.rs
Rollup merge of #76468 - SNCPlay42:lifetime-names, r=Mark-Simulacrum
[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 () {}
11 impl Foo<u64> for () {}
12
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 }