rust/compiler
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
..
rustc just max_level_info 2020-09-11 09:37:51 -07:00
rustc_apfloat Backport another LLVM commit to rustc_apfloat 2020-10-04 02:02:25 +02:00
rustc_arena Track element count only for types that need drop 2020-10-20 17:01:51 +02:00
rustc_ast Auto merge of #77250 - Aaron1011:feature/flat-token-collection, r=petrochenkov 2020-10-21 15:03:14 +00:00
rustc_ast_lowering Auto merge of #78066 - bugadani:wat, r=jonas-schievink 2020-10-18 13:50:31 +00:00
rustc_ast_passes Lower inline const's AST to HIR 2020-10-16 15:21:16 -03:00
rustc_ast_pretty Drop unneeded mut 2020-10-20 16:42:51 +02:00
rustc_attr Move PartialOrd impl out of rustc 2020-10-11 11:11:33 -04:00
rustc_builtin_macros Replace target.target with target and target.ptr_width with target.pointer_width 2020-10-15 12:02:24 +02:00
rustc_codegen_llvm Auto merge of #78047 - khyperia:set_span_mut, r=bjorn3 2020-10-18 05:36:23 +00:00
rustc_codegen_ssa Make set_span take mut self 2020-10-17 13:28:58 +02:00
rustc_data_structures Auto merge of #77908 - bugadani:obl-forest, r=nnethercote 2020-10-19 15:14:15 +00:00
rustc_driver Rollup merge of #77493 - hosseind88:ICEs_should_always_print_the_top_of_the_query_stack, r=oli-obk 2020-10-16 02:10:09 +02:00
rustc_error_codes Rollup merge of #77971 - jyn514:broken-intra-doc-links, r=mark-simulacrum 2020-10-17 05:36:49 +09:00
rustc_errors Remove unused code from remaining compiler crates 2020-10-14 04:14:32 +02:00
rustc_expand Avoid cloning the contents of a TokenStream in a few places 2020-10-19 12:30:41 -04:00
rustc_feature Remove redundant 'static in the compiler 2020-10-18 17:30:15 +02:00
rustc_fs_util Remove unused code from remaining compiler crates 2020-10-14 04:14:32 +02:00
rustc_graphviz /nightly/nightly-rustc 2020-09-23 21:51:56 +02:00
rustc_hir Calculate visibilities once in resolve 2020-10-19 11:57:50 +03:00
rustc_hir_pretty Do not print braces again print_anon_const already does it 2020-10-19 16:26:13 -03:00
rustc_incremental /nightly/nightly-rustc 2020-09-23 21:51:56 +02:00
rustc_index cache types during normalization 2020-09-19 17:27:13 +02:00
rustc_infer review comments 2020-10-20 09:26:15 -07:00
rustc_interface Rollup merge of #77795 - bjorn3:codegen_backend_interface_refactor, r=oli-obk 2020-10-14 02:30:38 +02:00
rustc_lexer Noticed a potential bug in eat_while(): it doesn't account for number of UTF8 bytes. 2020-10-09 11:12:54 +02:00
rustc_lint Rollup merge of #77931 - aticu:fix_60336, r=petrochenkov 2020-10-20 12:11:06 +09:00
rustc_llvm Auto merge of #76859 - Aaron1011:fix/llvm-cgu-reuse, r=davidtwco,nikic 2020-10-11 20:50:02 +00:00
rustc_macros Remove unused #[allow(...)] statements from compiler/ 2020-09-26 01:25:55 +02:00
rustc_metadata Calculate visibilities once in resolve 2020-10-19 11:57:50 +03:00
rustc_middle Auto merge of #78077 - petrochenkov:qvis, r=davidtwco 2020-10-21 20:23:26 +00:00
rustc_mir Rollup merge of #78101 - RalfJung:foreign-static, r=oli-obk 2020-10-21 13:59:43 +09:00
rustc_mir_build Auto merge of #77124 - spastorino:const-exprs-rfc-2920, r=oli-obk 2020-10-17 14:44:51 +00:00
rustc_parse Auto merge of #77250 - Aaron1011:feature/flat-token-collection, r=petrochenkov 2020-10-21 15:03:14 +00:00
rustc_parse_format /nightly/nightly-rustc 2020-09-23 21:51:56 +02:00
rustc_passes Auto merge of #78066 - bugadani:wat, r=jonas-schievink 2020-10-18 13:50:31 +00:00
rustc_plugin_impl /nightly/nightly-rustc 2020-09-23 21:51:56 +02:00
rustc_privacy Calculate visibilities once in resolve 2020-10-19 11:57:50 +03:00
rustc_query_system Remove unused code from rustc_query_system 2020-10-14 04:14:32 +02:00
rustc_resolve Calculate visibilities once in resolve 2020-10-19 11:57:50 +03:00
rustc_save_analysis /nightly/nightly-rustc 2020-09-23 21:51:56 +02:00
rustc_serialize Replace absolute paths with relative ones 2020-10-13 14:16:45 +02:00
rustc_session Remove rustc_session::config::Config 2020-10-15 12:02:24 +02:00
rustc_span Add inline_const feature flag 2020-10-16 15:13:28 -03:00
rustc_symbol_mangling Rollup merge of #75675 - davidtwco:symbol-mangling-impl-params, r=eddyb 2020-10-16 02:10:02 +02:00
rustc_target Replace target.target with target and target.ptr_width with target.pointer_width 2020-10-15 12:02:24 +02:00
rustc_trait_selection Rollup merge of #78002 - estebank:issue-77598, r=oli-obk 2020-10-21 13:59:35 +09:00
rustc_traits Review comments 2020-10-16 12:58:50 -04:00
rustc_ty Calculate visibilities once in resolve 2020-10-19 11:57:50 +03:00
rustc_typeck Auto merge of #78077 - petrochenkov:qvis, r=davidtwco 2020-10-21 20:23:26 +00:00