]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/parse/lexer/mod.rs
Fallout from stabilization.
[rust.git] / src / libsyntax / parse / lexer / mod.rs
index 4cdafb36eecc4b9ddf937b436bfdcdba23341db5..7852b077b536066963de2bd53e91142f23bb4487 100644 (file)
@@ -271,9 +271,9 @@ pub fn name_from_to(&self, start: BytePos, end: BytePos) -> ast::Name {
     fn with_str_from_to<T, F>(&self, start: BytePos, end: BytePos, f: F) -> T where
         F: FnOnce(&str) -> T,
     {
-        f(self.filemap.src.slice(
-                self.byte_offset(start).to_uint(),
-                self.byte_offset(end).to_uint()))
+        f(&self.filemap.src[
+                self.byte_offset(start).to_uint()..
+                self.byte_offset(end).to_uint()])
     }
 
     /// Converts CRLF to LF in the given string, raising an error on bare CR.