20 lines
533 B
Rust
20 lines
533 B
Rust
|
|
// edition:2021
|
||
|
|
#![allow(bare_trait_objects)]
|
||
|
|
trait A: Sized {
|
||
|
|
fn f(a: A) -> A;
|
||
|
|
//~^ ERROR trait objects must include the `dyn` keyword
|
||
|
|
//~| ERROR trait objects must include the `dyn` keyword
|
||
|
|
}
|
||
|
|
trait B {
|
||
|
|
fn f(a: B) -> B;
|
||
|
|
//~^ ERROR trait objects must include the `dyn` keyword
|
||
|
|
//~| ERROR trait objects must include the `dyn` keyword
|
||
|
|
}
|
||
|
|
trait C {
|
||
|
|
fn f(&self, a: C) -> C;
|
||
|
|
//~^ ERROR trait objects must include the `dyn` keyword
|
||
|
|
//~| ERROR trait objects must include the `dyn` keyword
|
||
|
|
}
|
||
|
|
|
||
|
|
fn main() {}
|