suggest importing for partial mod path in name resolving

This commit is contained in:
yukang
2023-06-22 11:18:48 +08:00
parent 38b44eb233
commit e7e1a39fa0
8 changed files with 121 additions and 21 deletions

View File

@@ -3556,9 +3556,13 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
_ => return Some(parent_err),
};
let (mut err, candidates) =
let (mut err, mut candidates) =
this.smart_resolve_report_errors(prefix_path, path_span, PathSource::Type, None);
if candidates.is_empty() {
candidates = this.smart_resolve_partial_mod_path_errors(prefix_path, path);
}
// There are two different error messages user might receive at
// this point:
// - E0412 cannot find type `{}` in this scope