diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2017-03-17 04:04:41 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2017-03-29 00:41:10 +0000 |
| commit | ec7c0aece17c9a11bc2eca15b994355a161bf878 (patch) | |
| tree | 05ff8d97fedf1ab11028eddbd4982896cc61387f /src/librustc_save_analysis | |
| parent | 496996c2af6174cb83a65756249d289f315dff80 (diff) | |
Merge `ExpnId` and `SyntaxContext`.
Diffstat (limited to 'src/librustc_save_analysis')
| -rw-r--r-- | src/librustc_save_analysis/lib.rs | 7 | ||||
| -rw-r--r-- | src/librustc_save_analysis/span_utils.rs | 3 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index e5c04f6b61e..fd6803e087a 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -690,9 +690,8 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> { // Note we take care to use the source callsite/callee, to handle // nested expansions and ensure we only generate data for source-visible // macro uses. - let callsite = self.tcx.sess.codemap().source_callsite(span); - let callee = self.tcx.sess.codemap().source_callee(span); - let callee = option_try!(callee); + let callsite = span.source_callsite(); + let callee = option_try!(span.source_callee()); let callee_span = option_try!(callee.span); // Ignore attribute macros, their spans are usually mangled @@ -1013,5 +1012,5 @@ fn escape(s: String) -> String { // Helper function to determine if a span came from a // macro expansion or syntax extension. pub fn generated_code(span: Span) -> bool { - span.expn_id != NO_EXPANSION || span == DUMMY_SP + span.ctxt != NO_EXPANSION || span == DUMMY_SP } diff --git a/src/librustc_save_analysis/span_utils.rs b/src/librustc_save_analysis/span_utils.rs index 34402742e6c..c19f805a285 100644 --- a/src/librustc_save_analysis/span_utils.rs +++ b/src/librustc_save_analysis/span_utils.rs @@ -462,8 +462,7 @@ impl<'a> SpanUtils<'a> { // Otherwise, a generated span is deemed invalid if it is not a sub-span of the root // callsite. This filters out macro internal variables and most malformed spans. - let span = self.sess.codemap().source_callsite(parent); - !(span.contains(parent)) + !parent.source_callsite().contains(parent) } } |
