Files
rust/tests/ui/suggestions/dyn-incompatible-trait-references-self.rs

16 lines
428 B
Rust
Raw Normal View History

2020-01-31 19:04:58 -08:00
trait Trait {
fn baz(&self, _: Self) {}
//~^ ERROR the size for values of type `Self` cannot be known
2020-01-31 19:04:58 -08:00
fn bat(&self) -> Self {}
//~^ ERROR mismatched types
//~| ERROR the size for values of type `Self` cannot be known
2020-01-31 19:04:58 -08:00
}
fn bar(x: &dyn Trait) {} //~ ERROR the trait `Trait` is not dyn compatible
2020-01-31 19:04:58 -08:00
trait Other: Sized {}
fn foo(x: &dyn Other) {} //~ ERROR the trait `Other` is not dyn compatible
2020-01-31 19:04:58 -08:00
fn main() {}