summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/effective_visibilities.rs
AgeCommit message (Collapse)AuthorLines
2022-12-01rustc_ast_lowering: Stop lowering imports into multiple itemsVadim Petrochenkov-23/+6
Lower them into a single item with multiple resolutions instead. This also allows to remove additional `NodId`s and `DefId`s related to those additional items.
2022-11-24effective visibility: Stop recalculating current private visibilityVadim Petrochenkov-2/+16
It becomes relatively expensive if done often and shows up during perf profiling.
2022-11-24effective visibility: Always add table entries for nodes used as parentsVadim Petrochenkov-7/+14
Previously if the parent was not in the table, and there was nothing to inherit from, the child's private visibility was used, but that's not correct - the parent may have a larger visibility so we should set it to at least the parent's private visibility. That parent's private visibility is also inserted into the table for caching, so it's not recalculated later if used again.
2022-11-24effective visibility: Fix private visibility calculation for modulesVadim Petrochenkov-4/+6
Optimizations removed in the previous commit required this function to behave incorrectly, but now those optimizations are gone so we can fix the bug. Fixes https://github.com/rust-lang/rust/issues/104249
2022-11-24effective visibility: Remove questionable optimizationsVadim Petrochenkov-30/+20
First, they require eagerly calculating private visibility (current normal module), which is somewhat expensive. Private visibilities are also lost once calculated, instead of being cached in the table. Second, I cannot prove that the optimizations are correct. Maybe they can be partially reinstated in the future in cases when it's cheap and provably correct to do them. They will also probably be merged into `fn update` in that case. Partially fixes https://github.com/rust-lang/rust/issues/104249 Fixes https://github.com/rust-lang/rust/issues/104539
2022-11-24effective visibility: Satisfy borrow checker to use resolver lazily from a ↵Vadim Petrochenkov-13/+26
closure
2022-11-13fix some typos in commentscui fliter-1/+1
Signed-off-by: cui fliter <imcusg@gmail.com>
2022-11-05resolve: Fill effective visibilities for import def ids in a separate passVadim Petrochenkov-32/+33
This should result in less update calls than doing it repeatedly during the fix point iteration.
2022-11-05resolve: More detailed effective visibility tracking for importsVadim Petrochenkov-83/+122
Also drop `extern` blocks from the effective visibility table, they are nominally private and it doesn't make sense to keep them there.
2022-10-31resolve: Turn the binding from `#[macro_export]` into a proper `Import`Vadim Petrochenkov-7/+5
2022-10-31resolve: Not all imports have their own `NodeId`Vadim Petrochenkov-17/+31
2022-10-26privacy: Rename "accessibility levels" to "effective visibilities"Vadim Petrochenkov-0/+188
And a couple of other naming tweaks Related to https://github.com/rust-lang/rust/issues/48054