about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-06-12 23:51:31 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-06-13 20:22:21 +0000
commit5de8e6edfcc747930891a0adc8e90608776dbe54 (patch)
tree770cb18a4f3c28cd3702507d09e2915585f44cc0 /src
parentf1586001ace26df7cafeb6534eaf76fb2c5513e5 (diff)
Tweak output of import suggestions
When both `std::` and `core::` items are available, only suggest the
`std::` ones. We ensure that in `no_std` crates we suggest `core::`
items.

Ensure that the list of items suggested to be imported are always in the
order of local crate items, `std`/`core` items and finally foreign crate
items.

Tweak wording of import suggestion: if there are multiple items but they
are all of the same kind, we use the kind name and not the generic "items".

Fix #83564.
Diffstat (limited to 'src')
-rw-r--r--src/tools/clippy/tests/ui/crashes/ice-6252.stderr4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/tools/clippy/tests/ui/crashes/ice-6252.stderr b/src/tools/clippy/tests/ui/crashes/ice-6252.stderr
index ce3b9495eb1..cd2031af1c6 100644
--- a/src/tools/clippy/tests/ui/crashes/ice-6252.stderr
+++ b/src/tools/clippy/tests/ui/crashes/ice-6252.stderr
@@ -4,9 +4,7 @@ error[E0412]: cannot find type `PhantomData` in this scope
 LL |     _n: PhantomData,
    |         ^^^^^^^^^^^ not found in this scope
    |
-help: consider importing one of these items
-   |
-LL + use core::marker::PhantomData;
+help: consider importing this struct
    |
 LL + use std::marker::PhantomData;
    |