Auto merge of #131160 - ismailarilik:handle-potential-query-instability-lint-for-rustc-middle, r=oli-obk

Handle `rustc_middle` cases of `rustc::potential_query_instability` lint

This PR removes `#![allow(rustc::potential_query_instability)]` line from [`compiler/rustc_middle/src/lib.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_middle/src/lib.rs#L29) and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors.

A somewhat tracking issue: https://github.com/rust-lang/rust/issues/84447

r? `@compiler-errors`
This commit is contained in:
bors
2025-05-06 01:36:23 +00:00
7 changed files with 31 additions and 31 deletions
+1 -1
View File
@@ -154,7 +154,7 @@ fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
(span, false)
};
let mut imports = used_imports.items().map(ToString::to_string).into_sorted_stable_ord();
let mut imports: Vec<_> = used_imports.iter().map(ToString::to_string).collect();
let imports_string = if imports.len() == 1 {
imports.pop().unwrap()
} else if braced_glob {
+5 -5
View File
@@ -16,7 +16,7 @@ use crate::fn_mod::foo;
//~^ wildcard_imports
use crate::mod_mod::inner_mod;
//~^ wildcard_imports
use crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod};
use crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod};
//~^ wildcard_imports
#[macro_use]
use crate::struct_mod::{A, inner_struct_mod};
@@ -26,7 +26,7 @@ use crate::struct_mod::{A, inner_struct_mod};
use wildcard_imports_helper::inner::inner_for_self_import;
use wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar;
//~^ wildcard_imports
use wildcard_imports_helper::{ExternA, extern_foo};
use wildcard_imports_helper::{extern_foo, ExternA};
//~^ wildcard_imports
use std::io::prelude::*;
@@ -138,7 +138,7 @@ mod in_fn_test {
fn test_extern() {
use wildcard_imports_helper::inner::inner_for_self_import::{self, inner_extern_foo};
//~^ wildcard_imports
use wildcard_imports_helper::{ExternA, extern_foo};
use wildcard_imports_helper::{extern_foo, ExternA};
//~^ wildcard_imports
inner_for_self_import::inner_extern_foo();
@@ -160,7 +160,7 @@ mod in_fn_test {
}
fn test_extern_reexported() {
use wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported};
use wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum};
//~^ wildcard_imports
extern_exported();
@@ -190,7 +190,7 @@ mod in_fn_test {
}
fn test_reexported() {
use crate::in_fn_test::{ExportedEnum, ExportedStruct, exported};
use crate::in_fn_test::{exported, ExportedStruct, ExportedEnum};
//~^ wildcard_imports
exported();
+5 -5
View File
@@ -17,7 +17,7 @@ error: usage of wildcard import
--> tests/ui/wildcard_imports.rs:19:5
|
LL | use crate::multi_fn_mod::*;
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod}`
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod}`
error: usage of wildcard import
--> tests/ui/wildcard_imports.rs:22:5
@@ -35,7 +35,7 @@ error: usage of wildcard import
--> tests/ui/wildcard_imports.rs:29:5
|
LL | use wildcard_imports_helper::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`
error: usage of wildcard import
--> tests/ui/wildcard_imports.rs:100:13
@@ -59,7 +59,7 @@ error: usage of wildcard import
--> tests/ui/wildcard_imports.rs:141:13
|
LL | use wildcard_imports_helper::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`
error: usage of wildcard import
--> tests/ui/wildcard_imports.rs:154:20
@@ -77,13 +77,13 @@ error: usage of wildcard import
--> tests/ui/wildcard_imports.rs:163:13
|
LL | use wildcard_imports_helper::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported}`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum}`
error: usage of wildcard import
--> tests/ui/wildcard_imports.rs:193:9
|
LL | use crate::in_fn_test::*;
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{ExportedEnum, ExportedStruct, exported}`
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{exported, ExportedStruct, ExportedEnum}`
error: usage of wildcard import
--> tests/ui/wildcard_imports.rs:203:9
@@ -14,7 +14,7 @@ use crate::fn_mod::foo;
//~^ wildcard_imports
use crate::mod_mod::inner_mod;
//~^ wildcard_imports
use crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod};
use crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod};
//~^ wildcard_imports
use crate::struct_mod::{A, inner_struct_mod};
//~^ wildcard_imports
@@ -23,7 +23,7 @@ use crate::struct_mod::{A, inner_struct_mod};
use wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar;
//~^ wildcard_imports
use wildcard_imports_helper::prelude::v1::*;
use wildcard_imports_helper::{ExternA, extern_foo};
use wildcard_imports_helper::{extern_foo, ExternA};
//~^ wildcard_imports
use std::io::prelude::*;
@@ -132,7 +132,7 @@ mod in_fn_test {
fn test_extern() {
use wildcard_imports_helper::inner::inner_for_self_import::{self, inner_extern_foo};
//~^ wildcard_imports
use wildcard_imports_helper::{ExternA, extern_foo};
use wildcard_imports_helper::{extern_foo, ExternA};
//~^ wildcard_imports
inner_for_self_import::inner_extern_foo();
@@ -154,7 +154,7 @@ mod in_fn_test {
}
fn test_extern_reexported() {
use wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported};
use wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum};
//~^ wildcard_imports
extern_exported();
@@ -184,7 +184,7 @@ mod in_fn_test {
}
fn test_reexported() {
use crate::in_fn_test::{ExportedEnum, ExportedStruct, exported};
use crate::in_fn_test::{exported, ExportedStruct, ExportedEnum};
//~^ wildcard_imports
exported();
@@ -17,7 +17,7 @@ error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:17:5
|
LL | use crate::multi_fn_mod::*;
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod}`
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod}`
error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:19:5
@@ -35,7 +35,7 @@ error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:26:5
|
LL | use wildcard_imports_helper::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`
error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:95:13
@@ -59,7 +59,7 @@ error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:135:13
|
LL | use wildcard_imports_helper::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`
error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:148:20
@@ -77,13 +77,13 @@ error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:157:13
|
LL | use wildcard_imports_helper::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported}`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum}`
error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:187:9
|
LL | use crate::in_fn_test::*;
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{ExportedEnum, ExportedStruct, exported}`
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{exported, ExportedStruct, ExportedEnum}`
error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:197:9
@@ -14,7 +14,7 @@ use crate::fn_mod::foo;
//~^ wildcard_imports
use crate::mod_mod::inner_mod;
//~^ wildcard_imports
use crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod};
use crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod};
//~^ wildcard_imports
use crate::struct_mod::{A, inner_struct_mod};
//~^ wildcard_imports
@@ -23,7 +23,7 @@ use crate::struct_mod::{A, inner_struct_mod};
use wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar;
//~^ wildcard_imports
use wildcard_imports_helper::prelude::v1::*;
use wildcard_imports_helper::{ExternA, extern_foo};
use wildcard_imports_helper::{extern_foo, ExternA};
//~^ wildcard_imports
use std::io::prelude::*;
@@ -132,7 +132,7 @@ mod in_fn_test {
fn test_extern() {
use wildcard_imports_helper::inner::inner_for_self_import::{self, inner_extern_foo};
//~^ wildcard_imports
use wildcard_imports_helper::{ExternA, extern_foo};
use wildcard_imports_helper::{extern_foo, ExternA};
//~^ wildcard_imports
inner_for_self_import::inner_extern_foo();
@@ -154,7 +154,7 @@ mod in_fn_test {
}
fn test_extern_reexported() {
use wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported};
use wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum};
//~^ wildcard_imports
extern_exported();
@@ -184,7 +184,7 @@ mod in_fn_test {
}
fn test_reexported() {
use crate::in_fn_test::{ExportedEnum, ExportedStruct, exported};
use crate::in_fn_test::{exported, ExportedStruct, ExportedEnum};
//~^ wildcard_imports
exported();
@@ -17,7 +17,7 @@ error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:17:5
|
LL | use crate::multi_fn_mod::*;
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod}`
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod}`
error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:19:5
@@ -35,7 +35,7 @@ error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:26:5
|
LL | use wildcard_imports_helper::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`
error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:95:13
@@ -59,7 +59,7 @@ error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:135:13
|
LL | use wildcard_imports_helper::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`
error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:148:20
@@ -77,13 +77,13 @@ error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:157:13
|
LL | use wildcard_imports_helper::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported}`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum}`
error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:187:9
|
LL | use crate::in_fn_test::*;
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{ExportedEnum, ExportedStruct, exported}`
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{exported, ExportedStruct, ExportedEnum}`
error: usage of wildcard import
--> tests/ui/wildcard_imports_2021.rs:197:9