Closed iamnhphu closed 4 years ago
.project()
returns a different type from self
, so it needs to call bar
from self
directly:
impl<T, U> Struct<T, U> {
- fn foo(self: Pin<&mut Self>) {
- let this = self.project();
+ fn foo(mut self: Pin<&mut Self>) {
+ let this = self.as_mut().project();
//
- this.bar();
+ self.bar();
}
(and project
consumes self
, so reborrow the Pin<&mut Self>
via as_mut
.)
Thank you for your help
Compiler emit error: