rust/compiler/rustc_middle
bors 1eaadebb3d 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.
2020-10-21 20:23:26 +00:00
..
benches mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
src Auto merge of #78077 - petrochenkov:qvis, r=davidtwco 2020-10-21 20:23:26 +00:00
Cargo.toml Update chalk to 0.32.0 2020-10-08 13:17:01 +02:00
README.md mv compiler to compiler/ 2020-08-30 18:45:07 +03:00

For more information about how rustc works, see the rustc dev guide.