Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit e9bd66a

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

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
@@ -1967,9 +1967,9 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683"
19671967

19681968
[[package]]
19691969
name = "indexmap"
1970-
version = "2.0.0"
1970+
version = "2.2.0"
19711971
source = "registry+https://github.com/rust-lang/crates.io-index"
1972-
checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d"
1972+
checksum = "cf2a4f498956c7723dc280afc6a37d0dec50b39a29e232c6187ce4503703e8c2"
19731973
dependencies = [
19741974
"equivalent",
19751975
"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
@@ -60,7 +60,8 @@ impl GatherUsedMutsVisitor<'_, '_, '_> {
6060
// be those that were never initialized - we will consider those as being used as
6161
// they will either have been removed by unreachable code optimizations; or linted
6262
// as unused variables.
63-
self.never_initialized_mut_locals.remove(&into.local);
63+
// FIXME(#120456) - is `swap_remove` correct?
64+
self.never_initialized_mut_locals.swap_remove(&into.local);
6465
}
6566
}
6667

compiler/rustc_codegen_ssa/src/target_features.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ fn asm_target_features(tcx: TyCtxt<'_>, did: DefId) -> &FxIndexSet<Symbol> {
104104
match attrs.instruction_set {
105105
None => {}
106106
Some(InstructionSetAttr::ArmA32) => {
107-
target_features.remove(&sym::thumb_mode);
107+
// FIXME(#120456) - is `swap_remove` correct?
108+
target_features.swap_remove(&sym::thumb_mode);
108109
}
109110
Some(InstructionSetAttr::ArmT32) => {
110111
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
@@ -125,7 +125,8 @@ impl<K: Hash + Eq, V> interpret::AllocMap<K, V> for FxIndexMap<K, V> {
125125
where
126126
K: Borrow<Q>,
127127
{
128-
FxIndexMap::remove(self, k)
128+
// FIXME(#120456) - is `swap_remove` correct?
129+
FxIndexMap::swap_remove(self, k)
129130
}
130131

131132
#[inline(always)]

compiler/rustc_const_eval/src/interpret/intern.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ fn intern_shallow<'rt, 'mir, 'tcx, T, M: CompileTimeMachine<'mir, 'tcx, T>>(
5050
) -> Result<(), ()> {
5151
trace!("intern_shallow {:?}", alloc_id);
5252
// remove allocation
53-
let Some((_kind, mut alloc)) = ecx.memory.alloc_map.remove(&alloc_id) else {
53+
// FIXME(#120456) - is `swap_remove` correct?
54+
let Some((_kind, mut alloc)) = ecx.memory.alloc_map.swap_remove(&alloc_id) else {
5455
return Err(());
5556
};
5657
// 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
@@ -692,7 +692,8 @@ impl DiagCtxt {
692692
pub fn steal_diagnostic(&self, span: Span, key: StashKey) -> Option<DiagnosticBuilder<'_, ()>> {
693693
let mut inner = self.inner.borrow_mut();
694694
let key = (span.with_parent(None), key);
695-
let diag = inner.stashed_diagnostics.remove(&key)?;
695+
// FIXME(#120456) - is `swap_remove` correct?
696+
let diag = inner.stashed_diagnostics.swap_remove(&key)?;
696697
if diag.is_error() {
697698
if diag.is_lint.is_some() {
698699
inner.lint_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
@@ -1872,7 +1872,8 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> {
18721872
lifetime_ref: &'tcx hir::Lifetime,
18731873
bad_def: ResolvedArg,
18741874
) {
1875-
let old_value = self.map.defs.remove(&lifetime_ref.hir_id);
1875+
// FIXME(#120456) - is `swap_remove` correct?
1876+
let old_value = self.map.defs.swap_remove(&lifetime_ref.hir_id);
18761877
assert_eq!(old_value, Some(bad_def));
18771878
}
18781879
}

0 commit comments

Comments
 (0)