Skip to content

Commit 8ce5b3b

Browse files
authored
Unrolled build for rust-lang#118865
Rollup merge of rust-lang#118865 - Enselic:rustc_codegen_llvm-lint-fix, r=petrochenkov rustc_codegen_llvm: Enforce `rustc::potential_query_instability` lint Stop allowing `rustc::potential_query_instability` on all of `rustc_codegen_llvm` and instead allow it on a case-by-case basis if it is safe to do so. In this case, all 2 instances are safe to allow. Part of rust-lang#84447 which is E-help-wanted.
2 parents 835ed00 + f44ccba commit 8ce5b3b

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

compiler/rustc_codegen_llvm/src/back/lto.rs

+3
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,9 @@ impl ThinLTOKeysMap {
816816
use std::io::Write;
817817
let file = File::create(path)?;
818818
let mut writer = io::BufWriter::new(file);
819+
// The entries are loaded back into a hash map in `load_from_file()`, so
820+
// the order in which we write them to file here does not matter.
821+
#[allow(rustc::potential_query_instability)]
819822
for (module, key) in &self.keys {
820823
writeln!(writer, "{module} {key}")?;
821824
}

compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs

+5
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ pub fn finalize(cx: &CodegenCx<'_, '_>) {
5858
return;
5959
}
6060

61+
// The entries of the map are only used to get a list of all files with
62+
// coverage info. In the end the list of files is passed into
63+
// `GlobalFileTable::new()` which internally do `.sort_unstable_by()`, so
64+
// the iteration order here does not matter.
65+
#[allow(rustc::potential_query_instability)]
6166
let function_coverage_entries = function_coverage_map
6267
.into_iter()
6368
.map(|(instance, function_coverage)| (instance, function_coverage.into_finished()))

compiler/rustc_codegen_llvm/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#![feature(never_type)]
1818
#![feature(impl_trait_in_assoc_type)]
1919
#![recursion_limit = "256"]
20-
#![allow(rustc::potential_query_instability)]
2120
#![deny(rustc::untranslatable_diagnostic)]
2221
#![deny(rustc::diagnostic_outside_of_impl)]
2322

0 commit comments

Comments
 (0)