diff options
| author | bors <bors@rust-lang.org> | 2023-03-08 06:07:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-03-08 06:07:11 +0000 |
| commit | 5331d053344aecc5040cd75062e486348a397b7a (patch) | |
| tree | 2937baf5f8e41a805b419c153c23d272d04a661f | |
| parent | ea2073a2f08ee0116097fef1430467312fa67c41 (diff) | |
| parent | 09566cc3d843abdda23c5856bf725314cb957533 (diff) | |
| download | rust-5331d053344aecc5040cd75062e486348a397b7a.tar.gz rust-5331d053344aecc5040cd75062e486348a397b7a.zip | |
Auto merge of #108312 - michaelwoerister:hash-set-not-hash-stable, r=eholk
Do not implement HashStable for HashSet (MCP 533) This PR removes all occurrences of `HashSet` in query results, replacing it either with `FxIndexSet` or with `UnordSet`, and then removes the `HashStable` implementation of `HashSet`. This is part of implementing [MCP 533](https://github.com/rust-lang/compiler-team/issues/533), that is, removing the `HashStable` implementations of all collection types with unstable iteration order. The changes are mostly mechanical. The only place where additional sorting is happening is in Miri's override implementation of the `exported_symbols` query.
| -rw-r--r-- | clippy_lints/src/wildcard_imports.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/clippy_lints/src/wildcard_imports.rs b/clippy_lints/src/wildcard_imports.rs index e4d1ee195c4..e105452e1c5 100644 --- a/clippy_lints/src/wildcard_imports.rs +++ b/clippy_lints/src/wildcard_imports.rs @@ -155,14 +155,10 @@ impl LateLintPass<'_> for WildcardImports { ) }; - let imports_string = if used_imports.len() == 1 { - used_imports.iter().next().unwrap().to_string() + let mut imports = used_imports.items().map(ToString::to_string).into_sorted_stable_ord(false); + let imports_string = if imports.len() == 1 { + imports.pop().unwrap() } else { - let mut imports = used_imports - .iter() - .map(ToString::to_string) - .collect::<Vec<_>>(); - imports.sort(); if braced_glob { imports.join(", ") } else { |
