diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-02-26 21:00:43 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-03-04 15:59:30 -0800 |
| commit | 95d904625b4d45af80b4e40d51a3a0fde1abaa8a (patch) | |
| tree | b0872e63b8d75543ce5141ceba44c12c459474f2 /src/libsyntax/parse/lexer | |
| parent | 3b3bb0e682c2d252e9f62dd9df5cff9552af91ad (diff) | |
| download | rust-95d904625b4d45af80b4e40d51a3a0fde1abaa8a.tar.gz rust-95d904625b4d45af80b4e40d51a3a0fde1abaa8a.zip | |
std: Deprecate std::old_io::fs
This commit deprecates the majority of std::old_io::fs in favor of std::fs and its new functionality. Some functions remain non-deprecated but are now behind a feature gate called `old_fs`. These functions will be deprecated once suitable replacements have been implemented. The compiler has been migrated to new `std::fs` and `std::path` APIs where appropriate as part of this change.
Diffstat (limited to 'src/libsyntax/parse/lexer')
| -rw-r--r-- | src/libsyntax/parse/lexer/comments.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs index 3ad1d96a45d..fb9e0480ceb 100644 --- a/src/libsyntax/parse/lexer/comments.rs +++ b/src/libsyntax/parse/lexer/comments.rs @@ -19,9 +19,8 @@ use parse::lexer::is_block_doc_comment; use parse::lexer; use print::pprust; -use std::old_io; +use std::io::Read; use std::str; -use std::string::String; use std::usize; #[derive(Clone, Copy, PartialEq)] @@ -337,9 +336,10 @@ pub struct Literal { // probably not a good thing. pub fn gather_comments_and_literals(span_diagnostic: &diagnostic::SpanHandler, path: String, - srdr: &mut old_io::Reader) + srdr: &mut Read) -> (Vec<Comment>, Vec<Literal>) { - let src = srdr.read_to_end().unwrap(); + let mut src = Vec::new(); + srdr.read_to_end(&mut src).unwrap(); let src = String::from_utf8(src).unwrap(); let cm = CodeMap::new(); let filemap = cm.new_filemap(path, src); |
