-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add missing potential_query_instability for keys and values in hashmap #120485
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -267,6 +267,7 @@ impl CguReuseTracker { | |
|
||
fn check_expected_reuse(&self, sess: &Session) { | ||
if let Some(ref data) = self.data { | ||
#[allow(rustc::potential_query_instability)] | ||
let mut keys = data.expected_reuse.keys().collect::<Vec<_>>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can fix this properly by using |
||
keys.sort_unstable(); | ||
for cgu_name in keys { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -682,6 +682,7 @@ fn link_dwarf_object<'a>( | |
} | ||
|
||
// Input rlibs contain .o/.dwo files from dependencies. | ||
#[allow(rustc::potential_query_instability)] | ||
let input_rlibs = cg_results | ||
.crate_info | ||
.used_crate_source | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you turn the // Input rlibs contain .o/.dwo files from dependencies.
let input_rlibs = cg_results
.crate_info
.used_crate_source
.items()
.filter_map(|(_, csource)| csource.rlib.as_ref())
.map(|(path, _)| path)
.into_sorted_stable_ord(); |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1950,6 +1950,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { | |
) { | ||
let len = remaining_fields.len(); | ||
|
||
#[allow(rustc::potential_query_instability)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be straightforward to make |
||
let mut displayable_field_names: Vec<&str> = | ||
remaining_fields.keys().map(|ident| ident.as_str()).collect(); | ||
// sorting &str primitives here, sort_unstable is ok | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -326,11 +326,9 @@ impl LintStore { | |
|
||
/// True if this symbol represents a lint group name. | ||
pub fn is_lint_group(&self, lint_name: Symbol) -> bool { | ||
debug!( | ||
"is_lint_group(lint_name={:?}, lint_groups={:?})", | ||
lint_name, | ||
self.lint_groups.keys().collect::<Vec<_>>() | ||
); | ||
#[allow(rustc::potential_query_instability)] | ||
let lint_groups = self.lint_groups.keys().collect::<Vec<_>>(); | ||
debug!("is_lint_group(lint_name={:?}, lint_groups={:?})", lint_name, lint_groups); | ||
Comment on lines
-329
to
+331
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will collect things on release now, instead of debug only, next one too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you are right, I will clean this up when I replace HashMap. |
||
let lint_name_str = lint_name.as_str(); | ||
self.lint_groups.contains_key(lint_name_str) || { | ||
let warnings_name_str = crate::WARNINGS.name_lower(); | ||
|
@@ -374,8 +372,12 @@ impl LintStore { | |
None => { | ||
// 1. The tool is currently running, so this lint really doesn't exist. | ||
// FIXME: should this handle tools that never register a lint, like rustfmt? | ||
debug!("lints={:?}", self.by_name.keys().collect::<Vec<_>>()); | ||
#[allow(rustc::potential_query_instability)] | ||
let lints = self.by_name.keys().collect::<Vec<_>>(); | ||
debug!("lints={:?}", lints); | ||
let tool_prefix = format!("{tool_name}::"); | ||
|
||
#[allow(rustc::potential_query_instability)] | ||
return if self.by_name.keys().any(|lint| lint.starts_with(&tool_prefix)) { | ||
self.no_lint_suggestion(&complete_name, tool_name.as_str()) | ||
} else { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try turning the
items
field inCodegenUnit
into anFxIndexMap
. That should make iteration stable (if the collection is built in a deterministic order). AnUnordMap
would be even better, but I suspect that that would be more work.