about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/transform/coverage/graph.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-10-21 20:23:26 +0000
committerbors <bors@rust-lang.org>2020-10-21 20:23:26 +0000
commit1eaadebb3dee31669c7649b32747381d11614fae (patch)
treebae167a7740a9ca9f397f56b025bae5ea9c82655 /compiler/rustc_mir/src/transform/coverage/graph.rs
parent1d2726726f8f3128e98191e4c6cb94bd76d0ddd4 (diff)
parentcee5521a03e81e75516a90c1a616c97545d8e07a (diff)
downloadrust-1eaadebb3dee31669c7649b32747381d11614fae.tar.gz
rust-1eaadebb3dee31669c7649b32747381d11614fae.zip
Auto merge of #78077 - petrochenkov:qvis, r=davidtwco
Calculate visibilities once in resolve

Then use them through a query based on resolver outputs.

Item visibilities were previously calculated in three places - initially in `rustc_resolve`, then in `rustc_privacy` during type privacy checkin, and then in `rustc_metadata` during metadata encoding.
The visibility logic is not entirely trivial, especially for things like constructors or enum variants, and all of it was duplicated.

This PR deduplicates all the visibility calculations, visibilities are determined once during early name resolution and then stored in `ResolverOutputs` and are later available through `tcx` as a query `tcx.visibility(def_id)`.
(This query existed previously, but only worked for other crates.)

Some special cases (e.g. visibilities for closure types, which are needed for type privacy checking) are not processed in resolve, but deferred and performed directly in the query instead.
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/graph.rs')
0 files changed, 0 insertions, 0 deletions