Skip to content

Commit 4134b76

Browse files
committed
Auto merge of rust-lang#120454 - clubby789:cargo-update, r=Nilstrieb
`cargo update` Run `cargo update`, with some pinning and fixes necessitated by that. This *should* unblock rust-lang#112865 There's a couple of places where I only pinned a dependency in one location - this seems like a bit of a hack, but better than duplicating the FIXME across all `Cargo.toml` where a dependency is introduced. cc `@Nilstrieb`
2 parents ff95e52 + 3a0e567 commit 4134b76

File tree

29 files changed

+799
-809
lines changed

29 files changed

+799
-809
lines changed

Cargo.lock

+621-594
Large diffs are not rendered by default.

compiler/rustc_borrowck/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2472,7 +2472,8 @@ mod diags {
24722472
&mut self,
24732473
span: Span,
24742474
) -> Option<(DiagnosticBuilder<'tcx>, usize)> {
2475-
self.diags.buffered_mut_errors.remove(&span)
2475+
// FIXME(#120456) - is `swap_remove` correct?
2476+
self.diags.buffered_mut_errors.swap_remove(&span)
24762477
}
24772478

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

compiler/rustc_borrowck/src/used_muts.rs

+2-1
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

+2-1
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

+2-1
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

+2-1
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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,8 @@ impl HumanEmitter {
16381638
let mut to_add = FxHashMap::default();
16391639

16401640
for (depth, style) in depths {
1641-
if multilines.remove(&depth).is_none() {
1641+
// FIXME(#120456) - is `swap_remove` correct?
1642+
if multilines.swap_remove(&depth).is_none() {
16421643
to_add.insert(depth, style);
16431644
}
16441645
}

compiler/rustc_errors/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,8 @@ impl DiagCtxt {
698698
pub fn steal_diagnostic(&self, span: Span, key: StashKey) -> Option<DiagnosticBuilder<'_, ()>> {
699699
let mut inner = self.inner.borrow_mut();
700700
let key = (span.with_parent(None), key);
701-
let diag = inner.stashed_diagnostics.remove(&key)?;
701+
// FIXME(#120456) - is `swap_remove` correct?
702+
let diag = inner.stashed_diagnostics.swap_remove(&key)?;
702703
if diag.is_error() {
703704
if diag.is_lint.is_some() {
704705
inner.lint_err_count -= 1;

compiler/rustc_hir_analysis/src/astconv/object_safety.rs

+2-1
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

+2-1
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
}

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
15501550
let ctxt = {
15511551
let mut enclosing_breakables = self.enclosing_breakables.borrow_mut();
15521552
debug_assert!(enclosing_breakables.stack.len() == index + 1);
1553-
enclosing_breakables.by_id.remove(&id).expect("missing breakable context");
1553+
// FIXME(#120456) - is `swap_remove` correct?
1554+
enclosing_breakables.by_id.swap_remove(&id).expect("missing breakable context");
15541555
enclosing_breakables.stack.pop().expect("missing breakable context")
15551556
};
15561557
(ctxt, result)

compiler/rustc_infer/src/infer/opaque_types/table.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ impl<'tcx> OpaqueTypeStorage<'tcx> {
2020
if let Some(idx) = idx {
2121
self.opaque_types.get_mut(&key).unwrap().hidden_type = idx;
2222
} else {
23-
match self.opaque_types.remove(&key) {
23+
// FIXME(#120456) - is `swap_remove` correct?
24+
match self.opaque_types.swap_remove(&key) {
2425
None => bug!("reverted opaque type inference that was never registered: {:?}", key),
2526
Some(_) => {}
2627
}

compiler/rustc_lint_defs/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,8 @@ impl LintBuffer {
712712
}
713713

714714
pub fn take(&mut self, id: NodeId) -> Vec<BufferedEarlyLint> {
715-
self.map.remove(&id).unwrap_or_default()
715+
// FIXME(#120456) - is `swap_remove` correct?
716+
self.map.swap_remove(&id).unwrap_or_default()
716717
}
717718

718719
pub fn buffer_lint(

compiler/rustc_llvm/Cargo.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ libc = "0.2.73"
99
# tidy-alphabetical-end
1010

1111
[build-dependencies]
12+
# FIXME: updating cc past 1.0.79 breaks libstd bootstrapping, pin
13+
# to the last working version here so `cargo update` doesn't cause the
14+
# a higher version to be selected
15+
# https://github.com/rust-lang/cc-rs/issues/913
1216
# tidy-alphabetical-start
13-
cc = "1.0.69"
17+
cc = "=1.0.79"
1418
# tidy-alphabetical-end

compiler/rustc_mir_transform/src/dest_prop.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,8 @@ impl<'alloc> Candidates<'alloc> {
398398
let candidates = entry.get_mut();
399399
Self::vec_filter_candidates(p, candidates, f, at);
400400
if candidates.len() == 0 {
401-
entry.remove();
401+
// FIXME(#120456) - is `swap_remove` correct?
402+
entry.swap_remove();
402403
}
403404
}
404405

compiler/rustc_passes/src/stability.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -957,8 +957,9 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
957957
// available as we'd like it to be.
958958
// FIXME: only remove `libc` when `stdbuild` is active.
959959
// FIXME: remove special casing for `test`.
960-
remaining_lib_features.remove(&sym::libc);
961-
remaining_lib_features.remove(&sym::test);
960+
// FIXME(#120456) - is `swap_remove` correct?
961+
remaining_lib_features.swap_remove(&sym::libc);
962+
remaining_lib_features.swap_remove(&sym::test);
962963

963964
/// For each feature in `defined_features`..
964965
///
@@ -996,7 +997,8 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
996997
unnecessary_stable_feature_lint(tcx, *span, feature, since);
997998
}
998999
}
999-
remaining_lib_features.remove(&feature);
1000+
// FIXME(#120456) - is `swap_remove` correct?
1001+
remaining_lib_features.swap_remove(&feature);
10001002

10011003
// `feature` is the feature doing the implying, but `implied_by` is the feature with
10021004
// the attribute that establishes this relationship. `implied_by` is guaranteed to be a

compiler/rustc_resolve/src/check_unused.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ impl<'a, 'b, 'tcx> UnusedImportCheckVisitor<'a, 'b, 'tcx> {
9292
} else {
9393
// This trait import is definitely used, in a way other than
9494
// method resolution.
95-
self.r.maybe_unused_trait_imports.remove(&def_id);
95+
// FIXME(#120456) - is `swap_remove` correct?
96+
self.r.maybe_unused_trait_imports.swap_remove(&def_id);
9697
if let Some(i) = self.unused_imports.get_mut(&self.base_id) {
9798
i.unused.remove(&id);
9899
}

compiler/rustc_trait_selection/src/traits/auto_trait.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -524,13 +524,15 @@ impl<'tcx> AutoTraitFinder<'tcx> {
524524
if let Entry::Occupied(v) = vid_map.entry(*smaller) {
525525
let smaller_deps = v.into_mut();
526526
smaller_deps.larger.insert(*larger);
527-
smaller_deps.larger.remove(&target);
527+
// FIXME(#120456) - is `swap_remove` correct?
528+
smaller_deps.larger.swap_remove(&target);
528529
}
529530

530531
if let Entry::Occupied(v) = vid_map.entry(*larger) {
531532
let larger_deps = v.into_mut();
532533
larger_deps.smaller.insert(*smaller);
533-
larger_deps.smaller.remove(&target);
534+
// FIXME(#120456) - is `swap_remove` correct?
535+
larger_deps.smaller.swap_remove(&target);
534536
}
535537
}
536538
(&RegionTarget::RegionVid(v1), &RegionTarget::Region(r1)) => {
@@ -543,13 +545,15 @@ impl<'tcx> AutoTraitFinder<'tcx> {
543545
if let Entry::Occupied(v) = vid_map.entry(*smaller) {
544546
let smaller_deps = v.into_mut();
545547
smaller_deps.larger.insert(*larger);
546-
smaller_deps.larger.remove(&target);
548+
// FIXME(#120456) - is `swap_remove` correct?
549+
smaller_deps.larger.swap_remove(&target);
547550
}
548551

549552
if let Entry::Occupied(v) = vid_map.entry(*larger) {
550553
let larger_deps = v.into_mut();
551554
larger_deps.smaller.insert(*smaller);
552-
larger_deps.smaller.remove(&target);
555+
// FIXME(#120456) - is `swap_remove` correct?
556+
larger_deps.smaller.swap_remove(&target);
553557
}
554558
}
555559
}

compiler/rustc_trait_selection/src/traits/specialize/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,8 @@ pub(crate) fn to_pretty_impl_header(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Opti
516516
for (p, _) in predicates {
517517
if let Some(poly_trait_ref) = p.as_trait_clause() {
518518
if Some(poly_trait_ref.def_id()) == sized_trait {
519-
types_without_default_bounds.remove(&poly_trait_ref.self_ty().skip_binder());
519+
// FIXME(#120456) - is `swap_remove` correct?
520+
types_without_default_bounds.swap_remove(&poly_trait_ref.self_ty().skip_binder());
520521
continue;
521522
}
522523
}

src/tools/clippy/clippy_lints/src/copies.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,8 @@ fn scan_block_for_eq<'tcx>(
511511
for stmt in &stmts[stmts.len() - init..=stmts.len() - offset] {
512512
if let StmtKind::Local(l) = stmt.kind {
513513
l.pat.each_binding_or_first(&mut |_, id, _, _| {
514-
eq.locals.remove(&id);
514+
// FIXME(rust/#120456) - is `swap_remove` correct?
515+
eq.locals.swap_remove(&id);
515516
});
516517
}
517518
}

src/tools/clippy/clippy_lints/src/escape.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,17 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
138138
fn consume(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId) {
139139
if cmt.place.projections.is_empty() {
140140
if let PlaceBase::Local(lid) = cmt.place.base {
141-
self.set.remove(&lid);
141+
// FIXME(rust/#120456) - is `swap_remove` correct?
142+
self.set.swap_remove(&lid);
142143
}
143144
}
144145
}
145146

146147
fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId, _: ty::BorrowKind) {
147148
if cmt.place.projections.is_empty() {
148149
if let PlaceBase::Local(lid) = cmt.place.base {
149-
self.set.remove(&lid);
150+
// FIXME(rust/#120456) - is `swap_remove` correct?
151+
self.set.swap_remove(&lid);
150152
}
151153
}
152154
}

src/tools/clippy/clippy_lints/src/index_refutable_slice.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ fn find_slice_values(cx: &LateContext<'_>, pat: &hir::Pat<'_>) -> FxIndexMap<hir
106106
}
107107
if sub_pat.is_some() {
108108
removed_pat.insert(value_hir_id);
109-
slices.remove(&value_hir_id);
109+
// FIXME(rust/#120456) - is `swap_remove` correct?
110+
slices.swap_remove(&value_hir_id);
110111
return;
111112
}
112113

@@ -264,7 +265,8 @@ impl<'a, 'tcx> Visitor<'tcx> for SliceIndexLintingVisitor<'a, 'tcx> {
264265
}
265266

266267
// The slice was used for something other than indexing
267-
self.slice_lint_info.remove(&local_id);
268+
// FIXME(rust/#120456) - is `swap_remove` correct?
269+
self.slice_lint_info.swap_remove(&local_id);
268270
}
269271
intravisit::walk_expr(self, expr);
270272
}

src/tools/clippy/clippy_lints/src/matches/match_same_arms.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ fn pat_contains_local(pat: &Pat<'_>, id: HirId) -> bool {
415415
/// Returns true if all the bindings in the `Pat` are in `ids` and vice versa
416416
fn bindings_eq(pat: &Pat<'_>, mut ids: HirIdSet) -> bool {
417417
let mut result = true;
418-
pat.each_binding_or_first(&mut |_, id, _, _| result &= ids.remove(&id));
418+
// FIXME(rust/#120456) - is `swap_remove` correct?
419+
pat.each_binding_or_first(&mut |_, id, _, _| result &= ids.swap_remove(&id));
419420
result && ids.is_empty()
420421
}

src/tools/clippy/clippy_lints/src/needless_pass_by_ref_mut.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ impl<'tcx> euv::Delegate<'tcx> for MutablyUsedVariablesCtxt<'tcx> {
382382
self.add_mutably_used_var(*vid);
383383
}
384384
self.prev_bind = None;
385-
self.prev_move_to_closure.remove(vid);
385+
// FIXME(rust/#120456) - is `swap_remove` correct?
386+
self.prev_move_to_closure.swap_remove(vid);
386387
}
387388
}
388389

src/tools/clippy/clippy_lints/src/no_effect.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ impl<'tcx> LateLintPass<'tcx> for NoEffect {
9898

9999
fn check_block_post(&mut self, cx: &LateContext<'tcx>, _: &'tcx rustc_hir::Block<'tcx>) {
100100
for hir_id in self.local_bindings.pop().unwrap() {
101-
if let Some(span) = self.underscore_bindings.remove(&hir_id) {
101+
// FIXME(rust/#120456) - is `swap_remove` correct?
102+
if let Some(span) = self.underscore_bindings.swap_remove(&hir_id) {
102103
span_lint_hir(
103104
cx,
104105
NO_EFFECT_UNDERSCORE_BINDING,
@@ -112,7 +113,8 @@ impl<'tcx> LateLintPass<'tcx> for NoEffect {
112113

113114
fn check_expr(&mut self, _: &LateContext<'tcx>, expr: &'tcx rustc_hir::Expr<'tcx>) {
114115
if let Some(def_id) = path_to_local(expr) {
115-
self.underscore_bindings.remove(&def_id);
116+
// FIXME(rust/#120456) - is `swap_remove` correct?
117+
self.underscore_bindings.swap_remove(&def_id);
116118
}
117119
}
118120
}

src/tools/clippy/clippy_lints/src/only_used_in_recursion.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ impl Params {
153153
param.uses = Vec::new();
154154
let key = (param.fn_id, param.idx);
155155
self.by_fn.remove(&key);
156-
self.by_id.remove(&id);
156+
// FIXME(rust/#120456) - is `swap_remove` correct?
157+
self.by_id.swap_remove(&id);
157158
}
158159
}
159160

src/tools/tidy/src/deps.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
217217
"darling_core",
218218
"darling_macro",
219219
"datafrog",
220+
"deranged",
220221
"derivative",
221222
"derive_more",
222223
"derive_setters",
@@ -258,7 +259,6 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
258259
"indexmap",
259260
"intl-memoizer",
260261
"intl_pluralrules",
261-
"is-terminal",
262262
"itertools",
263263
"itoa",
264264
"jemalloc-sys",
@@ -290,6 +290,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
290290
"pin-project-lite",
291291
"polonius-engine",
292292
"portable-atomic", // dependency for platforms doesn't support `AtomicU64` in std
293+
"powerfmt",
293294
"ppv-lite86",
294295
"proc-macro-hack",
295296
"proc-macro2",

0 commit comments

Comments
 (0)