rust/compiler/rustc_span/src
Jonas Schievink 255e0764c0
Rollup merge of #81608 - Aaron1011:macro-res-parse-err, r=davidtwco
Improve handling of spans around macro result parse errors

Fixes #81543

After we expand a macro, we try to parse the resulting tokens as a AST
node. This commit makes several improvements to how we handle spans when
an error occurs:

* Only ovewrite the original `Span` if it's a dummy span. This preserves
  a more-specific span if one is available.
* Use `self.prev_token` instead of `self.token` when emitting an error
  message after encountering EOF, since an EOF token always has a dummy
  span
* Make `SourceMap::next_point` leave dummy spans unused. A dummy span
  does not have a logical 'next point', since it's a zero-length span.
  Re-using the span span preserves its 'dummy-ness' for other checks
2021-02-02 12:15:02 +01:00
..
analyze_source_file remove redundant closures (clippy::redundant_closure) 2021-01-03 13:34:24 +01:00
lev_distance remove redundant closures (clippy::redundant_closure) 2021-01-03 13:34:24 +01:00
source_map Use Option::map_or instead of .map(..).unwrap_or(..) 2021-01-14 19:23:59 +01:00
symbol mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
analyze_source_file.rs Fix some clippy lints 2020-12-03 17:08:19 -05:00
caching_source_map_view.rs rustc_span: add span_data_to_lines_and_cols to caching source map view 2020-12-03 18:36:34 -08:00
def_id.rs Add some docs to rustdoc::clean::inline and def_id functions 2020-10-06 09:46:00 +00:00
edition.rs Add edition 2021. 2020-12-31 19:06:09 +01:00
fatal_error.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
hygiene.rs Add disambiugator to ExpnData 2021-01-23 15:41:17 -05:00
lev_distance.rs Edit rustc_span documentation 2020-12-25 14:02:52 -08:00
lib.rs Add disambiugator to ExpnData 2021-01-23 15:41:17 -05:00
source_map.rs Improve handling of spans around macro result parse errors 2021-01-31 15:24:34 -05:00
span_encoding.rs Edit rustc_span documentation 2020-12-25 14:02:52 -08:00
symbol.rs Auto merge of #80851 - m-ou-se:panic-2021, r=petrochenkov 2021-02-01 10:25:31 +00:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00