Skip to content

Commit 32e150d

Browse files
committed
Auto merge of rust-lang#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: rust-lang#84447 r? `@compiler-errors`
2 parents afaedbb + 59aaecb commit 32e150d

7 files changed

+31
-31
lines changed

clippy_lints/src/wildcard_imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl LateLintPass<'_> for WildcardImports {
154154
(span, false)
155155
};
156156

157-
let mut imports = used_imports.items().map(ToString::to_string).into_sorted_stable_ord();
157+
let mut imports: Vec<_> = used_imports.iter().map(ToString::to_string).collect();
158158
let imports_string = if imports.len() == 1 {
159159
imports.pop().unwrap()
160160
} else if braced_glob {

tests/ui/wildcard_imports.fixed

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::fn_mod::foo;
1616
//~^ wildcard_imports
1717
use crate::mod_mod::inner_mod;
1818
//~^ wildcard_imports
19-
use crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod};
19+
use crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod};
2020
//~^ wildcard_imports
2121
#[macro_use]
2222
use crate::struct_mod::{A, inner_struct_mod};
@@ -26,7 +26,7 @@ use crate::struct_mod::{A, inner_struct_mod};
2626
use wildcard_imports_helper::inner::inner_for_self_import;
2727
use wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar;
2828
//~^ wildcard_imports
29-
use wildcard_imports_helper::{ExternA, extern_foo};
29+
use wildcard_imports_helper::{extern_foo, ExternA};
3030
//~^ wildcard_imports
3131

3232
use std::io::prelude::*;
@@ -138,7 +138,7 @@ mod in_fn_test {
138138
fn test_extern() {
139139
use wildcard_imports_helper::inner::inner_for_self_import::{self, inner_extern_foo};
140140
//~^ wildcard_imports
141-
use wildcard_imports_helper::{ExternA, extern_foo};
141+
use wildcard_imports_helper::{extern_foo, ExternA};
142142
//~^ wildcard_imports
143143

144144
inner_for_self_import::inner_extern_foo();
@@ -160,7 +160,7 @@ mod in_fn_test {
160160
}
161161

162162
fn test_extern_reexported() {
163-
use wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported};
163+
use wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum};
164164
//~^ wildcard_imports
165165

166166
extern_exported();
@@ -190,7 +190,7 @@ mod in_fn_test {
190190
}
191191

192192
fn test_reexported() {
193-
use crate::in_fn_test::{ExportedEnum, ExportedStruct, exported};
193+
use crate::in_fn_test::{exported, ExportedStruct, ExportedEnum};
194194
//~^ wildcard_imports
195195

196196
exported();

tests/ui/wildcard_imports.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ error: usage of wildcard import
1717
--> tests/ui/wildcard_imports.rs:19:5
1818
|
1919
LL | use crate::multi_fn_mod::*;
20-
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod}`
20+
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod}`
2121

2222
error: usage of wildcard import
2323
--> tests/ui/wildcard_imports.rs:22:5
@@ -35,7 +35,7 @@ error: usage of wildcard import
3535
--> tests/ui/wildcard_imports.rs:29:5
3636
|
3737
LL | use wildcard_imports_helper::*;
38-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`
38+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`
3939

4040
error: usage of wildcard import
4141
--> tests/ui/wildcard_imports.rs:100:13
@@ -59,7 +59,7 @@ error: usage of wildcard import
5959
--> tests/ui/wildcard_imports.rs:141:13
6060
|
6161
LL | use wildcard_imports_helper::*;
62-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`
62+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`
6363

6464
error: usage of wildcard import
6565
--> tests/ui/wildcard_imports.rs:154:20
@@ -77,13 +77,13 @@ error: usage of wildcard import
7777
--> tests/ui/wildcard_imports.rs:163:13
7878
|
7979
LL | use wildcard_imports_helper::*;
80-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported}`
80+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum}`
8181

8282
error: usage of wildcard import
8383
--> tests/ui/wildcard_imports.rs:193:9
8484
|
8585
LL | use crate::in_fn_test::*;
86-
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{ExportedEnum, ExportedStruct, exported}`
86+
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{exported, ExportedStruct, ExportedEnum}`
8787

8888
error: usage of wildcard import
8989
--> tests/ui/wildcard_imports.rs:203:9

tests/ui/wildcard_imports_2021.edition2018.fixed

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::fn_mod::foo;
1414
//~^ wildcard_imports
1515
use crate::mod_mod::inner_mod;
1616
//~^ wildcard_imports
17-
use crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod};
17+
use crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod};
1818
//~^ wildcard_imports
1919
use crate::struct_mod::{A, inner_struct_mod};
2020
//~^ wildcard_imports
@@ -23,7 +23,7 @@ use crate::struct_mod::{A, inner_struct_mod};
2323
use wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar;
2424
//~^ wildcard_imports
2525
use wildcard_imports_helper::prelude::v1::*;
26-
use wildcard_imports_helper::{ExternA, extern_foo};
26+
use wildcard_imports_helper::{extern_foo, ExternA};
2727
//~^ wildcard_imports
2828

2929
use std::io::prelude::*;
@@ -132,7 +132,7 @@ mod in_fn_test {
132132
fn test_extern() {
133133
use wildcard_imports_helper::inner::inner_for_self_import::{self, inner_extern_foo};
134134
//~^ wildcard_imports
135-
use wildcard_imports_helper::{ExternA, extern_foo};
135+
use wildcard_imports_helper::{extern_foo, ExternA};
136136
//~^ wildcard_imports
137137

138138
inner_for_self_import::inner_extern_foo();
@@ -154,7 +154,7 @@ mod in_fn_test {
154154
}
155155

156156
fn test_extern_reexported() {
157-
use wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported};
157+
use wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum};
158158
//~^ wildcard_imports
159159

160160
extern_exported();
@@ -184,7 +184,7 @@ mod in_fn_test {
184184
}
185185

186186
fn test_reexported() {
187-
use crate::in_fn_test::{ExportedEnum, ExportedStruct, exported};
187+
use crate::in_fn_test::{exported, ExportedStruct, ExportedEnum};
188188
//~^ wildcard_imports
189189

190190
exported();

tests/ui/wildcard_imports_2021.edition2018.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ error: usage of wildcard import
1717
--> tests/ui/wildcard_imports_2021.rs:17:5
1818
|
1919
LL | use crate::multi_fn_mod::*;
20-
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod}`
20+
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod}`
2121

2222
error: usage of wildcard import
2323
--> tests/ui/wildcard_imports_2021.rs:19:5
@@ -35,7 +35,7 @@ error: usage of wildcard import
3535
--> tests/ui/wildcard_imports_2021.rs:26:5
3636
|
3737
LL | use wildcard_imports_helper::*;
38-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`
38+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`
3939

4040
error: usage of wildcard import
4141
--> tests/ui/wildcard_imports_2021.rs:95:13
@@ -59,7 +59,7 @@ error: usage of wildcard import
5959
--> tests/ui/wildcard_imports_2021.rs:135:13
6060
|
6161
LL | use wildcard_imports_helper::*;
62-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`
62+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`
6363

6464
error: usage of wildcard import
6565
--> tests/ui/wildcard_imports_2021.rs:148:20
@@ -77,13 +77,13 @@ error: usage of wildcard import
7777
--> tests/ui/wildcard_imports_2021.rs:157:13
7878
|
7979
LL | use wildcard_imports_helper::*;
80-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported}`
80+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum}`
8181

8282
error: usage of wildcard import
8383
--> tests/ui/wildcard_imports_2021.rs:187:9
8484
|
8585
LL | use crate::in_fn_test::*;
86-
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{ExportedEnum, ExportedStruct, exported}`
86+
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{exported, ExportedStruct, ExportedEnum}`
8787

8888
error: usage of wildcard import
8989
--> tests/ui/wildcard_imports_2021.rs:197:9

tests/ui/wildcard_imports_2021.edition2021.fixed

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::fn_mod::foo;
1414
//~^ wildcard_imports
1515
use crate::mod_mod::inner_mod;
1616
//~^ wildcard_imports
17-
use crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod};
17+
use crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod};
1818
//~^ wildcard_imports
1919
use crate::struct_mod::{A, inner_struct_mod};
2020
//~^ wildcard_imports
@@ -23,7 +23,7 @@ use crate::struct_mod::{A, inner_struct_mod};
2323
use wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar;
2424
//~^ wildcard_imports
2525
use wildcard_imports_helper::prelude::v1::*;
26-
use wildcard_imports_helper::{ExternA, extern_foo};
26+
use wildcard_imports_helper::{extern_foo, ExternA};
2727
//~^ wildcard_imports
2828

2929
use std::io::prelude::*;
@@ -132,7 +132,7 @@ mod in_fn_test {
132132
fn test_extern() {
133133
use wildcard_imports_helper::inner::inner_for_self_import::{self, inner_extern_foo};
134134
//~^ wildcard_imports
135-
use wildcard_imports_helper::{ExternA, extern_foo};
135+
use wildcard_imports_helper::{extern_foo, ExternA};
136136
//~^ wildcard_imports
137137

138138
inner_for_self_import::inner_extern_foo();
@@ -154,7 +154,7 @@ mod in_fn_test {
154154
}
155155

156156
fn test_extern_reexported() {
157-
use wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported};
157+
use wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum};
158158
//~^ wildcard_imports
159159

160160
extern_exported();
@@ -184,7 +184,7 @@ mod in_fn_test {
184184
}
185185

186186
fn test_reexported() {
187-
use crate::in_fn_test::{ExportedEnum, ExportedStruct, exported};
187+
use crate::in_fn_test::{exported, ExportedStruct, ExportedEnum};
188188
//~^ wildcard_imports
189189

190190
exported();

tests/ui/wildcard_imports_2021.edition2021.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ error: usage of wildcard import
1717
--> tests/ui/wildcard_imports_2021.rs:17:5
1818
|
1919
LL | use crate::multi_fn_mod::*;
20-
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod}`
20+
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod}`
2121

2222
error: usage of wildcard import
2323
--> tests/ui/wildcard_imports_2021.rs:19:5
@@ -35,7 +35,7 @@ error: usage of wildcard import
3535
--> tests/ui/wildcard_imports_2021.rs:26:5
3636
|
3737
LL | use wildcard_imports_helper::*;
38-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`
38+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`
3939

4040
error: usage of wildcard import
4141
--> tests/ui/wildcard_imports_2021.rs:95:13
@@ -59,7 +59,7 @@ error: usage of wildcard import
5959
--> tests/ui/wildcard_imports_2021.rs:135:13
6060
|
6161
LL | use wildcard_imports_helper::*;
62-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`
62+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`
6363

6464
error: usage of wildcard import
6565
--> tests/ui/wildcard_imports_2021.rs:148:20
@@ -77,13 +77,13 @@ error: usage of wildcard import
7777
--> tests/ui/wildcard_imports_2021.rs:157:13
7878
|
7979
LL | use wildcard_imports_helper::*;
80-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported}`
80+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum}`
8181

8282
error: usage of wildcard import
8383
--> tests/ui/wildcard_imports_2021.rs:187:9
8484
|
8585
LL | use crate::in_fn_test::*;
86-
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{ExportedEnum, ExportedStruct, exported}`
86+
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{exported, ExportedStruct, ExportedEnum}`
8787

8888
error: usage of wildcard import
8989
--> tests/ui/wildcard_imports_2021.rs:197:9

0 commit comments

Comments
 (0)