2020-06-23 03:52:42 -05:00
|
|
|
#![feature(specialization)]
|
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
|
|
|
struct MyStruct {}
|
|
|
|
|
|
|
|
trait MyTrait {
|
|
|
|
type MyType: Default;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl MyTrait for i32 {
|
|
|
|
default type MyType = MyStruct;
|
2020-09-02 02:40:56 -05:00
|
|
|
//~^ ERROR: the trait bound `MyStruct: Default` is not satisfied
|
2020-06-23 03:52:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _x: <i32 as MyTrait>::MyType = <i32 as MyTrait>::MyType::default();
|
|
|
|
}
|