diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-07-08 08:33:13 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-07-27 16:38:25 -0700 |
| commit | b3aa1a6d4ac88f68e036a05fdf19be63b522b65d (patch) | |
| tree | 77f61dd9cef4e552d058de8da0b3463ff71f097b /src/librustc/metadata | |
| parent | a5c12f4e39d32af3c951b66bd2839bc0b5a1125b (diff) | |
std: Deprecate a number of unstable features
Many of these have long since reached their stage of being obsolete, so this commit starts the removal process for all of them. The unstable features that were deprecated are: * cmp_partial * fs_time * hash_default * int_slice * iter_min_max * iter_reset_fuse * iter_to_vec * map_in_place * move_from * owned_ascii_ext * page_size * read_and_zero * scan_state * slice_chars * slice_position_elem * subslice_offset
Diffstat (limited to 'src/librustc/metadata')
| -rw-r--r-- | src/librustc/metadata/creader.rs | 16 | ||||
| -rw-r--r-- | src/librustc/metadata/cstore.rs | 4 | ||||
| -rw-r--r-- | src/librustc/metadata/decoder.rs | 8 |
3 files changed, 15 insertions, 13 deletions
diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs index 8562d8c01cc..4ca34706309 100644 --- a/src/librustc/metadata/creader.rs +++ b/src/librustc/metadata/creader.rs @@ -660,14 +660,14 @@ pub fn import_codemap(local_codemap: &codemap::CodeMap, // `CodeMap::new_imported_filemap()` will then translate those // coordinates to their new global frame of reference when the // offset of the FileMap is known. - let lines = lines.into_inner().map_in_place(|pos| pos - start_pos); - let multibyte_chars = multibyte_chars - .into_inner() - .map_in_place(|mbc| - codemap::MultiByteChar { - pos: mbc.pos - start_pos, - bytes: mbc.bytes - }); + let mut lines = lines.into_inner(); + for pos in &mut lines { + *pos = *pos - start_pos; + } + let mut multibyte_chars = multibyte_chars.into_inner(); + for mbc in &mut multibyte_chars { + mbc.pos = mbc.pos - start_pos; + } let local_version = local_codemap.new_imported_filemap(name, source_length, diff --git a/src/librustc/metadata/cstore.rs b/src/librustc/metadata/cstore.rs index 3112e8f4b4c..4941c932ead 100644 --- a/src/librustc/metadata/cstore.rs +++ b/src/librustc/metadata/cstore.rs @@ -197,7 +197,9 @@ impl CStore { })) .collect::<Vec<_>>(); libs.sort_by(|&(a, _), &(b, _)| { - ordering.position_elem(&a).cmp(&ordering.position_elem(&b)) + let a = ordering.iter().position(|x| *x == a); + let b = ordering.iter().position(|x| *x == b); + a.cmp(&b) }); libs } diff --git a/src/librustc/metadata/decoder.rs b/src/librustc/metadata/decoder.rs index 7415b576f76..55f0ef4fd57 100644 --- a/src/librustc/metadata/decoder.rs +++ b/src/librustc/metadata/decoder.rs @@ -35,7 +35,7 @@ use util::nodemap::FnvHashMap; use std::cell::{Cell, RefCell}; use std::collections::HashMap; -use std::hash::{self, Hash, SipHasher}; +use std::hash::{Hash, SipHasher, Hasher}; use std::io::prelude::*; use std::io; use std::rc::Rc; @@ -89,9 +89,9 @@ pub fn maybe_find_item<'a>(item_id: ast::NodeId, fn eq_item(bytes: &[u8], item_id: ast::NodeId) -> bool { u32_from_be_bytes(bytes) == item_id } - lookup_hash(items, - |a| eq_item(a, item_id), - hash::hash::<i64, SipHasher>(&(item_id as i64))) + let mut s = SipHasher::new_with_keys(0, 0); + (item_id as i64).hash(&mut s); + lookup_hash(items, |a| eq_item(a, item_id), s.finish()) } fn find_item<'a>(item_id: ast::NodeId, items: rbml::Doc<'a>) -> rbml::Doc<'a> { |
