rust/compiler/rustc_session/src
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
..
cgu_reuse_tracker.rs Make Diagnostic::span_fatal unconditionally raise an error 2021-05-08 23:12:04 -04:00
code_stats.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
config.rs Add -Z location-detail flag 2021-10-15 13:10:03 -07:00
cstore.rs Access Session while decoding expn_id. 2021-10-06 19:06:20 +02:00
filesearch.rs Move get_tools_search_paths from FileSearch to Session 2021-09-08 18:25:47 +02:00
lib.rs Move ICH to rustc_query_system. 2021-10-03 16:08:53 +02:00
options.rs Rollup merge of #89920 - hudson-ayers:location-detail-control, r=davidtwco 2021-10-23 05:28:23 +02:00
output.rs Use command line metadata path if provided 2021-05-28 22:24:24 -07:00
parse.rs Report fatal lexer errors in --cfg command line arguments 2021-10-02 19:15:55 +02:00
search_paths.rs Doc comments 2021-09-08 18:25:46 +02:00
session.rs Enable AutoFDO. 2021-10-06 19:36:52 +00:00
utils.rs Implement RFC 2951: Native link modifiers 2021-05-05 16:04:25 -07:00