about summary refs log tree commit diff
path: root/src/libsyntax_pos
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-05-18 02:58:13 +0000
committerbors <bors@rust-lang.org>2018-05-18 02:58:13 +0000
commitdfc07a48f6797a20b3ee04fcff6f6c64bf0443bc (patch)
treeb0356d0003fb9a5038bb884761df87d496b1b836 /src/libsyntax_pos
parentbedbf727855d099963b66cf6619a53d3c073f52a (diff)
parentfaa1f212981d46d7bddd25c9b633193f4227d526 (diff)
downloadrust-dfc07a48f6797a20b3ee04fcff6f6c64bf0443bc.tar.gz
rust-dfc07a48f6797a20b3ee04fcff6f6c64bf0443bc.zip
Auto merge of #50847 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 10 pull requests

Successful merges:

 - #50387 (Remove leftover tab in libtest outputs)
 - #50553 (Add Option::xor method)
 - #50610 (Improve format string errors)
 - #50649 (Tweak `nearest_common_ancestor()`.)
 - #50790 (Fix grammar documentation wrt Unicode identifiers)
 - #50791 (Fix null exclusions in grammar docs)
 - #50806 (Add `bless` x.py subcommand for easy ui test replacement)
 - #50818 (Speed up `opt_normalize_projection_type`)
 - #50837 (Revert #49767)
 - #50839 (Make sure people know the book is free oline)

Failed merges:
Diffstat (limited to 'src/libsyntax_pos')
-rw-r--r--src/libsyntax_pos/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs
index 26ab5d0a34b..73f0e6a6018 100644
--- a/src/libsyntax_pos/lib.rs
+++ b/src/libsyntax_pos/lib.rs
@@ -428,6 +428,13 @@ impl Span {
         )
     }
 
+    pub fn from_inner_byte_pos(self, start: usize, end: usize) -> Span {
+        let span = self.data();
+        Span::new(span.lo + BytePos::from_usize(start),
+                  span.lo + BytePos::from_usize(end),
+                  span.ctxt)
+    }
+
     #[inline]
     pub fn apply_mark(self, mark: Mark) -> Span {
         let span = self.data();