diff options
| author | bors <bors@rust-lang.org> | 2023-08-05 11:52:07 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-08-05 11:52:07 +0000 |
| commit | 28b6607b5f525d57515dd0ca28ead5c54f54533a (patch) | |
| tree | 5e5614d50800327536c97531be52498cd04aed2e /compiler/rustc_resolve/src | |
| parent | 1cabb8ed2301faf193132e71ca5b10f82913e48a (diff) | |
| parent | 69ea85da02441c310b4aee39f4483ede937400fa (diff) | |
| download | rust-28b6607b5f525d57515dd0ca28ead5c54f54533a.tar.gz rust-28b6607b5f525d57515dd0ca28ead5c54f54533a.zip | |
Auto merge of #109348 - cjgillot:issue-109146, r=petrochenkov
Resolve visibility paths as modules not as types. Asking for a resolution with `opt_ns = Some(TypeNS)` allows path resolution to look for type-relative paths, leaving unresolved segments behind. However, for visibility paths we really need to look for a module, so we need to pass `opt_ns = None`. Fixes https://github.com/rust-lang/rust/issues/109146 r? `@petrochenkov`
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/build_reduced_graph.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index 2f432799022..80d6a47ff53 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -278,7 +278,7 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> { }; match self.r.resolve_path( &segments, - Some(TypeNS), + None, parent_scope, finalize.then(|| Finalize::new(id, path.span)), None, |
