[NLL] Fix some things for bootstrap#52830
Conversation
Note that the first argument is `self as &mut dyn Delegate`, so this isn't allowed with two-phase borrows.
|
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
| let slot = unsafe { | ||
| self.data.get_unchecked_mut(index) | ||
| }; | ||
| mem::swap(&mut slot.1, &mut value); |
There was a problem hiding this comment.
I'm surprised this doesn't require mut on the variable; generally &mut <var> does require <var> to be declared mut I think?
There was a problem hiding this comment.
Yes, but this is equivalent to &mut (*slot).1 which is OK since slot is a mutable reference.
|
@bors delegate+ r=me pending travis |
|
✌️ @matthewjasper can now approve this pull request |
|
@bors r+ |
|
📌 Commit 18d5f82 has been approved by |
[NLL] Fix some things for bootstrap Some changes that are required when bootstrapping rustc with NLL enabled. * Remove a bunch of unused `mut`s that aren't needed, but the existing lint doesn't catch. * Rewrite a function call to satisfy NLL borrowck. Note that the borrow is two-phase, but gets activated immediately by an unsizing coercion. cc #51823
|
☀️ Test successful - status-appveyor, status-travis |
| let region_scope_tree = self.tcx.region_scope_tree(item_def_id); | ||
| euv::ExprUseVisitor::new(self, tcx, param_env, ®ion_scope_tree, self.tables, None) | ||
| let tables = self.tables; | ||
| euv::ExprUseVisitor::new(self, tcx, param_env, ®ion_scope_tree, tables, None) |
There was a problem hiding this comment.
hmm we may want to actually file an issue for this one (the interaction of two-phase borrows and an Unsize coercion), tagged with NLL, in terms of tracking things that regress with respect to AST-borrowck.
Or we can just wait to someone to report it from the wild. :)
Some changes that are required when bootstrapping rustc with NLL enabled.
muts that aren't needed, but the existing lint doesn't catch.cc #51823