diff options
| author | David Wood <david@davidtw.co> | 2018-01-14 17:29:07 +0000 |
|---|---|---|
| committer | David Wood <david@davidtw.co> | 2018-01-27 11:46:27 +0000 |
| commit | c71cec8834bf30032a8e49d2949f6d8d4080b639 (patch) | |
| tree | 49dc11292d287459c01aeddbd4c40240de9b2e16 /src/libsyntax_pos | |
| parent | c6e6428d1a13f61f5ffbe43697a21f3cd82cd01d (diff) | |
| download | rust-c71cec8834bf30032a8e49d2949f6d8d4080b639.tar.gz rust-c71cec8834bf30032a8e49d2949f6d8d4080b639.zip | |
end_point handling multibyte characters correctly.
Diffstat (limited to 'src/libsyntax_pos')
| -rw-r--r-- | src/libsyntax_pos/lib.rs | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs index 5866d8e4aa9..dd1ec7284f6 100644 --- a/src/libsyntax_pos/lib.rs +++ b/src/libsyntax_pos/lib.rs @@ -216,22 +216,6 @@ impl Span { self.data().with_ctxt(ctxt) } - /// Returns a new span representing just the end-point of this span - pub fn end_point(self) -> Span { - let span = self.data(); - // We can avoid an ICE by checking if subtraction would cause an overflow. - let hi = if span.hi.0 == u32::min_value() { span.hi.0 } else { span.hi.0 - 1 }; - let lo = cmp::max(hi, span.lo.0); - span.with_lo(BytePos(lo)) - } - - /// Returns a new span representing the next character after the end-point of this span - pub fn next_point(self) -> Span { - let span = self.data(); - let lo = cmp::max(span.hi.0, span.lo.0 + 1); - Span::new(BytePos(lo), BytePos(lo), span.ctxt) - } - /// Returns `self` if `self` is not the dummy span, and `other` otherwise. pub fn substitute_dummy(self, other: Span) -> Span { if self.source_equal(&DUMMY_SP) { other } else { self } |
