1
Fork 0

Do not ICE on pattern that uses a binding multiple times in generator

This commit is contained in:
LeSeulArtichaut 2020-10-19 23:14:28 +02:00
parent a85e949276
commit 66ac5a2d63

View file

@ -250,10 +250,7 @@ impl<'a, 'tcx> Visitor<'tcx> for InteriorVisitor<'a, 'tcx> {
let mut scope_var_ids =
self.guard_bindings.pop().expect("should have pushed at least one earlier");
for var_id in scope_var_ids.drain(..) {
assert!(
self.guard_bindings_set.remove(&var_id),
"variable should be placed in scope earlier"
);
self.guard_bindings_set.remove(&var_id);
}
}
self.visit_expr(body);