diff options
| author | bors <bors@rust-lang.org> | 2015-10-03 00:36:50 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-10-03 00:36:50 +0000 |
| commit | 98df45830a04498c9207c4251a16ef6c80629146 (patch) | |
| tree | b77e86d28652807496d6eb6424b029d446a9ec67 /src/libsyntax | |
| parent | bfb26033af68949646081429040db606a044db22 (diff) | |
| parent | 4fb789b86eb4d9f50c1ae6477126cd84025ff566 (diff) | |
| download | rust-98df45830a04498c9207c4251a16ef6c80629146.tar.gz rust-98df45830a04498c9207c4251a16ef6c80629146.zip | |
Auto merge of #28672 - sanxiyn:const-eval-span, r=alexcrichton
Fix #28402.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/codemap.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 1f8c726bf68..aa4dd1d53c5 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -142,6 +142,10 @@ impl Span { pub fn substitute_dummy(self, other: Span) -> Span { if self == DUMMY_SP { other } else { self } } + + pub fn contains(self, other: Span) -> bool { + self.lo <= other.lo && other.hi <= self.hi + } } #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] @@ -1011,7 +1015,7 @@ impl CodeMap { let span_comes_from_this_expansion = info.callee.span.map_or(span == info.call_site, |mac_span| { - mac_span.lo <= span.lo && span.hi <= mac_span.hi + mac_span.contains(span) }); debug!("span_allows_unstable: span: {:?} call_site: {:?} callee: {:?}", |
