Skip to content

Commit

Permalink
Tweak output of import suggestions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
estebank committed Jun 13, 2024
1 parent ba347f9 commit fa9274c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tests/ui/crashes/ice-6252.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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;
|
Expand Down

0 comments on commit fa9274c

Please sign in to comment.