NLL regression: cannot assign to *self
because it is borrowed
#46917
Labels
A-NLL
Area: Non-lexical lifetimes (NLL)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
rustc version: de38f49 (after #46862)
This compiles just fine:
Now let's add
#![feature(nll)]
and try again:There are two interesting workarounds that fix the compilation error, but I have absolutely no idea why they work. :)
The first workaround: reorder field assignment.
The second workaround: make a dummy implementation of
Drop
forBar
.cc @nikomatsakis
The text was updated successfully, but these errors were encountered: