Skip to content
Closed
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
10 changes: 8 additions & 2 deletions compiler/rustc_attr_parsing/src/check_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ pub(crate) fn unexpected_cfg_name(
(name, name_span): (Symbol, Span),
value: Option<(Symbol, Span)>,
) -> errors::UnexpectedCfgName {
#[allow(rustc::potential_query_instability)]
#[allow(
rustc::potential_query_instability,
reason = "all uses either do not care about order or sort before use"
)]
let possibilities: Vec<Symbol> = sess.check_config.expecteds.keys().copied().collect();

let mut names_possibilities: Vec<_> = if value.is_none() {
Expand Down Expand Up @@ -425,7 +428,10 @@ pub(crate) fn unexpected_cfg_value(
}

fn possible_well_known_names_for_cfg_value(sess: &Session, value: Symbol) -> Vec<Symbol> {
#[allow(rustc::potential_query_instability)]
#[allow(
rustc::potential_query_instability,
reason = "the names are sorted before being returned"
)]
let mut names = sess
.check_config
.well_known_names
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_codegen_ssa/src/target_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ fn parse_rust_feature_list<'a>(
while let Some(new_feature) = new_features.pop() {
if features.insert(new_feature) {
if let Some(implied_features) = inverse_implied_features.get(&new_feature) {
#[allow(rustc::potential_query_instability)]
#[allow(
rustc::potential_query_instability,
reason = "traversal order does not change the final set"
)]
new_features.extend(implied_features)
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![allow(rustc::default_hash_types)]
#![allow(rustc::potential_query_instability)]
#![allow(rustc::potential_query_instability, reason = "unordered containers are this crate's API")]
#![cfg_attr(test, feature(test))]
#![deny(unsafe_op_in_unsafe_fn)]
#![feature(allocator_api)]
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_expand/src/mbe/macro_rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,10 @@ pub(super) fn try_match_macro_attr<'matcher, T: Tracker<'matcher>>(
match result {
Success(body_named_matches) => {
psess.gated_spans.merge(gated_spans_snapshot);
#[allow(rustc::potential_query_instability)]
#[allow(
rustc::potential_query_instability,
reason = "named matches are queried by metavariable name after merging"
)]
named_matches.extend(body_named_matches);
return Ok((i, rule, named_matches));
}
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_expand/src/mbe/transcribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,10 @@ fn transcribe_sequence<'tx, 'itp>(
let mut repeatables = Vec::new();
let mut non_repeatables = Vec::new();

#[allow(rustc::potential_query_instability)]
#[allow(
rustc::potential_query_instability,
reason = "diagnostic matching below handles equally good suggestions"
)]
for (name, matcher) in interp.iter() {
if matcher.is_repeatable() {
repeatables.push(name);
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_interface/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,10 @@ pub(crate) fn parse_check_cfg(dcx: DiagCtxtHandle<'_>, specs: Vec<String>) -> Ch
.and_modify(|v| match v {
ExpectedValues::Some(v) if !values_any_specified =>
{
#[allow(rustc::potential_query_instability)]
#[allow(
rustc::potential_query_instability,
reason = "extending this set does not observe insertion order"
)]
v.extend(values.clone())
}
ExpectedValues::Some(_) => *v = ExpectedValues::Any,
Expand Down
10 changes: 8 additions & 2 deletions compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,15 +518,21 @@ fn extend_type_not_partial_eq<'tcx>(
"must be annotated with `#[derive(PartialEq)]` to be usable in patterns",
);
}
#[allow(rustc::potential_query_instability)]
#[allow(
rustc::potential_query_instability,
reason = "the type names are sorted before emitting diagnostics"
)]
let mut manual: Vec<_> = v.manual.into_iter().map(|t| t.to_string()).collect();
manual.sort();
for ty in manual {
err.note(format!(
"`{ty}` must be annotated with `#[derive(PartialEq)]` to be usable in patterns, manual `impl`s are not sufficient; see https://doc.rust-lang.org/stable/std/marker/trait.StructuralPartialEq.html for details"
));
}
#[allow(rustc::potential_query_instability)]
#[allow(
rustc::potential_query_instability,
reason = "the type names are sorted before emitting diagnostics"
)]
let mut without: Vec<_> = v.without.into_iter().map(|t| t.to_string()).collect();
without.sort();
for ty in without {
Expand Down
10 changes: 8 additions & 2 deletions compiler/rustc_mir_dataflow/src/value_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ impl<V: Clone> Clone for StateData<V> {
impl<V: JoinSemiLattice + Clone> JoinSemiLattice for StateData<V> {
fn join(&mut self, other: &Self) -> bool {
let mut changed = false;
#[allow(rustc::potential_query_instability)]
#[allow(
rustc::potential_query_instability,
reason = "the lattice join is applied independently for each value index"
)]
for (i, v) in other.map.iter() {
match self.map.entry(*i) {
StdEntry::Vacant(e) => {
Expand Down Expand Up @@ -552,7 +555,10 @@ impl<'tcx> Map<'tcx> {
*opt_place = None;
}
}
#[allow(rustc::potential_query_instability)]
#[allow(
rustc::potential_query_instability,
reason = "each projection is retained or removed independently"
)]
self.projections.retain(|_, child| !self.inner_values[*child].is_empty());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ pub(super) fn check<'a>(cx: &LateContext<'a>, body: &Body<'a>) {
ControlFlow::<()>::Continue(())
});

#[allow(rustc::potential_query_instability)]
#[allow(
rustc::potential_query_instability,
reason = "the bindings are sorted by source span before being checked"
)]
let mut binding_vec: Vec<_> = bindings.into_iter().collect();
binding_vec.sort_by_key(|(_, info)| info.ty_span.lo());

Expand Down
Loading