-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustc_typeck: do not overlap a borrow of TypeckTables with method lookup. #42480
Conversation
Nominating for backport because the bug has already reached beta. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me w/ or w/o comment
@@ -446,9 +446,10 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> { | |||
// overloaded lvalue ops, and will be fixed by them in order to get | |||
// the correct region. | |||
let mut source = self.node_ty(expr.id); | |||
if let Some(adjustments) = self.tables.borrow_mut().adjustments.get_mut(&expr.id) { | |||
let previous_adjustments = self.tables.borrow_mut().adjustments.remove(&expr.id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe worth a comment here explaining why the remove-and-then-reinsert?
@bors r=nikomatsakis |
📌 Commit b02e3a1 has been approved by |
⌛ Testing commit b02e3a1 with merge 89fceaa... |
rustc_typeck: do not overlap a borrow of TypeckTables with method lookup. If trait selection is reached, it could potentially request a closure signature, which will have to borrow the `TypeckTables` of the current function, and so those tables *should not* be mutably borrowed. Fixes #42463. r? @nikomatsakis
☀️ Test successful - status-appveyor, status-travis |
If trait selection is reached, it could potentially request a closure signature, which will have to borrow the
TypeckTables
of the current function, and so those tables should not be mutably borrowed.Fixes #42463.
r? @nikomatsakis