]> git.lizzy.rs Git - rust.git/blob - tests/ui/specialization/issue-59435.rs
Rollup merge of #106638 - RalfJung:realstd, r=thomcc
[rust.git] / tests / ui / specialization / issue-59435.rs
1 #![feature(specialization)]
2 #![allow(incomplete_features)]
3
4 struct MyStruct {}
5
6 trait MyTrait {
7     type MyType: Default;
8 }
9
10 impl MyTrait for i32 {
11     default type MyType = MyStruct;
12     //~^ ERROR: the trait bound `MyStruct: Default` is not satisfied
13 }
14
15 fn main() {
16     let _x: <i32 as MyTrait>::MyType = <i32 as MyTrait>::MyType::default();
17 }