rust/tests/ui/suggestions/dyn-incompatible-trait-should-use-self-2021-without-dyn.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
699 B
Rust
Raw Normal View History

//@ edition:2021
#![allow(bare_trait_objects)]
trait A: Sized {
fn f(a: A) -> A;
//~^ ERROR expected a type, found a trait
//~| ERROR expected a type, found a trait
2024-01-19 23:49:40 +00:00
//~| ERROR associated item referring to unboxed trait object for its own trait
}
trait B {
fn f(b: B) -> B;
//~^ ERROR expected a type, found a trait
//~| ERROR expected a type, found a trait
2024-01-19 23:49:40 +00:00
//~| ERROR associated item referring to unboxed trait object for its own trait
}
trait C {
fn f(&self, c: C) -> C;
//~^ ERROR expected a type, found a trait
//~| ERROR expected a type, found a trait
//~| ERROR associated item referring to unboxed trait object for its own trait
}
fn main() {}