diff options
| author | Jonathan Turner <jturner@mozilla.com> | 2016-09-19 12:31:56 -0700 |
|---|---|---|
| committer | Jonathan Turner <jturner@mozilla.com> | 2016-09-19 12:31:56 -0700 |
| commit | 2ea3ab3a9022a93e45c4d50a1c43aec5f56ab4dc (patch) | |
| tree | 28b2c21cf26ac97dd70651b1970bdab4c462b816 /src/libsyntax_pos | |
| parent | 8394685b8385156fc4bc31cfbc693867e276d9d7 (diff) | |
| download | rust-2ea3ab3a9022a93e45c4d50a1c43aec5f56ab4dc.tar.gz rust-2ea3ab3a9022a93e45c4d50a1c43aec5f56ab4dc.zip | |
Add the ability to merge spans to codemap
Diffstat (limited to 'src/libsyntax_pos')
| -rw-r--r-- | src/libsyntax_pos/lib.rs | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs index d835f8058fa..0c0c62275d4 100644 --- a/src/libsyntax_pos/lib.rs +++ b/src/libsyntax_pos/lib.rs @@ -96,24 +96,6 @@ impl Span { self.lo == other.lo && self.hi == other.hi } - /// Returns `Some(span)`, a union of `self` and `other`, on overlap. - pub fn merge(self, other: Span) -> Option<Span> { - if self.expn_id != other.expn_id { - return None; - } - - if (self.lo <= other.lo && self.hi > other.lo) || - (self.lo >= other.lo && self.lo < other.hi) { - Some(Span { - lo: cmp::min(self.lo, other.lo), - hi: cmp::max(self.hi, other.hi), - expn_id: self.expn_id, - }) - } else { - None - } - } - /// Returns `Some(span)`, where the start is trimmed by the end of `other` pub fn trim_start(self, other: Span) -> Option<Span> { if self.hi > other.hi { |
