mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
28 lines
552 B
Rust
28 lines
552 B
Rust
trait Marker {}
|
|
impl Marker for u32 {}
|
|
|
|
trait MyTrait {
|
|
fn foo(&self) -> impl Marker
|
|
where
|
|
Self: Sized;
|
|
}
|
|
|
|
struct Outer;
|
|
|
|
impl MyTrait for Outer {
|
|
fn foo(&self) -> impl Marker {
|
|
42
|
|
}
|
|
}
|
|
|
|
impl dyn MyTrait {
|
|
fn other(&self) -> impl Marker {
|
|
MyTrait::foo(&self)
|
|
//~^ ERROR the trait bound `&dyn MyTrait: MyTrait` is not satisfied
|
|
//~| ERROR the trait bound `&dyn MyTrait: MyTrait` is not satisfied
|
|
//~| ERROR the trait bound `&dyn MyTrait: MyTrait` is not satisfied
|
|
}
|
|
}
|
|
|
|
fn main() {}
|