mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
Add test for issue-59435
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#![feature(specialization)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
struct MyStruct {}
|
||||
|
||||
trait MyTrait {
|
||||
type MyType: Default;
|
||||
}
|
||||
|
||||
impl MyTrait for i32 {
|
||||
default type MyType = MyStruct;
|
||||
//~^ ERROR: the trait bound `MyStruct: std::default::Default` is not satisfied
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _x: <i32 as MyTrait>::MyType = <i32 as MyTrait>::MyType::default();
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
error[E0277]: the trait bound `MyStruct: std::default::Default` is not satisfied
|
||||
--> $DIR/issue-59435.rs:11:5
|
||||
|
|
||||
LL | type MyType: Default;
|
||||
| --------------------- required by `MyTrait::MyType`
|
||||
...
|
||||
LL | default type MyType = MyStruct;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::default::Default` is not implemented for `MyStruct`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
Reference in New Issue
Block a user