Skip to content

Commit a2b0c4b

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 a84bb95 + 9b73db3 commit a2b0c4b

File tree

31 files changed

+799
-819
lines changed

31 files changed

+799
-819
lines changed

Cargo.lock

+613-601
Large diffs are not rendered by default.

compiler/rustc_ast/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ version = "0.0.0"
44
edition = "2021"
55

66
[dependencies]
7+
# FIXME: bumping memchr to 2.7.1 causes linker errors in MSVC thin-lto
78
# tidy-alphabetical-start
89
bitflags = "2.4.1"
9-
memchr = "2.5.0"
10+
memchr = "=2.5.0"
1011
rustc_data_structures = { path = "../rustc_data_structures" }
1112
rustc_index = { path = "../rustc_index" }
1213
rustc_lexer = { path = "../rustc_lexer" }

compiler/rustc_borrowck/src/lib.rs

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

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

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

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

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

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

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

+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
@@ -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
}

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1579,7 +1579,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
15791579
let ctxt = {
15801580
let mut enclosing_breakables = self.enclosing_breakables.borrow_mut();
15811581
debug_assert!(enclosing_breakables.stack.len() == index + 1);
1582-
enclosing_breakables.by_id.remove(&id).expect("missing breakable context");
1582+
// FIXME(#120456) - is `swap_remove` correct?
1583+
enclosing_breakables.by_id.swap_remove(&id).expect("missing breakable context");
15831584
enclosing_breakables.stack.pop().expect("missing breakable context")
15841585
};
15851586
(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
@@ -708,7 +708,8 @@ impl LintBuffer {
708708
}
709709

710710
pub fn take(&mut self, id: NodeId) -> Vec<BufferedEarlyLint> {
711-
self.map.remove(&id).unwrap_or_default()
711+
// FIXME(#120456) - is `swap_remove` correct?
712+
self.map.swap_remove(&id).unwrap_or_default()
712713
}
713714

714715
pub fn buffer_lint(

compiler/rustc_llvm/Cargo.toml

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ edition = "2021"
88
libc = "0.2.73"
99
# tidy-alphabetical-end
1010

11+
# FIXME: updating cc past 1.0.79 breaks libstd bootstrapping, pin
12+
# to the last working version here so `cargo update` doesn't cause the
13+
# a higher version to be selected
14+
# https://github.com/rust-lang/cc-rs/issues/913
15+
# 1.0.{84, 85} fix this but have been yanked
1116
[build-dependencies]
1217
# tidy-alphabetical-start
13-
cc = "1.0.69"
18+
cc = "=1.0.79"
1419
# 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
@@ -522,7 +522,8 @@ pub(crate) fn to_pretty_impl_header(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Opti
522522
for (p, _) in predicates {
523523
if let Some(poly_trait_ref) = p.as_trait_clause() {
524524
if Some(poly_trait_ref.def_id()) == sized_trait {
525-
types_without_default_bounds.remove(&poly_trait_ref.self_ty().skip_binder());
525+
// FIXME(#120456) - is `swap_remove` correct?
526+
types_without_default_bounds.swap_remove(&poly_trait_ref.self_ty().skip_binder());
526527
continue;
527528
}
528529
}

src/ci/docker/host-x86_64/test-various/uefi_qemu_test/Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ version = 3
44

55
[[package]]
66
name = "r-efi"
7-
version = "4.2.0"
7+
version = "4.3.0"
88
source = "registry+https://github.com/rust-lang/crates.io-index"
9-
checksum = "575fc2d9b3da54adbdfaddf6eca48fec256d977c8630a1750b8991347d1ac911"
9+
checksum = "0e244f96e03a3067f9e521d3167bd42657594cb8588c8d3a2db01545dc1af2e0"
1010

1111
[[package]]
1212
name = "uefi_qemu_test"

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

@@ -259,7 +260,8 @@ impl<'a, 'tcx> Visitor<'tcx> for SliceIndexLintingVisitor<'a, 'tcx> {
259260
}
260261

261262
// The slice was used for something other than indexing
262-
self.slice_lint_info.remove(&local_id);
263+
// FIXME(rust/#120456) - is `swap_remove` correct?
264+
self.slice_lint_info.swap_remove(&local_id);
263265
}
264266
intravisit::walk_expr(self, expr);
265267
}

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ const LICENSES: &[&str] = &[
1313
"0BSD OR MIT OR Apache-2.0", // adler license
1414
"0BSD",
1515
"Apache-2.0 / MIT",
16+
"Apache-2.0 OR ISC OR MIT",
1617
"Apache-2.0 OR MIT",
1718
"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT", // wasi license
19+
"Apache-2.0",
1820
"Apache-2.0/MIT",
1921
"BSD-2-Clause OR Apache-2.0 OR MIT", // zerocopy
2022
"ISC",
@@ -217,6 +219,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
217219
"darling_core",
218220
"darling_macro",
219221
"datafrog",
222+
"deranged",
220223
"derivative",
221224
"derive_more",
222225
"derive_setters",
@@ -258,7 +261,6 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
258261
"indexmap",
259262
"intl-memoizer",
260263
"intl_pluralrules",
261-
"is-terminal",
262264
"itertools",
263265
"itoa",
264266
"jemalloc-sys",
@@ -278,6 +280,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
278280
"memoffset",
279281
"miniz_oxide",
280282
"nu-ansi-term",
283+
"num-conv",
281284
"num_cpus",
282285
"object",
283286
"odht",
@@ -290,6 +293,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
290293
"pin-project-lite",
291294
"polonius-engine",
292295
"portable-atomic", // dependency for platforms doesn't support `AtomicU64` in std
296+
"powerfmt",
293297
"ppv-lite86",
294298
"proc-macro-hack",
295299
"proc-macro2",

0 commit comments

Comments
 (0)