Add -Z proc-macro-backtrace to allow showing proc-macro panics

Fixes #75050

Previously, we would unconditionally suppress the panic hook during
proc-macro execution. This commit adds a new flag
-Z proc-macro-backtrace, which allows running the panic hook for
easier debugging.
This commit is contained in:
Aaron Hill 2020-08-30 22:17:24 -04:00
parent 36b0d7e257
commit d9208665b5
No known key found for this signature in database
GPG key ID: B4087E510E98B164
10 changed files with 99 additions and 27 deletions

View file

@ -291,6 +291,7 @@ fn configure_and_expand_inner<'a>(
trace_mac: sess.opts.debugging_opts.trace_macros,
should_test: sess.opts.test,
span_debug: sess.opts.debugging_opts.span_debug,
proc_macro_backtrace: sess.opts.debugging_opts.proc_macro_backtrace,
..rustc_expand::expand::ExpansionConfig::default(crate_name.to_string())
};

View file

@ -502,6 +502,7 @@ fn test_debugging_options_tracking_hash() {
untracked!(print_llvm_passes, true);
untracked!(print_mono_items, Some(String::from("abc")));
untracked!(print_type_sizes, true);
untracked!(proc_macro_backtrace, true);
untracked!(query_dep_graph, true);
untracked!(query_stats, true);
untracked!(save_analysis, true);