Closed
Description
1.28.0-nightly (2018-06-13 5205ae8)
#![feature(nll, arbitrary_self_types)]
use std::rc::Rc;
struct Combine(u8);
impl Combine {
fn poll(self: Rc<Self>) {
drop(self);
self.0 = 42;
}
}
fn main() {}
error[E0594]: cannot assign to immutable item
--> src/main.rs:10:9
|
10 | self.0 = 42;
| ----^^^^^^^
| |
| cannot assign through `&`-reference
| help: consider changing this to be a mutable reference: `&mut elf`
Unsurprisingly, &mut elf
does not help the code compile.