diff options
| author | Edward Wang <edward.yu.wang@gmail.com> | 2014-02-01 04:35:36 +0800 |
|---|---|---|
| committer | Edward Wang <edward.yu.wang@gmail.com> | 2014-02-11 05:21:35 +0800 |
| commit | e9ff91e9beb6c92d9662242c1090c507b1611c59 (patch) | |
| tree | cb5bfa3501d0613b0375d6a3f7cb299ac2c22d95 /src/libsyntax/parse | |
| parent | 4f16e519f13cbfd78cd6c06fc0639df401bc0077 (diff) | |
| download | rust-e9ff91e9beb6c92d9662242c1090c507b1611c59.tar.gz rust-e9ff91e9beb6c92d9662242c1090c507b1611c59.zip | |
Move replace and swap to std::mem. Get rid of std::util
Also move Void to std::any, move drop to std::mem and reexport in prelude.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/lexer.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/parse/obsolete.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index f6ebfbfcc3b..b711e95bc94 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -18,8 +18,8 @@ use parse::token::{str_to_ident}; use std::cell::{Cell, RefCell}; use std::char; +use std::mem::replace; use std::num::from_str_radix; -use std::util; pub use ext::tt::transcribe::{TtReader, new_tt_reader}; @@ -112,7 +112,7 @@ impl Reader for StringReader { let ret_val = { let mut peek_tok = self.peek_tok.borrow_mut(); TokenAndSpan { - tok: util::replace(peek_tok.get(), token::UNDERSCORE), + tok: replace(peek_tok.get(), token::UNDERSCORE), sp: self.peek_span.get(), } }; diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index 091fbf82b0d..6f6f8d7d563 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -76,7 +76,7 @@ impl ParserObsoleteMethods for Parser { let (kind_str, desc) = match kind { ObsoleteSwap => ( "swap", - "use std::util::{swap, replace} instead" + "use std::mem::{swap, replace} instead" ), ObsoleteUnsafeBlock => ( "non-standalone unsafe block", diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index fd8b945a177..507debc8ce0 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -82,7 +82,7 @@ use opt_vec::OptVec; use std::cell::Cell; use std::hashmap::HashSet; use std::kinds::marker; -use std::util; +use std::mem::replace; use std::vec; #[allow(non_camel_case_types)] @@ -735,7 +735,7 @@ impl Parser { let next = if self.buffer_start == self.buffer_end { self.reader.next_token() } else { - // Avoid token copies with `util::replace`. + // Avoid token copies with `replace`. let buffer_start = self.buffer_start as uint; let next_index = (buffer_start + 1) & 3 as uint; self.buffer_start = next_index as int; @@ -744,7 +744,7 @@ impl Parser { tok: token::UNDERSCORE, sp: self.span, }; - util::replace(&mut self.buffer[buffer_start], placeholder) + replace(&mut self.buffer[buffer_start], placeholder) }; self.span = next.sp; self.token = next.tok; @@ -753,7 +753,7 @@ impl Parser { // Advance the parser by one token and return the bumped token. pub fn bump_and_get(&mut self) -> token::Token { - let old_token = util::replace(&mut self.token, token::UNDERSCORE); + let old_token = replace(&mut self.token, token::UNDERSCORE); self.bump(); old_token } |
