about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/effective_visibilities.rs
AgeCommit message (Collapse)AuthorLines
2023-03-28effvis: Stop considering crate root its own parentVadim Petrochenkov-7/+6
It helped to reuse `update_def` for the crate root, but it created confusion and caused some mistakes when I implemented #109500
2023-03-28effvis: Merge two similar code pathsVadim Petrochenkov-34/+23
2023-03-20Lint ambiguous glob re-exports许杰友 Jieyou Xu (Joe)-18/+50
2023-03-02rustc_middle: Remove trait `DefIdTree`Vadim Petrochenkov-2/+2
This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-02-20Remove `ResolverTree`Oli Scherer-6/+2
2023-02-20Remove IntoDefIdTreeOli Scherer-12/+7
2023-02-20Stuff a TyCtxt into the ResolverOli Scherer-1/+1
2023-02-14Separate the lifetime of the session and the arena in the resolverOli Scherer-8/+11
2023-02-13rustdoc: Eliminate remaining uses of resolverVadim Petrochenkov-2/+2
2022-12-09Fold `Definitions` into the untracked dataOli Scherer-4/+1
2022-12-09Move the untracked cstore and source_span into a structOli Scherer-1/+4
2022-12-09Generate crate loaders on the flyOli Scherer-1/+1
2022-12-09ResolverTree does not require access to the crate loader, only the storeOli Scherer-1/+1
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