From c32d03f4172580e3f33e4844ed3c01234dca2d53 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 22 Dec 2014 09:04:23 -0800 Subject: std: Stabilize the prelude module This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068 --- src/libsyntax/parse/lexer/mod.rs | 3 ++- src/libsyntax/parse/parser.rs | 3 ++- src/libsyntax/parse/token.rs | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 13d020f6ae3..0f5ff33021c 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -16,6 +16,7 @@ use ext::tt::transcribe::tt_next_token; use parse::token; use parse::token::{str_to_ident}; +use std::borrow::IntoCow; use std::char; use std::fmt; use std::mem::replace; @@ -358,7 +359,7 @@ impl<'a> StringReader<'a> { pub fn nextnextch(&self) -> Option { let offset = self.byte_offset(self.pos).to_uint(); - let s = self.filemap.deref().src[]; + let s = self.filemap.src.as_slice(); if offset >= s.len() { return None } let str::CharRange { next, .. } = s.char_range_at(offset); if next < s.len() { diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index a2e2abab03e..7b40ae85c7d 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -84,11 +84,12 @@ use owned_slice::OwnedSlice; use std::collections::HashSet; use std::io::fs::PathExtensions; +use std::iter; use std::mem; use std::num::Float; use std::rc::Rc; -use std::iter; use std::slice; +use std::str::from_str; bitflags! { flags Restrictions: u8 { diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index f575d3d6c67..dbc0cef8340 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -22,8 +22,10 @@ use util::interner::{RcStr, StrInterner}; use util::interner; use serialize::{Decodable, Decoder, Encodable, Encoder}; +use std::cmp::Equiv; use std::fmt; use std::mem; +use std::ops::Deref; use std::path::BytesContainer; use std::rc::Rc; -- cgit 1.4.1-3-g733a5