rust/tests/ui/traits/bound/not-on-bare-trait-2021.rs

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

20 lines
461 B
Rust
Raw Normal View History

//@ edition:2021
trait Foo {
fn dummy(&self) {}
}
// This should emit the less confusing error, not the more confusing one.
fn foo(_x: Foo + Send) {
//~^ ERROR trait objects must include the `dyn` keyword
//~| ERROR size for values of type
}
fn bar(x: Foo) -> Foo {
//~^ ERROR trait objects must include the `dyn` keyword
//~| ERROR trait objects must include the `dyn` keyword
//~| ERROR size for values of type
x
}
fn main() {}