add testcase for 112590

This commit is contained in:
yukang
2023-06-22 11:19:05 +08:00
parent e7e1a39fa0
commit b26701ea79
12 changed files with 136 additions and 76 deletions

View File

@@ -3499,7 +3499,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
let report_errors = |this: &mut Self, res: Option<Res>| {
if this.should_report_errs() {
let (err, candidates) =
this.smart_resolve_report_errors(path, path_span, source, res);
this.smart_resolve_report_errors(path, path, path_span, source, res);
let def_id = this.parent_scope.module.nearest_parent_mod();
let instead = res.is_some();
@@ -3556,12 +3556,13 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
_ => return Some(parent_err),
};
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);
}
let (mut err, candidates) = this.smart_resolve_report_errors(
prefix_path,
path,
path_span,
PathSource::Type,
None,
);
// There are two different error messages user might receive at
// this point: