about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
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_codegen_ssa
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_codegen_ssa')
-rw-r--r--src/librustc_codegen_ssa/mir/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_codegen_ssa/mir/mod.rs b/src/librustc_codegen_ssa/mir/mod.rs
index e7517d69991..32bcdebc1c4 100644
--- a/src/librustc_codegen_ssa/mir/mod.rs
+++ b/src/librustc_codegen_ssa/mir/mod.rs
@@ -8,7 +8,7 @@ use crate::base;
 use crate::debuginfo::{self, VariableAccess, VariableKind, FunctionDebugContext};
 use crate::traits::*;
 
-use syntax_pos::{DUMMY_SP, NO_EXPANSION, BytePos, Span};
+use syntax_pos::{DUMMY_SP, BytePos, Span};
 use syntax::symbol::kw;
 
 use std::iter;
@@ -120,7 +120,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
         // In order to have a good line stepping behavior in debugger, we overwrite debug
         // locations of macro expansions with that of the outermost expansion site
         // (unless the crate is being compiled with `-Z debug-macros`).
-        if source_info.span.ctxt() == NO_EXPANSION ||
+        if !source_info.span.from_expansion() ||
            self.cx.sess().opts.debugging_opts.debug_macros {
             let scope = self.scope_metadata_for_loc(source_info.scope, source_info.span.lo());
             (scope, source_info.span)