rust/compiler
bors d8fc819247 Auto merge of #109466 - davidlattimore:inline-arg-via-var-debug-info, r=wesleywiser
Preserve argument indexes when inlining MIR

We store argument indexes on VarDebugInfo. Unlike the previous method of relying on the variable index to know whether a variable is an argument, this survives MIR inlining.

We also no longer check if var.source_info.scope is the outermost scope. When a function gets inlined, the arguments to the inner function will no longer be in the outermost scope. What we care about though is whether they were in the outermost scope prior to inlining, which we know by whether we assigned an argument index.

Fixes #83217

I considered using `Option<NonZeroU16>` instead of `Option<u16>` to store the index. I didn't because `TypeFoldable` isn't implemented for `NonZeroU16` and because it looks like due to padding, it currently wouldn't make any difference. But I indexed from 1 anyway because (a) it'll make it easier if later it becomes worthwhile to use a `NonZeroU16` and because the arguments were previously indexed from 1, so it made for a smaller change.

This is my first PR on rust-lang/rust, so apologies if I've gotten anything not quite right.
2023-04-13 01:51:27 +00:00
..
rustc
rustc_abi
rustc_apfloat
rustc_arena
rustc_ast Rollup merge of #110203 - compiler-errors:rtn-dots, r=eholk 2023-04-12 20:56:22 +02:00
rustc_ast_lowering Rollup merge of #110203 - compiler-errors:rtn-dots, r=eholk 2023-04-12 20:56:22 +02:00
rustc_ast_passes Rollup merge of #110237 - oli-obk:impl_trait_in_assoc_tys, r=jackh726 2023-04-12 20:56:24 +02:00
rustc_ast_pretty
rustc_attr
rustc_baked_icu_data
rustc_borrowck Auto merge of #110249 - matthiaskrgr:rollup-7iig04q, r=matthiaskrgr 2023-04-12 20:01:36 +00:00
rustc_builtin_macros Auto merge of #110252 - matthiaskrgr:rollup-ovaixra, r=matthiaskrgr 2023-04-12 22:19:29 +00:00
rustc_codegen_cranelift
rustc_codegen_gcc Rollup merge of #96971 - zhaixiaojuan:master, r=wesleywiser 2023-04-11 20:28:45 -07:00
rustc_codegen_llvm
rustc_codegen_ssa Auto merge of #109466 - davidlattimore:inline-arg-via-var-debug-info, r=wesleywiser 2023-04-13 01:51:27 +00:00
rustc_const_eval Auto merge of #110249 - matthiaskrgr:rollup-7iig04q, r=matthiaskrgr 2023-04-12 20:01:36 +00:00
rustc_data_structures
rustc_driver
rustc_driver_impl Make rustdoc and rustc's help match exactly 2023-04-12 05:27:26 -05:00
rustc_error_codes
rustc_error_messages
rustc_errors Rollup merge of #110135 - compiler-errors:revert-108031, r=davidtwco 2023-04-12 22:04:35 +02:00
rustc_expand Rollup merge of #110222 - lovelymono:rustc-expand-mbe-diagnostic, r=davidtwco 2023-04-12 20:56:24 +02:00
rustc_feature Rollup merge of #110237 - oli-obk:impl_trait_in_assoc_tys, r=jackh726 2023-04-12 20:56:24 +02:00
rustc_fs_util
rustc_graphviz
rustc_hir
rustc_hir_analysis Rollup merge of #110153 - DaniPopes:compiler-typos, r=Nilstrieb 2023-04-12 20:56:21 +02:00
rustc_hir_pretty
rustc_hir_typeck Auto merge of #110252 - matthiaskrgr:rollup-ovaixra, r=matthiaskrgr 2023-04-12 22:19:29 +00:00
rustc_incremental
rustc_index
rustc_infer Auto merge of #110252 - matthiaskrgr:rollup-ovaixra, r=matthiaskrgr 2023-04-12 22:19:29 +00:00
rustc_interface
rustc_lexer
rustc_lint Rollup merge of #110153 - DaniPopes:compiler-typos, r=Nilstrieb 2023-04-12 20:56:21 +02:00
rustc_lint_defs
rustc_llvm Rollup merge of #96971 - zhaixiaojuan:master, r=wesleywiser 2023-04-11 20:28:45 -07:00
rustc_log
rustc_macros Auto merge of #110092 - clubby789:builtin-macros-translatable, r=compiler-errors 2023-04-11 14:40:54 +00:00
rustc_metadata Split implied and super predicate queries 2023-04-11 17:45:42 +00:00
rustc_middle Auto merge of #109466 - davidlattimore:inline-arg-via-var-debug-info, r=wesleywiser 2023-04-13 01:51:27 +00:00
rustc_mir_build Auto merge of #109466 - davidlattimore:inline-arg-via-var-debug-info, r=wesleywiser 2023-04-13 01:51:27 +00:00
rustc_mir_dataflow
rustc_mir_transform Auto merge of #109466 - davidlattimore:inline-arg-via-var-debug-info, r=wesleywiser 2023-04-13 01:51:27 +00:00
rustc_monomorphize
rustc_parse Auto merge of #110252 - matthiaskrgr:rollup-ovaixra, r=matthiaskrgr 2023-04-12 22:19:29 +00:00
rustc_parse_format
rustc_passes Rollup merge of #110203 - compiler-errors:rtn-dots, r=eholk 2023-04-12 20:56:22 +02:00
rustc_plugin_impl
rustc_privacy
rustc_query_impl
rustc_query_system Auto merge of #109935 - michaelwoerister:fix-feed-in-eval-always, r=cjgillot 2023-04-12 11:16:35 +00:00
rustc_resolve Rollup merge of #110203 - compiler-errors:rtn-dots, r=eholk 2023-04-12 20:56:22 +02:00
rustc_serialize
rustc_session
rustc_smir
rustc_span Rollup merge of #110237 - oli-obk:impl_trait_in_assoc_tys, r=jackh726 2023-04-12 20:56:24 +02:00
rustc_symbol_mangling
rustc_target Rollup merge of #110153 - DaniPopes:compiler-typos, r=Nilstrieb 2023-04-12 20:56:21 +02:00
rustc_trait_selection Auto merge of #110252 - matthiaskrgr:rollup-ovaixra, r=matthiaskrgr 2023-04-12 22:19:29 +00:00
rustc_traits
rustc_transmute
rustc_ty_utils
rustc_type_ir