Skip to content

Commit 4de3a3a

Browse files
committed
Bump indexmap
`swap` has been deprecated in favour of `swap_remove` - the behaviour is the same though.
1 parent a84bb95 commit 4de3a3a

File tree

25 files changed

+65
-34
lines changed

25 files changed

+65
-34
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,9 +2014,9 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683"
20142014

20152015
[[package]]
20162016
name = "indexmap"
2017-
version = "2.0.0"
2017+
version = "2.2.0"
20182018
source = "registry+https://github.com/rust-lang/crates.io-index"
2019-
checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d"
2019+
checksum = "cf2a4f498956c7723dc280afc6a37d0dec50b39a29e232c6187ce4503703e8c2"
20202020
dependencies = [
20212021
"equivalent",
20222022
"hashbrown",

compiler/rustc_borrowck/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2479,7 +2479,8 @@ mod diags {
24792479
&mut self,
24802480
span: Span,
24812481
) -> Option<(DiagnosticBuilder<'tcx>, usize)> {
2482-
self.diags.buffered_mut_errors.remove(&span)
2482+
// FIXME(#120456) - is `swap_remove` correct?
2483+
self.diags.buffered_mut_errors.swap_remove(&span)
24832484
}
24842485

24852486
pub fn buffer_mut_error(&mut self, span: Span, t: DiagnosticBuilder<'tcx>, count: usize) {

compiler/rustc_borrowck/src/used_muts.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ impl GatherUsedMutsVisitor<'_, '_, '_> {
5858
// be those that were never initialized - we will consider those as being used as
5959
// they will either have been removed by unreachable code optimizations; or linted
6060
// as unused variables.
61-
self.never_initialized_mut_locals.remove(&into.local);
61+
// FIXME(#120456) - is `swap_remove` correct?
62+
self.never_initialized_mut_locals.swap_remove(&into.local);
6263
}
6364
}
6465

compiler/rustc_codegen_ssa/src/target_features.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ fn asm_target_features(tcx: TyCtxt<'_>, did: DefId) -> &FxIndexSet<Symbol> {
106106
match attrs.instruction_set {
107107
None => {}
108108
Some(InstructionSetAttr::ArmA32) => {
109-
target_features.remove(&sym::thumb_mode);
109+
// FIXME(#120456) - is `swap_remove` correct?
110+
target_features.swap_remove(&sym::thumb_mode);
110111
}
111112
Some(InstructionSetAttr::ArmT32) => {
112113
target_features.insert(sym::thumb_mode);

compiler/rustc_const_eval/src/const_eval/machine.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ impl<K: Hash + Eq, V> interpret::AllocMap<K, V> for FxIndexMap<K, V> {
122122
where
123123
K: Borrow<Q>,
124124
{
125-
FxIndexMap::remove(self, k)
125+
// FIXME(#120456) - is `swap_remove` correct?
126+
FxIndexMap::swap_remove(self, k)
126127
}
127128

128129
#[inline(always)]

compiler/rustc_const_eval/src/interpret/intern.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ fn intern_shallow<'rt, 'mir, 'tcx, T, M: CompileTimeMachine<'mir, 'tcx, T>>(
4949
) -> Result<impl Iterator<Item = CtfeProvenance> + 'tcx, ()> {
5050
trace!("intern_shallow {:?}", alloc_id);
5151
// remove allocation
52-
let Some((_kind, mut alloc)) = ecx.memory.alloc_map.remove(&alloc_id) else {
52+
// FIXME(#120456) - is `swap_remove` correct?
53+
let Some((_kind, mut alloc)) = ecx.memory.alloc_map.swap_remove(&alloc_id) else {
5354
return Err(());
5455
};
5556
// Set allocation mutability as appropriate. This is used by LLVM to put things into

compiler/rustc_errors/src/emitter.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1635,7 +1635,8 @@ impl HumanEmitter {
16351635
let mut to_add = FxHashMap::default();
16361636

16371637
for (depth, style) in depths {
1638-
if multilines.remove(&depth).is_none() {
1638+
// FIXME(#120456) - is `swap_remove` correct?
1639+
if multilines.swap_remove(&depth).is_none() {
16391640
to_add.insert(depth, style);
16401641
}
16411642
}

compiler/rustc_errors/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,8 @@ impl DiagCtxt {
707707
pub fn steal_diagnostic(&self, span: Span, key: StashKey) -> Option<DiagnosticBuilder<'_, ()>> {
708708
let mut inner = self.inner.borrow_mut();
709709
let key = (span.with_parent(None), key);
710-
let diag = inner.stashed_diagnostics.remove(&key)?;
710+
// FIXME(#120456) - is `swap_remove` correct?
711+
let diag = inner.stashed_diagnostics.swap_remove(&key)?;
711712
if diag.is_error() {
712713
if diag.is_lint.is_none() {
713714
inner.stashed_err_count -= 1;

compiler/rustc_hir_analysis/src/astconv/object_safety.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
218218
for def_ids in associated_types.values_mut() {
219219
for (projection_bound, span) in &projection_bounds {
220220
let def_id = projection_bound.projection_def_id();
221-
def_ids.remove(&def_id);
221+
// FIXME(#120456) - is `swap_remove` correct?
222+
def_ids.swap_remove(&def_id);
222223
if tcx.generics_require_sized_self(def_id) {
223224
tcx.emit_node_span_lint(
224225
UNUSED_ASSOCIATED_TYPE_BOUNDS,

compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,8 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> {
18731873
lifetime_ref: &'tcx hir::Lifetime,
18741874
bad_def: ResolvedArg,
18751875
) {
1876-
let old_value = self.map.defs.remove(&lifetime_ref.hir_id);
1876+
// FIXME(#120456) - is `swap_remove` correct?
1877+
let old_value = self.map.defs.swap_remove(&lifetime_ref.hir_id);
18771878
assert_eq!(old_value, Some(bad_def));
18781879
}
18791880
}

0 commit comments

Comments
 (0)