rust/compiler
Matthias Krüger 610b4e503c
Rollup merge of #90035 - SparrowLii:rfc2528, r=jackh726
implement rfc-2528 type_changing-struct-update

This PR implement rfc2528-type_changing-struct-update.
The main change process is as follows:
1. Move the processing part of `base_expr` into `check_expr_struct_fields` to avoid returning `remaining_fields` (a relatively complex hash table)
2. Before performing the type consistency check(`check_expr_has_type_or_error`), if the `type_changing_struct_update` feature is set, enter a different processing flow, otherwise keep the original flow
3. In the case of the same structure definition, check each field in `remaining_fields`. If the field in `base_expr` is not the suptype of the field in `adt_ty`, an error(`FeildMisMatch`) will be reported.

The MIR part does not need to be changed, because only the items contained in `remaining_fields` will be extracted from `base_expr` when MIR is generated. This means that fields with different types in `base_expr` will not be used
Updates #86618
cc `@nikomatsakis`
2021-11-09 19:00:41 +01:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast Rollup merge of #90657 - GuillaumeGomez:one-char-last-line-removed, r=jyn514 2021-11-08 15:15:24 +01:00
rustc_ast_lowering ast: Fix naming conventions in AST structures 2021-11-07 21:38:17 +08:00
rustc_ast_passes Auto merge of #90668 - matthiaskrgr:clippy_nov7, r=jyn514 2021-11-07 20:04:54 +00:00
rustc_ast_pretty Auto merge of #90668 - matthiaskrgr:clippy_nov7, r=jyn514 2021-11-07 20:04:54 +00:00
rustc_attr
rustc_borrowck Rollup merge of #89561 - nbdd0121:const_typeck, r=nikomatsakis 2021-11-09 19:00:40 +01:00
rustc_builtin_macros Auto merge of #90485 - camsteffen:fmt-args-less-bind, r=m-ou-se 2021-11-09 05:33:16 +00:00
rustc_codegen_cranelift
rustc_codegen_gcc
rustc_codegen_llvm Rollup merge of #89561 - nbdd0121:const_typeck, r=nikomatsakis 2021-11-09 19:00:40 +01:00
rustc_codegen_ssa Rollup merge of #90688 - SparrowLii:dotprod, r=Amanieu 2021-11-09 22:02:24 +09:00
rustc_const_eval Rollup merge of #89561 - nbdd0121:const_typeck, r=nikomatsakis 2021-11-09 19:00:40 +01:00
rustc_data_structures more clippy fixes 2021-11-07 16:59:05 +01:00
rustc_driver Don't proceed to codegen if there are lint errors 2021-11-08 01:22:28 +00:00
rustc_error_codes Improve error when an .rlib can't be parsed 2021-11-07 15:03:40 +00:00
rustc_errors Don't abort compilation after giving a lint error 2021-11-08 01:22:28 +00:00
rustc_expand Don't abort compilation after giving a lint error 2021-11-08 01:22:28 +00:00
rustc_feature Add features gates for experimental asm features 2021-11-07 01:23:53 +00:00
rustc_fs_util
rustc_graphviz
rustc_hir Give inline const separate DefKind 2021-11-07 03:59:06 +00:00
rustc_hir_pretty
rustc_incremental
rustc_index
rustc_infer Rollup merge of #89561 - nbdd0121:const_typeck, r=nikomatsakis 2021-11-09 19:00:40 +01:00
rustc_interface Auto merge of #90668 - matthiaskrgr:clippy_nov7, r=jyn514 2021-11-07 20:04:54 +00:00
rustc_lexer use matches!() macro in more places 2021-11-06 16:13:14 +01:00
rustc_lint Auto merge of #90668 - matthiaskrgr:clippy_nov7, r=jyn514 2021-11-07 20:04:54 +00:00
rustc_lint_defs Properly register text_direction_codepoint_in_comment lint. 2021-11-05 20:12:40 +01:00
rustc_llvm Initialize LLVM time trace profiler on each code generation thread 2021-11-05 17:47:11 +01:00
rustc_macros more clippy fixes 2021-11-07 16:59:05 +01:00
rustc_metadata Rollup merge of #89561 - nbdd0121:const_typeck, r=nikomatsakis 2021-11-09 19:00:40 +01:00
rustc_middle Rollup merge of #90035 - SparrowLii:rfc2528, r=jackh726 2021-11-09 19:00:41 +01:00
rustc_mir_build Implement type inference for inline consts 2021-11-07 04:00:32 +00:00
rustc_mir_dataflow Remove MaybeMutBorrowedLocals 2021-11-03 16:43:12 +01:00
rustc_mir_transform Rollup merge of #90649 - cjgillot:reveal-all-2, r=lcnr 2021-11-06 23:12:06 +01:00
rustc_monomorphize Rename functions reflect that inline const is also "typeck_child" 2021-11-07 04:00:34 +00:00
rustc_parse ast: Fix naming conventions in AST structures 2021-11-07 21:38:17 +08:00
rustc_parse_format
rustc_passes Rollup merge of #89561 - nbdd0121:const_typeck, r=nikomatsakis 2021-11-09 19:00:40 +01:00
rustc_plugin_impl
rustc_privacy Give inline const separate DefKind 2021-11-07 03:59:06 +00:00
rustc_query_impl
rustc_query_system Auto merge of #90361 - Mark-Simulacrum:always-verify, r=michaelwoerister 2021-11-08 13:38:08 +00:00
rustc_resolve Rollup merge of #89561 - nbdd0121:const_typeck, r=nikomatsakis 2021-11-09 19:00:40 +01:00
rustc_save_analysis Give inline const separate DefKind 2021-11-07 03:59:06 +00:00
rustc_serialize
rustc_session Auto merge of #87337 - jyn514:lint-error, r=oli-obk,flip1995 2021-11-09 08:21:10 +00:00
rustc_span Auto merge of #90485 - camsteffen:fmt-args-less-bind, r=m-ou-se 2021-11-09 05:33:16 +00:00
rustc_symbol_mangling
rustc_target Rollup merge of #90494 - Meziu:armv6k-3ds-target, r=sanxiyn 2021-11-08 15:15:22 +01:00
rustc_trait_selection Rollup merge of #89561 - nbdd0121:const_typeck, r=nikomatsakis 2021-11-09 19:00:40 +01:00
rustc_traits Make select_* methods return Vec for TraitEngine 2021-11-08 23:35:23 +08:00
rustc_ty_utils
rustc_type_ir
rustc_typeck Rollup merge of #90035 - SparrowLii:rfc2528, r=jackh726 2021-11-09 19:00:41 +01:00