summary refs log tree commit diff
path: root/src/librustc_save_analysis
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-08-11 01:08:30 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-08-15 20:38:12 +0300
commitdfcbe75900f2cb813754ef104526ebce568fd75b (patch)
treed091ddba9e494c82e0a208b048478ecfa3b8d8e7 /src/librustc_save_analysis
parentf7af19c279b8b7ea3d2c21fcbd67164af8d5d968 (diff)
downloadrust-dfcbe75900f2cb813754ef104526ebce568fd75b.tar.gz
rust-dfcbe75900f2cb813754ef104526ebce568fd75b.zip
syntax_pos: Introduce a helper for checking whether a span comes from expansion
Diffstat (limited to 'src/librustc_save_analysis')
-rw-r--r--src/librustc_save_analysis/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs
index 9da6cd80057..0bbbbb8249c 100644
--- a/src/librustc_save_analysis/lib.rs
+++ b/src/librustc_save_analysis/lib.rs
@@ -1156,7 +1156,7 @@ fn escape(s: String) -> String {
 // Helper function to determine if a span came from a
 // macro expansion or syntax extension.
 fn generated_code(span: Span) -> bool {
-    span.ctxt() != NO_EXPANSION || span.is_dummy()
+    span.from_expansion() || span.is_dummy()
 }
 
 // DefId::index is a newtype and so the JSON serialisation is ugly. Therefore