resolve: Do not cache nearest parent mod in ModuleData

This commit is contained in:
Vadim Petrochenkov
2021-09-14 00:13:14 +03:00
parent a0648eab36
commit fd58eea4e1
4 changed files with 36 additions and 57 deletions

View File

@@ -1872,7 +1872,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
if this.should_report_errs() {
let (err, candidates) = this.smart_resolve_report_errors(path, span, source, res);
let def_id = this.parent_scope.module.nearest_parent_mod;
let def_id = this.parent_scope.module.nearest_parent_mod();
let instead = res.is_some();
let suggestion =
if res.is_none() { this.report_missing_type_error(path) } else { None };
@@ -1940,7 +1940,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
drop(parent_err);
let def_id = this.parent_scope.module.nearest_parent_mod;
let def_id = this.parent_scope.module.nearest_parent_mod();
if this.should_report_errs() {
this.r.use_injections.push(UseError {