mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 19:53:46 +00:00
32424d0aba
Fix associated item visibility in block-local impls
Fixes #14046
When we're resolving visibility of block-local items...
> `self` normally refers to the containing non-block module, and `super` to its parent (etc.). However, visibilities must only refer to a module in the DefMap they're written in, so we restrict them when that happens. ([link])
...unless we're resolving visibility of associated items in block-local impls, because that impl is semantically "hoisted" to the nearest (non-block) module. With this PR, we skip the adjustment for such items.
Since visibility representation of those items is modified, this PR also adjusts visibility rendering in `HirDisplay`.
[link]:
|
||
---|---|---|
.. | ||
src | ||
Cargo.toml |