Bump indexmap
`swap` has been deprecated in favour of `swap_remove` - the behaviour is the same though.
This commit is contained in:
parent
41227f964a
commit
b3b9f31a86
@ -511,7 +511,8 @@ fn scan_block_for_eq<'tcx>(
|
||||
for stmt in &stmts[stmts.len() - init..=stmts.len() - offset] {
|
||||
if let StmtKind::Local(l) = stmt.kind {
|
||||
l.pat.each_binding_or_first(&mut |_, id, _, _| {
|
||||
eq.locals.remove(&id);
|
||||
// FIXME(rust/#120456) - is `swap_remove` correct?
|
||||
eq.locals.swap_remove(&id);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -138,7 +138,8 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
|
||||
fn consume(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId) {
|
||||
if cmt.place.projections.is_empty() {
|
||||
if let PlaceBase::Local(lid) = cmt.place.base {
|
||||
self.set.remove(&lid);
|
||||
// FIXME(rust/#120456) - is `swap_remove` correct?
|
||||
self.set.swap_remove(&lid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -146,7 +147,8 @@ fn consume(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId) {
|
||||
fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId, _: ty::BorrowKind) {
|
||||
if cmt.place.projections.is_empty() {
|
||||
if let PlaceBase::Local(lid) = cmt.place.base {
|
||||
self.set.remove(&lid);
|
||||
// FIXME(rust/#120456) - is `swap_remove` correct?
|
||||
self.set.swap_remove(&lid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -106,7 +106,8 @@ fn find_slice_values(cx: &LateContext<'_>, pat: &hir::Pat<'_>) -> FxIndexMap<hir
|
||||
}
|
||||
if sub_pat.is_some() {
|
||||
removed_pat.insert(value_hir_id);
|
||||
slices.remove(&value_hir_id);
|
||||
// FIXME(rust/#120456) - is `swap_remove` correct?
|
||||
slices.swap_remove(&value_hir_id);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -259,7 +260,8 @@ fn visit_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) {
|
||||
}
|
||||
|
||||
// The slice was used for something other than indexing
|
||||
self.slice_lint_info.remove(&local_id);
|
||||
// FIXME(rust/#120456) - is `swap_remove` correct?
|
||||
self.slice_lint_info.swap_remove(&local_id);
|
||||
}
|
||||
intravisit::walk_expr(self, expr);
|
||||
}
|
||||
|
@ -415,6 +415,7 @@ fn pat_contains_local(pat: &Pat<'_>, id: HirId) -> bool {
|
||||
/// Returns true if all the bindings in the `Pat` are in `ids` and vice versa
|
||||
fn bindings_eq(pat: &Pat<'_>, mut ids: HirIdSet) -> bool {
|
||||
let mut result = true;
|
||||
pat.each_binding_or_first(&mut |_, id, _, _| result &= ids.remove(&id));
|
||||
// FIXME(rust/#120456) - is `swap_remove` correct?
|
||||
pat.each_binding_or_first(&mut |_, id, _, _| result &= ids.swap_remove(&id));
|
||||
result && ids.is_empty()
|
||||
}
|
||||
|
@ -382,7 +382,8 @@ fn consume(&mut self, cmt: &euv::PlaceWithHirId<'tcx>, id: HirId) {
|
||||
self.add_mutably_used_var(*vid);
|
||||
}
|
||||
self.prev_bind = None;
|
||||
self.prev_move_to_closure.remove(vid);
|
||||
// FIXME(rust/#120456) - is `swap_remove` correct?
|
||||
self.prev_move_to_closure.swap_remove(vid);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,8 @@ fn check_block(&mut self, _: &LateContext<'tcx>, _: &'tcx rustc_hir::Block<'tcx>
|
||||
|
||||
fn check_block_post(&mut self, cx: &LateContext<'tcx>, _: &'tcx rustc_hir::Block<'tcx>) {
|
||||
for hir_id in self.local_bindings.pop().unwrap() {
|
||||
if let Some(span) = self.underscore_bindings.remove(&hir_id) {
|
||||
// FIXME(rust/#120456) - is `swap_remove` correct?
|
||||
if let Some(span) = self.underscore_bindings.swap_remove(&hir_id) {
|
||||
span_lint_hir(
|
||||
cx,
|
||||
NO_EFFECT_UNDERSCORE_BINDING,
|
||||
@ -112,7 +113,8 @@ fn check_block_post(&mut self, cx: &LateContext<'tcx>, _: &'tcx rustc_hir::Block
|
||||
|
||||
fn check_expr(&mut self, _: &LateContext<'tcx>, expr: &'tcx rustc_hir::Expr<'tcx>) {
|
||||
if let Some(def_id) = path_to_local(expr) {
|
||||
self.underscore_bindings.remove(&def_id);
|
||||
// FIXME(rust/#120456) - is `swap_remove` correct?
|
||||
self.underscore_bindings.swap_remove(&def_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -153,7 +153,8 @@ fn remove_by_id(&mut self, id: HirId) {
|
||||
param.uses = Vec::new();
|
||||
let key = (param.fn_id, param.idx);
|
||||
self.by_fn.remove(&key);
|
||||
self.by_id.remove(&id);
|
||||
// FIXME(rust/#120456) - is `swap_remove` correct?
|
||||
self.by_id.swap_remove(&id);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user