diff options
| author | bors <bors@rust-lang.org> | 2020-06-04 04:38:48 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-06-04 04:38:48 +0000 |
| commit | 627957100c9b810a10c30a11cf1a8a3188d5f9f4 (patch) | |
| tree | 29547a498515c0bf7a5126ee1ef78df18d69f604 /library/std/src/sys/unix/stack_overflow.rs | |
| parent | f3fadf6abd571868d70538561a0731ddd800003a (diff) | |
| parent | 717fd665ad1095b12907ed0f2426d8eb06c2bddc (diff) | |
| download | rust-627957100c9b810a10c30a11cf1a8a3188d5f9f4.tar.gz rust-627957100c9b810a10c30a11cf1a8a3188d5f9f4.zip | |
Auto merge of #72618 - Aaron1011:feature/early-sourcemap, r=petrochenkov
Make `SourceMap` available for early debug-printing of `Span`s Normally, we debug-print `Spans` using the `SourceMap` retrieved from the global `TyCtxt`. However, we fall back to printing out the `Span`'s raw fields (instead of a file and line number) when we try to print a `Span` before a `TyCtxt` is available. This makes debugging early phases of the compile, such as parsing, much more difficult. This commit stores a `SourceMap` in `rustc_span::GlOBALS` as a fallback. When a `TyCtxt` is not available, we try to retrieve one from `GLOBALS` - only if this is not available do we fall back to the raw field output. I'm not sure how to write a test for this - however, this can be verified locally by setting `RUSTC_LOG="rustc_parse=debug"`, and verifying that the output contains filenames and line numbers.
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
