Add test for issue-75707

This commit is contained in:
Yuki Okushi 2020-10-15 08:36:16 +09:00
parent fc3a5dc6b4
commit 23092c7491
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,17 @@
pub trait Callback {
fn cb();
}
pub trait Processing {
type Call: Callback;
}
fn f<P: Processing + ?Sized>() {
P::Call::cb();
}
fn main() {
struct MyCall;
f::<dyn Processing<Call = MyCall>>();
//~^ ERROR: the trait bound `MyCall: Callback` is not satisfied
}

View File

@ -0,0 +1,12 @@
error[E0277]: the trait bound `MyCall: Callback` is not satisfied
--> $DIR/issue-75707.rs:15:5
|
LL | fn f<P: Processing + ?Sized>() {
| ---------- required by this bound in `f`
...
LL | f::<dyn Processing<Call = MyCall>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Callback` is not implemented for `MyCall`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.