rust/compiler
Matthias Krüger 1d35179077
Rollup merge of #95320 - JakobDegen:mir-docs, r=oli-obk
Document the current MIR semantics that are clear from existing code

This PR adds documentation to places, operands, rvalues, statementkinds, and terminatorkinds that describes their existing semantics and requirements. In many places the semantics depend on the Rust memory model or other T-Lang decisions - when this is the case, it is just noted as such with links to UCG issues where possible. I'm hopeful that none of the documentation added here can be used to justify optimizations that depend on the memory model. The documentation for places and operands probably comes closest to running afoul of this - if people think that it cannot be merged as is, it can definitely also be taken out.

The goal here is to only document parts of MIR that seem to be decided already, or are at least depended on by existing code. That leaves quite a number of open questions - those are marked as "needs clarification." I'm not sure what to do with those in this PR - we obviously can't decide all these questions here. Should I just leave them in as is? Take them out? Keep them in but as `//` instead of `///` comments?

If this is too big to review at once, I can split this up.

r? rust-lang/mir-opt
2022-04-12 08:46:56 +02:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast better error for binder on associated type bound 2022-04-10 16:41:15 -07:00
rustc_ast_lowering diagnostics: use correct span for const generics 2022-04-04 12:16:20 -07:00
rustc_ast_passes [let_chains] Forbid let inside parentheses 2022-03-31 18:33:05 -03:00
rustc_ast_pretty
rustc_attr
rustc_borrowck Add new MutatatingUseContexts for deinit and SetDiscriminant 2022-04-11 09:26:26 -04:00
rustc_builtin_macros Auto merge of #95697 - klensy:no-strings, r=petrochenkov 2022-04-09 13:15:26 +00:00
rustc_codegen_cranelift Add new Deinit statement kind 2022-04-11 08:55:03 -04:00
rustc_codegen_gcc Use WrappingRange::full instead of hand-rolling it 2022-04-05 13:18:22 +00:00
rustc_codegen_llvm Switch to the 'normal' basic block for writing asm outputs if needed. 2022-04-09 15:25:46 -04:00
rustc_codegen_ssa Add new MutatatingUseContexts for deinit and SetDiscriminant 2022-04-11 09:26:26 -04:00
rustc_const_eval Remove rule that place loads may not happen with variant index set 2022-04-11 15:56:04 -04:00
rustc_data_structures Auto merge of #95524 - oli-obk:cached_stable_hash_cleanups, r=nnethercote 2022-04-09 02:31:24 +00:00
rustc_driver session: opt for enabling directionality markers 2022-04-05 07:01:03 +01:00
rustc_error_codes
rustc_error_messages Suggest replacing typeof(...) with an actual type 2022-04-07 23:40:32 +04:00
rustc_errors session: opt for enabling directionality markers 2022-04-05 07:01:03 +01:00
rustc_expand Rollup merge of #95808 - petrochenkov:fragspec, r=nnethercote 2022-04-09 18:26:28 +02:00
rustc_feature Split fuzzy_provenance_casts into lossy and fuzzy, feature gate and test it 2022-04-08 17:41:28 +02:00
rustc_fs_util
rustc_graphviz
rustc_hir Avoid accessing HIR from MIR queries. 2022-04-10 13:08:36 +02:00
rustc_hir_pretty
rustc_incremental check_doc_keyword: don't alloc string for emptiness check 2022-04-08 11:45:57 +03:00
rustc_index
rustc_infer Auto merge of #95524 - oli-obk:cached_stable_hash_cleanups, r=nnethercote 2022-04-09 02:31:24 +00:00
rustc_interface expand: Remove ParseSess::missing_fragment_specifiers 2022-04-09 15:44:19 +03:00
rustc_lexer
rustc_lint Auto merge of #94527 - oli-obk:undef_scalars, r=nagisa,erikdesjardin 2022-04-05 16:46:13 +00:00
rustc_lint_defs Split fuzzy_provenance_casts into lossy and fuzzy, feature gate and test it 2022-04-08 17:41:28 +02:00
rustc_llvm Respect -Z verify-llvm-ir and other flags that add extra passes when combined with -C no-prepopulate-passes in the new LLVM Pass Manager. 2022-04-10 15:40:16 -04:00
rustc_log
rustc_macros macros: support translatable suggestions 2022-04-05 07:01:03 +01:00
rustc_metadata rustdoc: Early doc link resolution fixes and refactorings 2022-04-07 00:19:48 +03:00
rustc_middle Remove rule that place loads may not happen with variant index set 2022-04-11 15:56:04 -04:00
rustc_mir_build interpret: err instead of ICE on size mismatches in to_bits_or_ptr_internal 2022-04-07 16:24:48 -04:00
rustc_mir_dataflow Add new MutatatingUseContexts for deinit and SetDiscriminant 2022-04-11 09:26:26 -04:00
rustc_mir_transform Remove inlining cost of Deinit statements 2022-04-11 10:23:33 -04:00
rustc_monomorphize Use def_key in tcx.item_name when possible. 2022-04-09 10:54:43 +02:00
rustc_parse better error for binder on associated type bound 2022-04-10 16:41:15 -07:00
rustc_parse_format
rustc_passes check_doc_keyword: don't alloc string for emptiness check 2022-04-08 11:45:57 +03:00
rustc_plugin_impl
rustc_privacy
rustc_query_impl
rustc_query_system Auto merge of #95524 - oli-obk:cached_stable_hash_cleanups, r=nnethercote 2022-04-09 02:31:24 +00:00
rustc_resolve Rollup merge of #95907 - compiler-errors:diag, r=Dylan-DPC 2022-04-11 12:06:57 +02:00
rustc_save_analysis
rustc_serialize errors: implement fallback diagnostic translation 2022-04-05 07:01:02 +01:00
rustc_session expand: Remove ParseSess::missing_fragment_specifiers 2022-04-09 15:44:19 +03:00
rustc_span Split fuzzy_provenance_casts into lossy and fuzzy, feature gate and test it 2022-04-08 17:41:28 +02:00
rustc_symbol_mangling Do not access HIR to compute symbol_name. 2022-04-10 13:42:47 +02:00
rustc_target trivial cfg(bootstrap) changes 2022-04-05 23:18:40 +02:00
rustc_trait_selection Auto merge of #95931 - matthiaskrgr:rollup-1c5zhit, r=matthiaskrgr 2022-04-11 11:12:26 +00:00
rustc_traits
rustc_ty_utils Avoid accessing HIR from MIR queries. 2022-04-10 13:08:36 +02:00
rustc_type_ir
rustc_typeck Auto merge of #95758 - compiler-errors:issue-54771, r=estebank 2022-04-11 08:31:37 +00:00