mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
18 lines
286 B
Rust
18 lines
286 B
Rust
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
|
|
}
|