Auto merge of #118065 - estebank:core-not-found-404, r=TaKO8Ki
When failing to import `core`, suggest `std`
This commit is contained in:
commit
360bafad68
4 changed files with 29 additions and 12 deletions
|
@ -1858,6 +1858,15 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
Applicability::MaybeIncorrect,
|
||||
)),
|
||||
)
|
||||
} else if ident.name == sym::core {
|
||||
(
|
||||
format!("maybe a missing crate `{ident}`?"),
|
||||
Some((
|
||||
vec![(ident.span, "std".to_string())],
|
||||
"try using `std` instead of `core`".to_string(),
|
||||
Applicability::MaybeIncorrect,
|
||||
)),
|
||||
)
|
||||
} else if self.tcx.sess.is_rust_2015() {
|
||||
(
|
||||
format!("maybe a missing crate `{ident}`?"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue