Skip to content

Commit fa9274c

Browse files
committed
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 rust-lang#83564.
1 parent ba347f9 commit fa9274c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tests/ui/crashes/ice-6252.stderr

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ error[E0412]: cannot find type `PhantomData` in this scope
44
LL | _n: PhantomData,
55
| ^^^^^^^^^^^ not found in this scope
66
|
7-
help: consider importing one of these items
8-
|
9-
LL + use core::marker::PhantomData;
7+
help: consider importing this struct
108
|
119
LL + use std::marker::PhantomData;
1210
|

0 commit comments

Comments
 (0)