1
Fork 0

Rollup merge of #98269 - compiler-errors:provide-more-segment-res, r=petrochenkov

Provide a `PathSegment.res` in more cases

I find that in many cases, the `res` associated with a `PathSegment` is `Res::Err` even though the path was fully resolved. A few diagnostics use this `res` and their error messages suffer because of the lack of resolved segment.

This fixes it a bit, but it's obviously not complete and I'm not exactly sure if it's correct.
This commit is contained in:
Michael Goulet 2022-06-23 14:39:07 -07:00 committed by GitHub
commit 3b68700d0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 116 additions and 115 deletions

View file

@ -1502,6 +1502,7 @@ impl<'a> Resolver<'a> {
return PathResult::NonModule(PartialRes::new(Res::Err));
} else if opt_ns.is_some() && (is_last || maybe_assoc) {
self.lint_if_path_starts_with_module(finalize, path, second_binding);
record_segment_res(self, res);
return PathResult::NonModule(PartialRes::with_unresolved_segments(
res,
path.len() - i - 1,