about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2020-05-31 16:20:50 -0400
committerAaron Hill <aa1ronham@gmail.com>2020-06-04 15:39:12 -0400
commitb541d3da5d9f89407c7072f4a6d65872cf30a577 (patch)
tree090f52a1196afb99016986ef147be1b483b266bb /src/test/codegen
parent3d5d0f898c2f3998e50c2180c6202f193c3acdbc (diff)
downloadrust-b541d3da5d9f89407c7072f4a6d65872cf30a577.tar.gz
rust-b541d3da5d9f89407c7072f4a6d65872cf30a577.zip
Add `-Z span-debug` to allow for easier debugging of proc macros
Currently, the `Debug` impl for `proc_macro::Span` just prints out
the byte range. This can make debugging proc macros (either as a crate
author or as a compiler developer) very frustrating, since neither the
actual filename nor the `SyntaxContext` is displayed.

This commit adds a perma-unstable flag `-Z span-debug`. When enabled,
the `Debug` impl for `proc_macro::Span` simply forwards directly to
`rustc_span::Span`. Once #72618 is merged, this will start displaying
actual line numbers.

While `Debug` impls are not subject to Rust's normal stability
guarnatees, we probably shouldn't expose any additional information on
stable until `#![feature(proc_macro_span)]` is stabilized. Otherwise,
we would be providing a 'backdoor' way to access information that's
supposed be behind unstable APIs.
Diffstat (limited to 'src/test/codegen')
0 files changed, 0 insertions, 0 deletions