Closed
Description
In #47596, @SimonSapin reported several NLL errors in dependencies of the servo crate. @lqd later minimized one of those errors into this example:
#![feature(nll)]
struct AutoGCRooter {
stackTop: *mut *mut AutoGCRooter,
}
impl AutoGCRooter {
unsafe fn add_to_root_stack(&mut self) {
*self.stackTop = self;
}
}
fn main() {}
which yields:
error[E0506]: cannot assign to `*self.stackTop` because it is borrowed
--> src/main.rs:9:9
|
9 | *self.stackTop = self;
| ^^^^^^^^^^^^^^^^^----
| | |
| | borrow of `*self.stackTop` occurs here
| assignment to borrowed `*self.stackTop` occurs here
error: aborting due to previous error
Removing feature(nll) makes the code work, so probably this is an NLL bug.