-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.NLL-diagnosticsWorking towards the "diagnostic parity" goalWorking towards the "diagnostic parity" goalT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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.
lqd, alex, sfackler, wesleywiser, oli-obk and 20 more
Metadata
Metadata
Assignees
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.NLL-diagnosticsWorking towards the "diagnostic parity" goalWorking towards the "diagnostic parity" goalT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.