smol-rs / futures-lite

Futures, streams, and async I/O combinators.
Apache License 2.0
439 stars 25 forks source link

1.10 polling functions fail to compile with rustc 1.45.2 #28

Closed rhoark closed 3 years ago

rhoark commented 3 years ago

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 pollwrite(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 pollflush(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 pollclose(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

leshow commented 3 years ago

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

vebodev commented 3 years ago

I had the exact same error message on rustc-1.42.0

ghost commented 3 years ago

Fixed in v1.10.1