1.10 polling functions fail to compile with rustc 1.45.2
rhoark opened this issue · comments
Just a heads up. Sticking with 1.8 is working for me.
error[E0596]: cannot borrow self
as mutable, as it is not declared as mutable
--> C:\Users___.cargo\registry\src\github.com-1ecc6299db9ec823\futures-lite-1.10.0\src\io.rs:2819:24
|
2815 | self: Pin<&mut Self>,
| ---- help: consider changing this to be mutable: mut self
...
2819 | Pin::new(&mut *self.0.lock().unwrap()).poll_read(cx, buf)
| ^^^^ cannot borrow as mutable
error[E0596]: cannot borrow self
as mutable, as it is not declared as mutable
--> C:\Users___.cargo\registry\src\github.com-1ecc6299db9ec823\futures-lite-1.10.0\src\io.rs:2827:24
|
2823 | self: Pin<&mut Self>,
| ---- help: consider changing this to be mutable: mut self
...
2827 | Pin::new(&mut *self.0.lock().unwrap()).poll_read_vectored(cx, bufs)
| ^^^^ cannot borrow as mutable
error[E0596]: cannot borrow self
as mutable, as it is not declared as mutable
--> C:\Users___.cargo\registry\src\github.com-1ecc6299db9ec823\futures-lite-1.10.0\src\io.rs:2833:24
|
2832 | fn poll_write(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8]) -> Poll<Result> {
| ---- help: consider changing this to be mutable: mut self
2833 | Pin::new(&mut *self.0.lock().unwrap()).poll_write(cx, buf)
| ^^^^ cannot borrow as mutable
error[E0596]: cannot borrow self
as mutable, as it is not declared as mutable
--> C:\Users___.cargo\registry\src\github.com-1ecc6299db9ec823\futures-lite-1.10.0\src\io.rs:2837:24
|
2836 | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>> {
| ---- help: consider changing this to be mutable: mut self
2837 | Pin::new(&mut *self.0.lock().unwrap()).poll_flush(cx)
| ^^^^ cannot borrow as mutable
error[E0596]: cannot borrow self
as mutable, as it is not declared as mutable
--> C:\Users___.cargo\registry\src\github.com-1ecc6299db9ec823\futures-lite-1.10.0\src\io.rs:2841:24
|
2840 | fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>> {
| ---- help: consider changing this to be mutable: mut self
2841 | Pin::new(&mut *self.0.lock().unwrap()).poll_close(cx)
| ^^^^ cannot borrow as mutable
I've been banging my head against this for hours thinking something must be wrong but came to this same conclusion, unfortunately it's being pulled in transitively so I don't know what is causing the error. I'll just move to 1.46
I had the exact same error message on rustc-1.42.0
Fixed in v1.10.1