Skip to content

Commit ae2427d

Browse files
committed
rustc_interface: 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 0e3e16c commit ae2427d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

compiler/rustc_interface/src/lib.rs

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

compiler/rustc_interface/src/passes.rs

+7
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ fn early_lint_checks(tcx: TyCtxt<'_>, (): ()) {
306306

307307
// Gate identifiers containing invalid Unicode codepoints that were recovered during lexing.
308308
sess.parse_sess.bad_unicode_identifiers.with_lock(|identifiers| {
309+
// We will soon sort, so the initial order does not matter.
310+
#[allow(rustc::potential_query_instability)]
309311
let mut identifiers: Vec<_> = identifiers.drain().collect();
310312
identifiers.sort_by_key(|&(key, _)| key);
311313
for (ident, mut spans) in identifiers.into_iter() {
@@ -431,6 +433,9 @@ fn write_out_deps(tcx: TyCtxt<'_>, outputs: &OutputFilenames, out_filenames: &[P
431433
escape_dep_filename(&file.prefer_local().to_string())
432434
};
433435

436+
// The entries will be used to declare dependencies beween files in a
437+
// Makefile-like output, so the iteration order does not matter.
438+
#[allow(rustc::potential_query_instability)]
434439
let extra_tracked_files =
435440
file_depinfo.iter().map(|path_sym| normalize_path(PathBuf::from(path_sym.as_str())));
436441
files.extend(extra_tracked_files);
@@ -486,6 +491,8 @@ fn write_out_deps(tcx: TyCtxt<'_>, outputs: &OutputFilenames, out_filenames: &[P
486491
// Emit special comments with information about accessed environment variables.
487492
let env_depinfo = sess.parse_sess.env_depinfo.borrow();
488493
if !env_depinfo.is_empty() {
494+
// We will soon sort, so the initial order does not matter.
495+
#[allow(rustc::potential_query_instability)]
489496
let mut envs: Vec<_> = env_depinfo
490497
.iter()
491498
.map(|(k, v)| (escape_dep_env(*k), v.map(escape_dep_env)))

0 commit comments

Comments
 (0)