about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-09-07 07:28:43 +0000
committerbors <bors@rust-lang.org>2025-09-07 07:28:43 +0000
commitfbd8f95118fff54a2402983d3f446cad9b2f30c5 (patch)
tree0b49ee264e594ea92ac42ae81785495d1e052147 /compiler/rustc_resolve/src
parentebdf2abea4b46fcbba959eee1207c979c77dc95c (diff)
parent1b492b0c549c78d0c90d5fefa7a4cd6acd619a90 (diff)
downloadrust-fbd8f95118fff54a2402983d3f446cad9b2f30c5.tar.gz
rust-fbd8f95118fff54a2402983d3f446cad9b2f30c5.zip
Auto merge of #146292 - matthiaskrgr:rollup-bkjs887, r=matthiaskrgr
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#146254 (Use `Itertools::all_equal_value()` where applicable)
 - rust-lang/rust#146290 (Revert "Add LSX accelerated implementation for source file analysis")

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/diagnostics.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs
index f458a1f17b9..689e713ef46 100644
--- a/compiler/rustc_resolve/src/diagnostics.rs
+++ b/compiler/rustc_resolve/src/diagnostics.rs
@@ -1,3 +1,4 @@
+use itertools::Itertools as _;
 use rustc_ast::visit::{self, Visitor};
 use rustc_ast::{
     self as ast, CRATE_NODE_ID, Crate, ItemKind, ModKind, NodeId, Path, join_path_idents,
@@ -3469,16 +3470,11 @@ fn show_candidates(
                 err.note(note.to_string());
             }
         } else {
-            let (_, descr_first, _, _, _) = &inaccessible_path_strings[0];
-            let descr = if inaccessible_path_strings
+            let descr = inaccessible_path_strings
                 .iter()
-                .skip(1)
-                .all(|(_, descr, _, _, _)| descr == descr_first)
-            {
-                descr_first
-            } else {
-                "item"
-            };
+                .map(|&(_, descr, _, _, _)| descr)
+                .all_equal_value()
+                .unwrap_or("item");
             let plural_descr =
                 if descr.ends_with('s') { format!("{descr}es") } else { format!("{descr}s") };