Silence use foo::Bar;
error if Bar
isn't found in foo
and foo.rs
has parse errors
This commit is contained in:
parent
69fb612608
commit
27420c69d8
3 changed files with 9 additions and 11 deletions
|
@ -670,9 +670,14 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
|
||||
fn throw_unresolved_import_error(
|
||||
&mut self,
|
||||
errors: Vec<(Import<'_>, UnresolvedImportError)>,
|
||||
mut errors: Vec<(Import<'_>, UnresolvedImportError)>,
|
||||
glob_error: bool,
|
||||
) {
|
||||
errors.retain(|(_import, err)| match err.module {
|
||||
// Skip `use` errors for `use foo::Bar;` if `foo.rs` has unrecovered parse errors.
|
||||
Some(def_id) if self.mods_with_parse_errors.contains(&def_id) => false,
|
||||
_ => true,
|
||||
});
|
||||
if errors.is_empty() {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue