Skip to content

Commit 0a896b4

Browse files
authored
Rollup merge of #118637 - Enselic:query-instability-2, r=cjgillot
rustc_symbol_mangling,rustc_interface,rustc_driver_impl: Enforce `rustc::potential_query_instability` lint We currently allow the `rustc::potential_query_instability` lint in `rustc_symbol_mangling`, `rustc_interface` and `rustc_driver_impl`. Handle each instance of the lint in these crates and then begin to enforce the lint in these crates. Part of #84447 which is **E-help-wanted**.
2 parents 834a8e8 + d7d867d commit 0a896b4

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

Diff for: compiler/rustc_driver_impl/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#![feature(let_chains)]
1414
#![feature(panic_update_hook)]
1515
#![recursion_limit = "256"]
16-
#![allow(rustc::potential_query_instability)]
1716
#![deny(rustc::untranslatable_diagnostic)]
1817
#![deny(rustc::diagnostic_outside_of_impl)]
1918

Diff for: 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

Diff for: 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)))

Diff for: compiler/rustc_symbol_mangling/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
#![allow(internal_features)]
9494
#![feature(never_type)]
9595
#![recursion_limit = "256"]
96-
#![allow(rustc::potential_query_instability)]
9796
#![deny(rustc::untranslatable_diagnostic)]
9897
#![deny(rustc::diagnostic_outside_of_impl)]
9998

0 commit comments

Comments
 (0)