Improve suggestion for extern crate self error message

This commit is contained in:
Michael 2021-11-26 21:39:44 +00:00
parent 62f4ce993e
commit 2ca9333011
12 changed files with 77 additions and 70 deletions

View file

@ -3285,7 +3285,9 @@ impl<'a> Resolver<'a> {
Some(binding)
} else {
let crate_id = if !speculative {
self.crate_loader.process_path_extern(ident.name, ident.span)
let Some(crate_id) =
self.crate_loader.process_path_extern(ident.name, ident.span) else { return Some(self.dummy_binding); };
crate_id
} else {
self.crate_loader.maybe_process_path_extern(ident.name)?
};