Skip to content

Commit 7bbe15e

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

File tree

25 files changed

+34
-34
lines changed

25 files changed

+34
-34
lines changed

Cargo.lock

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

19691969
[[package]]
19701970
name = "indexmap"
1971-
version = "2.0.0"
1971+
version = "2.2.0"
19721972
source = "registry+https://github.com/rust-lang/crates.io-index"
1973-
checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d"
1973+
checksum = "cf2a4f498956c7723dc280afc6a37d0dec50b39a29e232c6187ce4503703e8c2"
19741974
dependencies = [
19751975
"equivalent",
19761976
"hashbrown",

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2473,7 +2473,7 @@ mod error {
24732473
&mut self,
24742474
span: Span,
24752475
) -> Option<(DiagnosticBuilder<'tcx>, usize)> {
2476-
self.errors.buffered_mut_errors.remove(&span)
2476+
self.errors.buffered_mut_errors.swap_remove(&span)
24772477
}
24782478

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

compiler/rustc_borrowck/src/used_muts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ 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+
self.never_initialized_mut_locals.swap_remove(&into.local);
6464
}
6565
}
6666

compiler/rustc_codegen_ssa/src/target_features.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ 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+
target_features.swap_remove(&sym::thumb_mode);
108108
}
109109
Some(InstructionSetAttr::ArmT32) => {
110110
target_features.insert(sym::thumb_mode);

compiler/rustc_const_eval/src/const_eval/machine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ 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+
FxIndexMap::swap_remove(self, k)
129129
}
130130

131131
#[inline(always)]

compiler/rustc_const_eval/src/interpret/intern.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ 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+
let Some((_kind, mut alloc)) = ecx.memory.alloc_map.swap_remove(&alloc_id) else {
5454
return Err(());
5555
};
5656
// Set allocation mutability as appropriate. This is used by LLVM to put things into

compiler/rustc_errors/src/emitter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,7 @@ impl HumanEmitter {
16401640
let mut to_add = FxHashMap::default();
16411641

16421642
for (depth, style) in depths {
1643-
if multilines.remove(&depth).is_none() {
1643+
if multilines.swap_remove(&depth).is_none() {
16441644
to_add.insert(depth, style);
16451645
}
16461646
}

compiler/rustc_errors/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ 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+
let diag = inner.stashed_diagnostics.swap_remove(&key)?;
696696
if diag.is_error() {
697697
if diag.is_lint.is_some() {
698698
inner.lint_err_count -= 1;

compiler/rustc_hir_analysis/src/astconv/object_safety.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ 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+
def_ids.swap_remove(&def_id);
222222
if tcx.generics_require_sized_self(def_id) {
223223
tcx.emit_node_span_lint(
224224
UNUSED_ASSOCIATED_TYPE_BOUNDS,

compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1872,7 +1872,7 @@ 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+
let old_value = self.map.defs.swap_remove(&lifetime_ref.hir_id);
18761876
assert_eq!(old_value, Some(bad_def));
18771877
}
18781878
}

0 commit comments

Comments
 (0)