Skip to content

Commit d87460a

Browse files
committed
rustc_session: Address all rustc::potential_query_instability lints
Instead of allowing `rustc::potential_query_instability` on the whole crate we go over each lint and allow it individually if it is safe to do. Turns out all instances were safe to allow in this crate.
1 parent 8b6a4a9 commit d87460a

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

compiler/rustc_session/src/code_stats.rs

+4
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ impl CodeStats {
132132

133133
pub fn print_type_sizes(&self) {
134134
let type_sizes = self.type_sizes.borrow();
135+
// We will soon sort, so the initial order does not matter.
136+
#[allow(rustc::potential_query_instability)]
135137
let mut sorted: Vec<_> = type_sizes.iter().collect();
136138

137139
// Primary sort: large-to-small.
@@ -227,6 +229,8 @@ impl CodeStats {
227229
}
228230

229231
pub fn print_vtable_sizes(&self, crate_name: Symbol) {
232+
// We will soon sort, so the initial order does not matter.
233+
#[allow(rustc::potential_query_instability)]
230234
let mut infos =
231235
std::mem::take(&mut *self.vtable_sizes.lock()).into_values().collect::<Vec<_>>();
232236

compiler/rustc_session/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#![feature(map_many_mut)]
77
#![feature(iter_intersperse)]
88
#![recursion_limit = "256"]
9-
#![allow(rustc::potential_query_instability)]
109
#![deny(rustc::untranslatable_diagnostic)]
1110
#![deny(rustc::diagnostic_outside_of_impl)]
1211
#![allow(internal_features)]

compiler/rustc_session/src/parse.rs

+3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ impl GatedSpans {
5151
/// Prepend the given set of `spans` onto the set in `self`.
5252
pub fn merge(&self, mut spans: FxHashMap<Symbol, Vec<Span>>) {
5353
let mut inner = self.spans.borrow_mut();
54+
// The entries will be moved to another map so the drain order does not
55+
// matter.
56+
#[allow(rustc::potential_query_instability)]
5457
for (gate, mut gate_spans) in inner.drain() {
5558
spans.entry(gate).or_default().append(&mut gate_spans);
5659
}

0 commit comments

Comments
 (0)