rust/compiler
Matthias Krüger 8fb194c86f
Rollup merge of #89920 - hudson-ayers:location-detail-control, r=davidtwco
Implement -Z location-detail flag

This PR implements the `-Z location-detail` flag as described in https://github.com/rust-lang/rfcs/pull/2091 .

`-Z location-detail=val` controls what location details are tracked when using `caller_location`. This allows users to control what location details are printed as part of panic messages, by allowing them to exclude any combination of filenames, line numbers, and column numbers. This option is intended to provide users with a way to mitigate the size impact of `#[track_caller]`.

Some measurements of the savings of this approach on an embedded binary can be found here: https://github.com/rust-lang/rust/issues/70579#issuecomment-942556822 .

Closes #70580 (unless people want to leave that open as a place for discussion of further improvements).

This is my first real PR to rust, so any help correcting mistakes / understanding side effects / improving my tests is appreciated :)

I have one question: RFC 2091 specified this as a debugging option (I think that is what -Z implies?). Does that mean this can never be stabilized without a separate MCP? If so, do I need to submit an MCP now, or is the initial RFC specifying this option sufficient for this to be merged as is, and then an MCP would be needed for eventual stabilization?
2021-10-23 05:28:23 +02:00
..
rustc Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_apfloat Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_arena Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_ast Rollup merge of #89991 - petrochenkov:visitok2, r=jackh726 2021-10-22 19:42:48 +09:00
rustc_ast_lowering Rollup merge of #89895 - camsteffen:for-loop-head-span, r=davidtwco 2021-10-22 19:42:45 +09:00
rustc_ast_passes Some "parenthesis" and "parentheses" fixes 2021-10-17 12:04:01 +02:00
rustc_ast_pretty Some "parenthesis" and "parentheses" fixes 2021-10-17 12:04:01 +02:00
rustc_attr Correct typo 2021-10-16 13:36:05 -07:00
rustc_borrowck Rollup merge of #89895 - camsteffen:for-loop-head-span, r=davidtwco 2021-10-22 19:42:45 +09:00
rustc_builtin_macros rustc_span: Ident::invalid -> Ident::empty 2021-10-17 23:20:30 +03:00
rustc_codegen_cranelift Make hash_result an Option. 2021-10-20 18:29:18 +02:00
rustc_codegen_gcc Make hash_result an Option. 2021-10-20 18:29:18 +02:00
rustc_codegen_llvm Make hash_result an Option. 2021-10-20 18:29:18 +02:00
rustc_codegen_ssa Auto merge of #90050 - michaelwoerister:fix-vtable-debug-name-crash-90019, r=wesleywiser 2021-10-20 14:37:48 +00:00
rustc_const_eval Rollup merge of #89920 - hudson-ayers:location-detail-control, r=davidtwco 2021-10-23 05:28:23 +02:00
rustc_data_structures Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_driver Auto merge of #89124 - cjgillot:owner-info, r=michaelwoerister 2021-10-18 19:53:05 +00:00
rustc_error_codes Rollup merge of #89922 - JohnTitor:update-e0637, r=jackh726 2021-10-22 19:42:46 +09:00
rustc_errors Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726 2021-10-23 05:28:22 +02:00
rustc_expand Rollup merge of #89991 - petrochenkov:visitok2, r=jackh726 2021-10-22 19:42:48 +09:00
rustc_feature Rollup merge of #89730 - crlf0710:type_changing_feature, r=jackh726 2021-10-23 05:28:22 +02:00
rustc_fs_util Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_graphviz Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_hir Rollup merge of #90071 - cjgillot:no-blocks, r=oli-obk 2021-10-21 14:11:08 +09:00
rustc_hir_pretty Auto merge of #89124 - cjgillot:owner-info, r=michaelwoerister 2021-10-18 19:53:05 +00:00
rustc_incremental Merge two query callbacks arrays. 2021-10-20 18:29:27 +02:00
rustc_index Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_infer nice_region_error: Include lifetime placeholders in error output 2021-10-22 15:26:20 -07:00
rustc_interface Rollup merge of #89920 - hudson-ayers:location-detail-control, r=davidtwco 2021-10-23 05:28:23 +02:00
rustc_lexer Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_lint Rollup merge of #89895 - camsteffen:for-loop-head-span, r=davidtwco 2021-10-22 19:42:45 +09:00
rustc_lint_defs Add feature gate to non_exhaustive_omitted_patterns lint 2021-10-08 17:40:39 -04:00
rustc_llvm RustWrapper: adapt for an LLVM API change 2021-10-18 09:48:47 +02:00
rustc_macros Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_metadata Don't emit a warning for empty rmeta files. 2021-10-19 16:56:47 -07:00
rustc_middle Auto merge of #89893 - camsteffen:redundant-dump-enabled, r=matthewjasper 2021-10-22 17:32:20 +00:00
rustc_mir_build Rollup merge of #90028 - tmiasko:structural-match-closure, r=spastorino 2021-10-22 19:42:48 +09:00
rustc_mir_dataflow Adopt let_else across the compiler 2021-10-16 07:18:05 +02:00
rustc_mir_transform Auto merge of #89893 - camsteffen:redundant-dump-enabled, r=matthewjasper 2021-10-22 17:32:20 +00:00
rustc_monomorphize Auto merge of #89933 - est31:let_else, r=michaelwoerister 2021-10-19 14:41:39 +00:00
rustc_parse Rollup merge of #89257 - aDotInTheVoid:macro-error-2, r=estebank 2021-10-22 19:42:43 +09:00
rustc_parse_format Migrate to 2021 2021-09-20 22:21:42 -04:00
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 Move rustc_middle::middle::cstore to rustc_session. 2021-10-03 16:08:51 +02:00
rustc_privacy Rollup merge of #88644 - eopb:abstractconst_leaf_subst, r=lcnr 2021-10-21 14:11:03 +09:00
rustc_query_impl Build jump table at runtime. 2021-10-20 18:32:29 +02:00
rustc_query_system Address review. 2021-10-20 18:51:15 +02:00
rustc_resolve Revert "Auto merge of #89100 - petrochenkov:localbind, r=cjgillot" 2021-10-21 09:09:24 -04:00
rustc_save_analysis Auto merge of #89266 - cjgillot:session-ich, r=michaelwoerister 2021-10-05 09:45:11 +00:00
rustc_serialize Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_session Rollup merge of #89920 - hudson-ayers:location-detail-control, r=davidtwco 2021-10-23 05:28:23 +02:00
rustc_span Rollup merge of #89730 - crlf0710:type_changing_feature, r=jackh726 2021-10-23 05:28:22 +02:00
rustc_symbol_mangling Remove re-export. 2021-10-03 16:08:54 +02:00
rustc_target Auto merge of #90040 - nbdd0121:issue-90038, r=oli-obk 2021-10-19 08:13:35 +00:00
rustc_trait_selection Rollup merge of #90028 - tmiasko:structural-match-closure, r=spastorino 2021-10-22 19:42:48 +09: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 Replace FnLikeNode by FnKind. 2021-10-19 23:31:51 +02:00
rustc_type_ir Add two inline annotations for hot functions 2021-10-03 12:43:43 -04:00
rustc_typeck Rollup merge of #90074 - klensy:upvar-all, r=wesleywiser 2021-10-21 14:11:09 +09:00