about summary refs log tree commit diff
path: root/src/libsyntax/parse/lexer/comments.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-21 15:23:07 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-21 15:23:07 -0700
commit37a1f2e3acc75e8a3d0fd47bb345b2cd880b2937 (patch)
tree0e9af466fc2c1f4185b87f29ffe71a86ad5bcaa9 /src/libsyntax/parse/lexer/comments.rs
parent957cb422a98585568558ad88ec5a0841c43961ae (diff)
parent19c8d701743922a709a4eb6554f562996b7baa27 (diff)
downloadrust-37a1f2e3acc75e8a3d0fd47bb345b2cd880b2937.tar.gz
rust-37a1f2e3acc75e8a3d0fd47bb345b2cd880b2937.zip
rollup merge of #24487: erickt/syntax
This removes the usage of `#[feature(into_cow, slice_patterns, box_syntax, box_patterns, quote, unsafe_destructor)]` from being used in libsyntax. My main desire for this is that it brings me one step closer to letting [syntex](https://github.com/erickt/rust-syntex) compile with stable rust. Hopefully this doesn't inconvenience rust development.
Diffstat (limited to 'src/libsyntax/parse/lexer/comments.rs')
-rw-r--r--src/libsyntax/parse/lexer/comments.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs
index bda01d5a654..fb3a96f4c28 100644
--- a/src/libsyntax/parse/lexer/comments.rs
+++ b/src/libsyntax/parse/lexer/comments.rs
@@ -13,11 +13,12 @@ pub use self::CommentStyle::*;
 use ast;
 use codemap::{BytePos, CharPos, CodeMap, Pos};
 use diagnostic;
-use parse::lexer::{is_whitespace, Reader};
-use parse::lexer::{StringReader, TokenAndSpan};
 use parse::lexer::is_block_doc_comment;
+use parse::lexer::{StringReader, TokenAndSpan};
+use parse::lexer::{is_whitespace, Reader};
 use parse::lexer;
 use print::pprust;
+use str::char_at;
 
 use std::io::Read;
 use std::usize;
@@ -209,7 +210,7 @@ fn all_whitespace(s: &str, col: CharPos) -> Option<usize> {
     let mut col = col.to_usize();
     let mut cursor: usize = 0;
     while col > 0 && cursor < len {
-        let ch = s.char_at(cursor);
+        let ch = char_at(s, cursor);
         if !ch.is_whitespace() {
             return None;
         }
@@ -246,7 +247,7 @@ fn read_block_comment(rdr: &mut StringReader,
     rdr.bump();
     rdr.bump();
 
-    let mut curr_line = String::from_str("/*");
+    let mut curr_line = String::from("/*");
 
     // doc-comments are not really comments, they are attributes
     if (rdr.curr_is('*') && !rdr.nextch_is('*')) || rdr.curr_is('!') {