2020-02-01 03:04:58 +00:00
|
|
|
trait Trait {
|
|
|
|
fn baz(&self, _: Self) {}
|
2024-02-09 12:17:55 +00:00
|
|
|
//~^ ERROR the size for values of type `Self` cannot be known
|
2020-02-01 03:04:58 +00:00
|
|
|
fn bat(&self) -> Self {}
|
2024-02-09 12:17:55 +00:00
|
|
|
//~^ ERROR mismatched types
|
|
|
|
//~| ERROR the size for values of type `Self` cannot be known
|
2020-02-01 03:04:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn bar(x: &dyn Trait) {} //~ ERROR the trait `Trait` cannot be made into an object
|
|
|
|
|
|
|
|
trait Other: Sized {}
|
|
|
|
|
|
|
|
fn foo(x: &dyn Other) {} //~ ERROR the trait `Other` cannot be made into an object
|
|
|
|
|
|
|
|
fn main() {}
|