rust/compiler
bors 6f53ddfa74 Auto merge of #89514 - davidtwco:polymorphize-shims-and-predicates, r=lcnr
polymorphization: shims and predicates

Supersedes #75737 and #75414. This pull request includes up some changes to polymorphization which hadn't landed previously and gets stage2 bootstrapping and the test suite passing when polymorphization is enabled. There are still issues with `type_id` and polymorphization to investigate but this should get polymorphization in a reasonable state to work on.

- #75737 and #75414 both worked but were blocked on having the rest of the test suite pass (with polymorphization enabled) with and without the PRs. It makes more sense to just land these so that the changes are in.
- #75737's changes remove the restriction of `InstanceDef::Item` on polymorphization, so that shims can now be polymorphized. This won't have much of an effect until polymorphization's analysis is more advanced, but it doesn't hurt.
- #75414's changes remove all logic which marks parameters as used based on their presence in predicates - given #75675, this will enable more polymorphization and avoid the symbol clashes that predicate logic previously sidestepped.
- Polymorphization now explicitly checks (and skips) foreign items, this is necessary for stage2 bootstrapping to work when polymorphization is enabled.
- The conditional determining the emission of a note adding context to a post-monomorphization error has been modified. Polymorphization results in `optimized_mir` running for shims during collection where that wouldn't happen previously, some errors are emitted during `optimized_mir` and these were considered post-monomorphization errors with the existing logic (more errors and shims have a `DefId` coming from the std crate, not the local crate), adding a note that resulted in tests failing. It isn't particularly feasible to change where polymorphization runs or prevent it from using `optimized_mir`, so it seemed more reasonable to not change the conditional.
- `characteristic_def_id_of_type` was being invoked during partitioning for self types of impl blocks which had projections that depended on the value of unused generic parameters of a function - this caused a ICE in a debuginfo test. If partitioning is enabled and the instance needs substitution then this is skipped. That test still fails for me locally, but not with an ICE, but it fails in a fresh checkout too, so 🤷‍♂️.

r? `@lcnr`
2021-10-17 12:33:12 +00:00
..
rustc
rustc_apfloat Apply clippy suggestions 2021-10-10 15:38:19 +02:00
rustc_arena
rustc_ast remove unwrap_or! macro 2021-10-08 19:32:16 +03:00
rustc_ast_lowering Rollup merge of #89641 - asquared31415:asm-feature-attr-regs, r=oli-obk 2021-10-09 11:56:00 +02:00
rustc_ast_passes Revert "Stabilize arbitrary_enum_discriminant" 2021-10-14 10:57:56 -04:00
rustc_ast_pretty
rustc_attr Correct typo 2021-10-16 13:36:05 -07:00
rustc_borrowck Auto merge of #88698 - Noble-Mushtak:master, r=nikomatsakis,oli-obk 2021-10-14 13:21:46 +00:00
rustc_builtin_macros Rollup merge of #89649 - matthiaskrgr:clippycompl, r=jyn514 2021-10-08 22:30:40 +02:00
rustc_codegen_cranelift Remove alloc::prelude 2021-10-15 01:41:31 +02:00
rustc_codegen_gcc Remove alloc::prelude 2021-10-15 01:41:31 +02:00
rustc_codegen_llvm Remap ssa RealPredicate to llvm RealPredicate 2021-10-12 11:55:45 +02:00
rustc_codegen_ssa Auto merge of #89597 - michaelwoerister:improve-vtable-debuginfo, r=wesleywiser 2021-10-11 04:31:47 +00:00
rustc_const_eval Auto merge of #89514 - davidtwco:polymorphize-shims-and-predicates, r=lcnr 2021-10-17 12:33:12 +00:00
rustc_data_structures Remove for loop range 2021-10-10 16:32:16 +02:00
rustc_driver Fix RUSTC_LOG handling 2021-10-10 19:59:36 +01:00
rustc_error_codes Auto merge of #89903 - matthiaskrgr:rollup-s0c69xl, r=matthiaskrgr 2021-10-15 05:59:49 +00:00
rustc_errors emitter: current substitution can be multi-line 2021-10-15 15:30:43 +00:00
rustc_expand Rollup merge of #89943 - matthiaskrgr:clpcompl, r=oli-obk 2021-10-17 07:52:20 +09:00
rustc_feature Revert "Stabilize arbitrary_enum_discriminant" 2021-10-14 10:57:56 -04:00
rustc_fs_util
rustc_graphviz Apply clippy suggestions 2021-10-10 15:38:19 +02:00
rustc_hir Auto merge of #89247 - fee1-dead:const-eval-select, r=oli-obk 2021-10-14 10:06:30 +00:00
rustc_hir_pretty
rustc_incremental
rustc_index Use Option::map_or instead of open coding it 2021-10-12 14:47:52 +02:00
rustc_infer Rollup merge of #89915 - jackh726:outlives_cleanup, r=nikomatsakis 2021-10-16 08:02:25 +02:00
rustc_interface
rustc_lexer Apply clippy suggestions 2021-10-10 15:38:19 +02:00
rustc_lint Add enum_intrinsics_non_enums lint 2021-10-11 09:46:27 +02:00
rustc_lint_defs Add feature gate to non_exhaustive_omitted_patterns lint 2021-10-08 17:40:39 -04:00
rustc_llvm Rollup merge of #89025 - ricobbe:raw-dylib-link-ordinal, r=michaelwoerister 2021-10-07 20:26:11 -07:00
rustc_macros Apply clippy suggestions 2021-10-10 15:38:19 +02:00
rustc_metadata Auto merge of #89514 - davidtwco:polymorphize-shims-and-predicates, r=lcnr 2021-10-17 12:33:12 +00:00
rustc_middle Auto merge of #89514 - davidtwco:polymorphize-shims-and-predicates, r=lcnr 2021-10-17 12:33:12 +00:00
rustc_mir_build Filter unstable and doc hidden variants in usefulness checking 2021-10-12 08:22:25 -04:00
rustc_mir_dataflow
rustc_mir_transform clippy::complexity fixes 2021-10-08 20:07:44 +02:00
rustc_monomorphize Auto merge of #89514 - davidtwco:polymorphize-shims-and-predicates, r=lcnr 2021-10-17 12:33:12 +00:00
rustc_parse some clippy::perf fixes 2021-10-07 22:31:33 +02:00
rustc_parse_format
rustc_passes Use Ancestory to check default fn in const impl instead of comparing idents 2021-10-11 18:19:54 +01:00
rustc_plugin_impl
rustc_privacy
rustc_query_impl Remove built-in cache_hit tracking 2021-10-11 16:33:49 -04:00
rustc_query_system Remove built-in cache_hit tracking 2021-10-11 16:33:49 -04:00
rustc_resolve clippy::complexity changes 2021-10-16 18:11:16 +02:00
rustc_save_analysis
rustc_serialize Apply clippy suggestions 2021-10-10 15:38:19 +02:00
rustc_session Rollup merge of #89476 - cjgillot:expn-id, r=petrochenkov 2021-10-07 20:26:14 -07:00
rustc_span Guess semicolon span for macro statements 2021-10-15 02:24:48 -05:00
rustc_symbol_mangling
rustc_target
rustc_trait_selection Move some outlives bounds things from rustc_trait_selection to rustc_typeck 2021-10-15 12:14:19 -04:00
rustc_traits Move some outlives bounds things from rustc_trait_selection to rustc_typeck 2021-10-15 12:14:19 -04:00
rustc_ty_utils
rustc_type_ir
rustc_typeck Auto merge of #89860 - camsteffen:macro-semi, r=petrochenkov 2021-10-16 18:20:20 +00:00