Skip to content

Commit 4163752

Browse files
authored
Merge 6d87d32 into 8fb32ab
2 parents 8fb32ab + 6d87d32 commit 4163752

File tree

12 files changed

+28
-28
lines changed

12 files changed

+28
-28
lines changed

compiler/rustc_middle/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
// tidy-alphabetical-start
2828
#![allow(internal_features)]
2929
#![allow(rustc::diagnostic_outside_of_impl)]
30-
#![allow(rustc::potential_query_instability)]
3130
#![allow(rustc::untranslatable_diagnostic)]
3231
#![cfg_attr(doc, recursion_limit = "256")] // FIXME(nnethercote): will be removed by #124141
3332
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]

compiler/rustc_middle/src/query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2169,7 +2169,7 @@ rustc_queries! {
21692169
query maybe_unused_trait_imports(_: ()) -> &'tcx FxIndexSet<LocalDefId> {
21702170
desc { "fetching potentially unused trait imports" }
21712171
}
2172-
query names_imported_by_glob_use(def_id: LocalDefId) -> &'tcx UnordSet<Symbol> {
2172+
query names_imported_by_glob_use(def_id: LocalDefId) -> &'tcx FxIndexSet<Symbol> {
21732173
desc { |tcx| "finding names imported by glob use for `{}`", tcx.def_path_str(def_id) }
21742174
}
21752175

compiler/rustc_middle/src/query/on_disk_cache.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::collections::hash_map::Entry;
22
use std::mem;
33
use std::sync::Arc;
44

5-
use rustc_data_structures::fx::{FxHashMap, FxIndexSet};
5+
use rustc_data_structures::fx::{FxHashMap, FxIndexMap, FxIndexSet};
66
use rustc_data_structures::memmap::Mmap;
77
use rustc_data_structures::sync::{HashMapExt, Lock, RwLock};
88
use rustc_data_structures::unhash::UnhashMap;
@@ -58,7 +58,7 @@ pub struct OnDiskCache {
5858

5959
// Collects all `QuerySideEffect` created during the current compilation
6060
// session.
61-
current_side_effects: Lock<FxHashMap<DepNodeIndex, QuerySideEffect>>,
61+
current_side_effects: Lock<FxIndexMap<DepNodeIndex, QuerySideEffect>>,
6262

6363
file_index_to_stable_id: FxHashMap<SourceFileIndex, EncodedSourceFileId>,
6464

compiler/rustc_middle/src/ty/context.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ use rustc_data_structures::steal::Steal;
2828
use rustc_data_structures::sync::{
2929
self, DynSend, DynSync, FreezeReadGuard, Lock, RwLock, WorkerLocal,
3030
};
31-
use rustc_data_structures::unord::UnordSet;
3231
use rustc_errors::{
3332
Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, LintDiagnostic, MultiSpan,
3433
};
@@ -2378,6 +2377,8 @@ macro_rules! sty_debug_print {
23782377
$(let mut $variant = total;)*
23792378

23802379
for shard in tcx.interners.type_.lock_shards() {
2380+
// It seems that ordering doesn't affect anything here.
2381+
#[allow(rustc::potential_query_instability)]
23812382
let types = shard.iter();
23822383
for &(InternedInSet(t), ()) in types {
23832384
let variant = match t.internee {
@@ -3355,9 +3356,7 @@ pub fn provide(providers: &mut Providers) {
33553356
providers.maybe_unused_trait_imports =
33563357
|tcx, ()| &tcx.resolutions(()).maybe_unused_trait_imports;
33573358
providers.names_imported_by_glob_use = |tcx, id| {
3358-
tcx.arena.alloc(UnordSet::from(
3359-
tcx.resolutions(()).glob_map.get(&id).cloned().unwrap_or_default(),
3360-
))
3359+
tcx.arena.alloc(tcx.resolutions(()).glob_map.get(&id).cloned().unwrap_or_default())
33613360
};
33623361

33633362
providers.extern_mod_stmt_cnum =

compiler/rustc_middle/src/ty/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::fmt::Write;
44
use std::ops::ControlFlow;
55

6-
use rustc_data_structures::fx::FxHashMap;
6+
use rustc_data_structures::fx::FxIndexMap;
77
use rustc_errors::{
88
Applicability, Diag, DiagArgValue, IntoDiagArg, into_diag_arg_using_display, listify, pluralize,
99
};
@@ -287,7 +287,7 @@ pub fn suggest_constraining_type_params<'a>(
287287
param_names_and_constraints: impl Iterator<Item = (&'a str, &'a str, Option<DefId>)>,
288288
span_to_replace: Option<Span>,
289289
) -> bool {
290-
let mut grouped = FxHashMap::default();
290+
let mut grouped = FxIndexMap::default();
291291
let mut unstable_suggestion = false;
292292
param_names_and_constraints.for_each(|(param_name, constraint, def_id)| {
293293
let stable = match def_id {

compiler/rustc_middle/src/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ pub struct ResolverGlobalCtxt {
172172
pub extern_crate_map: UnordMap<LocalDefId, CrateNum>,
173173
pub maybe_unused_trait_imports: FxIndexSet<LocalDefId>,
174174
pub module_children: LocalDefIdMap<Vec<ModChild>>,
175-
pub glob_map: FxHashMap<LocalDefId, FxHashSet<Symbol>>,
175+
pub glob_map: FxIndexMap<LocalDefId, FxIndexSet<Symbol>>,
176176
pub main_def: Option<MainDefinition>,
177177
pub trait_impls: FxIndexMap<DefId, Vec<LocalDefId>>,
178178
/// A list of proc macro LocalDefIds, written out in the order in which

compiler/rustc_middle/src/ty/print/pretty.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3520,6 +3520,8 @@ pub fn trimmed_def_paths(tcx: TyCtxt<'_>, (): ()) -> DefIdMap<Symbol> {
35203520

35213521
// Put the symbol from all the unique namespace+symbol pairs into `map`.
35223522
let mut map: DefIdMap<Symbol> = Default::default();
3523+
// Precatious is taken below in the loop so we can allow this lint here.
3524+
#[allow(rustc::potential_query_instability)]
35233525
for ((_, symbol), opt_def_id) in unique_symbols_rev.drain() {
35243526
use std::collections::hash_map::Entry::{Occupied, Vacant};
35253527

compiler/rustc_resolve/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ pub struct Resolver<'ra, 'tcx> {
11041104
underscore_disambiguator: u32,
11051105

11061106
/// Maps glob imports to the names of items actually imported.
1107-
glob_map: FxHashMap<LocalDefId, FxHashSet<Symbol>>,
1107+
glob_map: FxIndexMap<LocalDefId, FxIndexSet<Symbol>>,
11081108
glob_error: Option<ErrorGuaranteed>,
11091109
visibilities_for_hashing: Vec<(LocalDefId, ty::Visibility)>,
11101110
used_imports: FxHashSet<NodeId>,

src/tools/clippy/clippy_lints/src/wildcard_imports.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl LateLintPass<'_> for WildcardImports {
150150
(span, false)
151151
};
152152

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

src/tools/clippy/tests/ui/wildcard_imports.stderr

+5-5
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

src/tools/clippy/tests/ui/wildcard_imports_2021.edition2018.stderr

+5-5
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

src/tools/clippy/tests/ui/wildcard_imports_2021.edition2021.stderr

+5-5
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)