Account for arbitrary self types in E0599
This commit is contained in:
parent
392d853589
commit
01286408c1
4 changed files with 60 additions and 17 deletions
|
|
@ -1,13 +1,11 @@
|
|||
error[E0599]: no method named `foo` found for reference `&dyn Foo` in the current scope
|
||||
--> $DIR/issue-5153.rs:10:27
|
||||
|
|
||||
LL | trait Foo {
|
||||
| --------- `Foo` defines an item `foo`, perhaps you need to implement it
|
||||
LL | fn foo(self: Box<Self>);
|
||||
| --------- the method might not be found because of this arbitrary self type
|
||||
...
|
||||
LL | (&5isize as &dyn Foo).foo();
|
||||
| ^^^ method not found in `&dyn Foo`
|
||||
|
|
||||
= help: items from traits can only be used if the trait is implemented and in scope
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue