Fix adjacent code

This commit is contained in:
Samuel Moelius 2025-04-03 21:12:58 -04:00
parent ddf7f18190
commit 1a2c5a35b9
4 changed files with 8 additions and 4 deletions

View File

@ -17,7 +17,7 @@ use std::path::Path;
use std::sync::Arc;
use derive_setters::Setters;
use rustc_data_structures::fx::{FxHashMap, FxIndexMap, FxIndexSet};
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
use rustc_data_structures::sync::{DynSend, IntoDynSyncSend};
use rustc_error_messages::{FluentArgs, SpanLabel};
use rustc_lexer;
@ -1840,7 +1840,7 @@ impl HumanEmitter {
!is_cont && line_idx + 1 == annotated_file.lines.len(),
);
let mut to_add = FxHashMap::default();
let mut to_add = FxIndexMap::default();
for (depth, style) in depths {
// FIXME(#120456) - is `swap_remove` correct?

View File

@ -275,7 +275,9 @@ pub(crate) fn parse_check_cfg(dcx: DiagCtxtHandle<'_>, specs: Vec<String>) -> Ch
.expecteds
.entry(name.name)
.and_modify(|v| match v {
ExpectedValues::Some(v) if !values_any_specified => {
ExpectedValues::Some(v) if !values_any_specified =>
{
#[allow(rustc::potential_query_instability)]
v.extend(values.clone())
}
ExpectedValues::Some(_) => *v = ExpectedValues::Any,

View File

@ -3934,12 +3934,14 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
// Move up the non-overlapping bindings to the or-pattern.
// Existing bindings just get "merged".
let collected = bindings.pop().unwrap().1;
#[allow(rustc::potential_query_instability)] // FIXME
bindings.last_mut().unwrap().1.extend(collected);
}
// This or-pattern itself can itself be part of a product,
// e.g. `(V1(a) | V2(a), a)` or `(a, V1(a) | V2(a))`.
// Both cases bind `a` again in a product pattern and must be rejected.
let collected = bindings.pop().unwrap().1;
#[allow(rustc::potential_query_instability)] // FIXME
bindings.last_mut().unwrap().1.extend(collected);
// Prevent visiting `ps` as we've already done so above.

View File

@ -47,7 +47,7 @@ pub(crate) struct Cache {
/// Similar to `paths`, but only holds external paths. This is only used for
/// generating explicit hyperlinks to other crates.
pub(crate) external_paths: FxHashMap<DefId, (Vec<Symbol>, ItemType)>,
pub(crate) external_paths: FxIndexMap<DefId, (Vec<Symbol>, ItemType)>,
/// Maps local `DefId`s of exported types to fully qualified paths.
/// Unlike 'paths', this mapping ignores any renames that occur