You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::pin::Pin;structHello;implHello{pubfnfoo(self:Pin<&Self>){}}fnmain(){let h = Box::pin(Hello);
h.foo();}
As of Rust 1.48 we get the following (expected) error (and the same error is in nightly)
error[E0599]: no method named `foo` found for struct `Pin<Box<Hello>>` in the current scope
--> src/main.rs:9:7
|
9 | h.foo();
| ^^^ method not found in `Pin<Box<Hello>>`
Ideally, it would be great if the method exist with a different self type, the compiler would tell us that this method exist
Suggestion:
help: there is an associated function of the same name with a different self type: `Pin<&Hello>`
Even better would be if the compiler would know how to hint to use Pin::as_ref() in this case to fix the error. (A bit similar to #65409)
The text was updated successfully, but these errors were encountered:
Consider this code:
As of Rust 1.48 we get the following (expected) error (and the same error is in nightly)
Ideally, it would be great if the method exist with a different self type, the compiler would tell us that this method exist
Suggestion:
Even better would be if the compiler would know how to hint to use
Pin::as_ref()
in this case to fix the error. (A bit similar to #65409)The text was updated successfully, but these errors were encountered: