Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo update #120454

Merged
merged 6 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,214 changes: 613 additions & 601 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion compiler/rustc_ast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ version = "0.0.0"
edition = "2021"

[dependencies]
# FIXME: bumping memchr to 2.7.1 causes linker errors in MSVC thin-lto
# tidy-alphabetical-start
bitflags = "2.4.1"
memchr = "2.5.0"
memchr = "=2.5.0"
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_index = { path = "../rustc_index" }
rustc_lexer = { path = "../rustc_lexer" }
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_borrowck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2479,7 +2479,8 @@ mod diags {
&mut self,
span: Span,
) -> Option<(DiagnosticBuilder<'tcx>, usize)> {
self.diags.buffered_mut_errors.remove(&span)
// FIXME(#120456) - is `swap_remove` correct?
self.diags.buffered_mut_errors.swap_remove(&span)
}

pub fn buffer_mut_error(&mut self, span: Span, t: DiagnosticBuilder<'tcx>, count: usize) {
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_borrowck/src/used_muts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ impl GatherUsedMutsVisitor<'_, '_, '_> {
// be those that were never initialized - we will consider those as being used as
// they will either have been removed by unreachable code optimizations; or linted
// as unused variables.
self.never_initialized_mut_locals.remove(&into.local);
// FIXME(#120456) - is `swap_remove` correct?
self.never_initialized_mut_locals.swap_remove(&into.local);
}
}

Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_codegen_ssa/src/target_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ fn asm_target_features(tcx: TyCtxt<'_>, did: DefId) -> &FxIndexSet<Symbol> {
match attrs.instruction_set {
None => {}
Some(InstructionSetAttr::ArmA32) => {
target_features.remove(&sym::thumb_mode);
// FIXME(#120456) - is `swap_remove` correct?
target_features.swap_remove(&sym::thumb_mode);
}
Some(InstructionSetAttr::ArmT32) => {
target_features.insert(sym::thumb_mode);
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_const_eval/src/const_eval/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ impl<K: Hash + Eq, V> interpret::AllocMap<K, V> for FxIndexMap<K, V> {
where
K: Borrow<Q>,
{
FxIndexMap::remove(self, k)
// FIXME(#120456) - is `swap_remove` correct?
FxIndexMap::swap_remove(self, k)
}

#[inline(always)]
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_const_eval/src/interpret/intern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ fn intern_shallow<'rt, 'mir, 'tcx, T, M: CompileTimeMachine<'mir, 'tcx, T>>(
) -> Result<impl Iterator<Item = CtfeProvenance> + 'tcx, ()> {
trace!("intern_shallow {:?}", alloc_id);
// remove allocation
let Some((_kind, mut alloc)) = ecx.memory.alloc_map.remove(&alloc_id) else {
// FIXME(#120456) - is `swap_remove` correct?
let Some((_kind, mut alloc)) = ecx.memory.alloc_map.swap_remove(&alloc_id) else {
return Err(());
};
// Set allocation mutability as appropriate. This is used by LLVM to put things into
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_errors/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,8 @@ impl HumanEmitter {
let mut to_add = FxHashMap::default();

for (depth, style) in depths {
if multilines.remove(&depth).is_none() {
// FIXME(#120456) - is `swap_remove` correct?
if multilines.swap_remove(&depth).is_none() {
to_add.insert(depth, style);
}
}
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,8 @@ impl DiagCtxt {
pub fn steal_diagnostic(&self, span: Span, key: StashKey) -> Option<DiagnosticBuilder<'_, ()>> {
let mut inner = self.inner.borrow_mut();
let key = (span.with_parent(None), key);
let diag = inner.stashed_diagnostics.remove(&key)?;
// FIXME(#120456) - is `swap_remove` correct?
let diag = inner.stashed_diagnostics.swap_remove(&key)?;
if diag.is_error() {
if diag.is_lint.is_none() {
inner.stashed_err_count -= 1;
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_hir_analysis/src/astconv/object_safety.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
for def_ids in associated_types.values_mut() {
for (projection_bound, span) in &projection_bounds {
let def_id = projection_bound.projection_def_id();
def_ids.remove(&def_id);
// FIXME(#120456) - is `swap_remove` correct?
def_ids.swap_remove(&def_id);
if tcx.generics_require_sized_self(def_id) {
tcx.emit_node_span_lint(
UNUSED_ASSOCIATED_TYPE_BOUNDS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1873,7 +1873,8 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> {
lifetime_ref: &'tcx hir::Lifetime,
bad_def: ResolvedArg,
) {
let old_value = self.map.defs.remove(&lifetime_ref.hir_id);
// FIXME(#120456) - is `swap_remove` correct?
let old_value = self.map.defs.swap_remove(&lifetime_ref.hir_id);
assert_eq!(old_value, Some(bad_def));
}
}
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let ctxt = {
let mut enclosing_breakables = self.enclosing_breakables.borrow_mut();
debug_assert!(enclosing_breakables.stack.len() == index + 1);
enclosing_breakables.by_id.remove(&id).expect("missing breakable context");
// FIXME(#120456) - is `swap_remove` correct?
enclosing_breakables.by_id.swap_remove(&id).expect("missing breakable context");
enclosing_breakables.stack.pop().expect("missing breakable context")
};
(ctxt, result)
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_infer/src/infer/opaque_types/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ impl<'tcx> OpaqueTypeStorage<'tcx> {
if let Some(idx) = idx {
self.opaque_types.get_mut(&key).unwrap().hidden_type = idx;
} else {
match self.opaque_types.remove(&key) {
// FIXME(#120456) - is `swap_remove` correct?
match self.opaque_types.swap_remove(&key) {
None => bug!("reverted opaque type inference that was never registered: {:?}", key),
Some(_) => {}
}
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_lint_defs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,8 @@ impl LintBuffer {
}

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

pub fn buffer_lint(
Expand Down
7 changes: 6 additions & 1 deletion compiler/rustc_llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ edition = "2021"
libc = "0.2.73"
# tidy-alphabetical-end

# FIXME: updating cc past 1.0.79 breaks libstd bootstrapping, pin
# to the last working version here so `cargo update` doesn't cause the
# a higher version to be selected
# https://github.com/rust-lang/cc-rs/issues/913
# 1.0.{84, 85} fix this but have been yanked
[build-dependencies]
# tidy-alphabetical-start
cc = "1.0.69"
cc = "=1.0.79"
# tidy-alphabetical-end
3 changes: 2 additions & 1 deletion compiler/rustc_mir_transform/src/dest_prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ impl<'alloc> Candidates<'alloc> {
let candidates = entry.get_mut();
Self::vec_filter_candidates(p, candidates, f, at);
if candidates.len() == 0 {
entry.remove();
// FIXME(#120456) - is `swap_remove` correct?
entry.swap_remove();
}
}

Expand Down
8 changes: 5 additions & 3 deletions compiler/rustc_passes/src/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,9 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
// available as we'd like it to be.
// FIXME: only remove `libc` when `stdbuild` is active.
// FIXME: remove special casing for `test`.
remaining_lib_features.remove(&sym::libc);
remaining_lib_features.remove(&sym::test);
// FIXME(#120456) - is `swap_remove` correct?
remaining_lib_features.swap_remove(&sym::libc);
remaining_lib_features.swap_remove(&sym::test);

/// For each feature in `defined_features`..
///
Expand Down Expand Up @@ -996,7 +997,8 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
unnecessary_stable_feature_lint(tcx, *span, feature, since);
}
}
remaining_lib_features.remove(&feature);
// FIXME(#120456) - is `swap_remove` correct?
remaining_lib_features.swap_remove(&feature);

// `feature` is the feature doing the implying, but `implied_by` is the feature with
// the attribute that establishes this relationship. `implied_by` is guaranteed to be a
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_resolve/src/check_unused.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ impl<'a, 'b, 'tcx> UnusedImportCheckVisitor<'a, 'b, 'tcx> {
} else {
// This trait import is definitely used, in a way other than
// method resolution.
self.r.maybe_unused_trait_imports.remove(&def_id);
// FIXME(#120456) - is `swap_remove` correct?
self.r.maybe_unused_trait_imports.swap_remove(&def_id);
if let Some(i) = self.unused_imports.get_mut(&self.base_id) {
i.unused.remove(&id);
}
Expand Down
12 changes: 8 additions & 4 deletions compiler/rustc_trait_selection/src/traits/auto_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,13 +524,15 @@ impl<'tcx> AutoTraitFinder<'tcx> {
if let Entry::Occupied(v) = vid_map.entry(*smaller) {
let smaller_deps = v.into_mut();
smaller_deps.larger.insert(*larger);
smaller_deps.larger.remove(&target);
// FIXME(#120456) - is `swap_remove` correct?
smaller_deps.larger.swap_remove(&target);
}

if let Entry::Occupied(v) = vid_map.entry(*larger) {
let larger_deps = v.into_mut();
larger_deps.smaller.insert(*smaller);
larger_deps.smaller.remove(&target);
// FIXME(#120456) - is `swap_remove` correct?
larger_deps.smaller.swap_remove(&target);
}
}
(&RegionTarget::RegionVid(v1), &RegionTarget::Region(r1)) => {
Expand All @@ -543,13 +545,15 @@ impl<'tcx> AutoTraitFinder<'tcx> {
if let Entry::Occupied(v) = vid_map.entry(*smaller) {
let smaller_deps = v.into_mut();
smaller_deps.larger.insert(*larger);
smaller_deps.larger.remove(&target);
// FIXME(#120456) - is `swap_remove` correct?
smaller_deps.larger.swap_remove(&target);
}

if let Entry::Occupied(v) = vid_map.entry(*larger) {
let larger_deps = v.into_mut();
larger_deps.smaller.insert(*smaller);
larger_deps.smaller.remove(&target);
// FIXME(#120456) - is `swap_remove` correct?
larger_deps.smaller.swap_remove(&target);
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_trait_selection/src/traits/specialize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@ pub(crate) fn to_pretty_impl_header(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Opti
for (p, _) in predicates {
if let Some(poly_trait_ref) = p.as_trait_clause() {
if Some(poly_trait_ref.def_id()) == sized_trait {
types_without_default_bounds.remove(&poly_trait_ref.self_ty().skip_binder());
// FIXME(#120456) - is `swap_remove` correct?
types_without_default_bounds.swap_remove(&poly_trait_ref.self_ty().skip_binder());
continue;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ version = 3

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

[[package]]
name = "uefi_qemu_test"
Expand Down
3 changes: 2 additions & 1 deletion src/tools/clippy/clippy_lints/src/copies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,8 @@ fn scan_block_for_eq<'tcx>(
for stmt in &stmts[stmts.len() - init..=stmts.len() - offset] {
if let StmtKind::Local(l) = stmt.kind {
l.pat.each_binding_or_first(&mut |_, id, _, _| {
eq.locals.remove(&id);
// FIXME(rust/#120456) - is `swap_remove` correct?
eq.locals.swap_remove(&id);
});
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/tools/clippy/clippy_lints/src/escape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,17 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
fn consume(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId) {
if cmt.place.projections.is_empty() {
if let PlaceBase::Local(lid) = cmt.place.base {
self.set.remove(&lid);
// FIXME(rust/#120456) - is `swap_remove` correct?
self.set.swap_remove(&lid);
}
}
}

fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId, _: ty::BorrowKind) {
if cmt.place.projections.is_empty() {
if let PlaceBase::Local(lid) = cmt.place.base {
self.set.remove(&lid);
// FIXME(rust/#120456) - is `swap_remove` correct?
self.set.swap_remove(&lid);
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/tools/clippy/clippy_lints/src/index_refutable_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ fn find_slice_values(cx: &LateContext<'_>, pat: &hir::Pat<'_>) -> FxIndexMap<hir
}
if sub_pat.is_some() {
removed_pat.insert(value_hir_id);
slices.remove(&value_hir_id);
// FIXME(rust/#120456) - is `swap_remove` correct?
slices.swap_remove(&value_hir_id);
return;
}

Expand Down Expand Up @@ -259,7 +260,8 @@ impl<'a, 'tcx> Visitor<'tcx> for SliceIndexLintingVisitor<'a, 'tcx> {
}

// The slice was used for something other than indexing
self.slice_lint_info.remove(&local_id);
// FIXME(rust/#120456) - is `swap_remove` correct?
self.slice_lint_info.swap_remove(&local_id);
}
intravisit::walk_expr(self, expr);
}
Expand Down
3 changes: 2 additions & 1 deletion src/tools/clippy/clippy_lints/src/matches/match_same_arms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ fn pat_contains_local(pat: &Pat<'_>, id: HirId) -> bool {
/// Returns true if all the bindings in the `Pat` are in `ids` and vice versa
fn bindings_eq(pat: &Pat<'_>, mut ids: HirIdSet) -> bool {
let mut result = true;
pat.each_binding_or_first(&mut |_, id, _, _| result &= ids.remove(&id));
// FIXME(rust/#120456) - is `swap_remove` correct?
pat.each_binding_or_first(&mut |_, id, _, _| result &= ids.swap_remove(&id));
result && ids.is_empty()
}
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ impl<'tcx> euv::Delegate<'tcx> for MutablyUsedVariablesCtxt<'tcx> {
self.add_mutably_used_var(*vid);
}
self.prev_bind = None;
self.prev_move_to_closure.remove(vid);
// FIXME(rust/#120456) - is `swap_remove` correct?
self.prev_move_to_closure.swap_remove(vid);
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/tools/clippy/clippy_lints/src/no_effect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ impl<'tcx> LateLintPass<'tcx> for NoEffect {

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

fn check_expr(&mut self, _: &LateContext<'tcx>, expr: &'tcx rustc_hir::Expr<'tcx>) {
if let Some(def_id) = path_to_local(expr) {
self.underscore_bindings.remove(&def_id);
// FIXME(rust/#120456) - is `swap_remove` correct?
self.underscore_bindings.swap_remove(&def_id);
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/tools/clippy/clippy_lints/src/only_used_in_recursion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ impl Params {
param.uses = Vec::new();
let key = (param.fn_id, param.idx);
self.by_fn.remove(&key);
self.by_id.remove(&id);
// FIXME(rust/#120456) - is `swap_remove` correct?
self.by_id.swap_remove(&id);
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/tools/tidy/src/deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ const LICENSES: &[&str] = &[
"0BSD OR MIT OR Apache-2.0", // adler license
"0BSD",
"Apache-2.0 / MIT",
"Apache-2.0 OR ISC OR MIT",
"Apache-2.0 OR MIT",
"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT", // wasi license
"Apache-2.0",
"Apache-2.0/MIT",
"BSD-2-Clause OR Apache-2.0 OR MIT", // zerocopy
"ISC",
Expand Down Expand Up @@ -217,6 +219,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
"darling_core",
"darling_macro",
"datafrog",
"deranged",
"derivative",
"derive_more",
"derive_setters",
Expand Down Expand Up @@ -258,7 +261,6 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
"indexmap",
"intl-memoizer",
"intl_pluralrules",
"is-terminal",
"itertools",
"itoa",
"jemalloc-sys",
Expand All @@ -278,6 +280,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
"memoffset",
"miniz_oxide",
"nu-ansi-term",
"num-conv",
"num_cpus",
"object",
"odht",
Expand All @@ -290,6 +293,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
"pin-project-lite",
"polonius-engine",
"portable-atomic", // dependency for platforms doesn't support `AtomicU64` in std
"powerfmt",
"ppv-lite86",
"proc-macro-hack",
"proc-macro2",
Expand Down
Loading
Loading