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`
This commit is contained in:
commit
28b6607b5f
7 changed files with 28 additions and 8 deletions
|
@ -3,7 +3,7 @@ Something other than a module was found in visibility scope.
|
|||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0577,edition2018
|
||||
pub struct Sea;
|
||||
pub enum Sea {}
|
||||
|
||||
pub (in crate::Sea) struct Shark; // error!
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue