mirror of
https://github.com/rust-lang/rust.git
synced 2025-09-30 16:26:10 +00:00
19 lines
381 B
Rust
19 lines
381 B
Rust
// Regression test for <https://github.com/rust-lang/rust/issues/141419>.
|
|
|
|
use std::ops::Deref;
|
|
|
|
struct W;
|
|
|
|
trait Foo: Deref<Target = W> {
|
|
fn method(self: &W) {}
|
|
//~^ ERROR invalid `self` parameter type: `&W`
|
|
}
|
|
|
|
fn test(x: &dyn Foo) {
|
|
//~^ ERROR the trait `Foo` is not dyn compatible
|
|
x.method();
|
|
//~^ ERROR the trait `Foo` is not dyn compatible
|
|
}
|
|
|
|
fn main() {}
|