Skip to content

Commit 2198e0a

Browse files
committed
---
yaml --- r: 93294 b: refs/heads/try c: 72557d8 h: refs/heads/master v: v3
1 parent ecfb982 commit 2198e0a

File tree

24 files changed

+541
-683
lines changed

24 files changed

+541
-683
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 0a9a706b20ee43c601c2c70d62059610d40198fe
5+
refs/heads/try: 72557d83124aac4a362b99cbdb31a00f46be4bae
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use util::logv;
2323
use std::cell::Cell;
2424
use std::rt::io;
2525
use std::rt::io::Writer;
26-
use std::rt::io::extensions::ReaderUtil;
26+
use std::rt::io::Reader;
2727
use std::rt::io::file::FileInfo;
2828
use std::os;
2929
use std::str;

branches/try/src/libextra/json.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use std::f64;
2222
use std::hashmap::HashMap;
2323
use std::rt::io;
2424
use std::rt::io::Decorator;
25-
use std::rt::io::extensions::ReaderUtil;
2625
use std::rt::io::mem::MemWriter;
2726
use std::num;
2827
use std::str;
@@ -843,7 +842,7 @@ impl<T : Iterator<char>> Parser<T> {
843842
}
844843

845844
/// Decodes a json value from an `&mut io::Reader`
846-
pub fn from_reader(mut rdr: &mut io::Reader) -> Result<Json, Error> {
845+
pub fn from_reader(rdr: &mut io::Reader) -> Result<Json, Error> {
847846
let s = str::from_utf8(rdr.read_to_end());
848847
let mut parser = Parser(~s.iter());
849848
parser.parse()

branches/try/src/libextra/terminfo/parser/compiled.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use std::{vec, str};
1717
use std::hashmap::HashMap;
1818
use std::rt::io;
19-
use std::rt::io::extensions::{ReaderByteConversions, ReaderUtil};
2019
use super::super::TermInfo;
2120

2221
// These are the orders ncurses uses in its compiled format (as of 5.9). Not sure if portable.
@@ -161,7 +160,7 @@ pub static stringnames: &'static[&'static str] = &'static[ "cbt", "_", "cr", "cs
161160
"box1"];
162161

163162
/// Parse a compiled terminfo entry, using long capability names if `longnames` is true
164-
pub fn parse(mut file: &mut io::Reader,
163+
pub fn parse(file: &mut io::Reader,
165164
longnames: bool) -> Result<~TermInfo, ~str> {
166165
let bnames;
167166
let snames;
@@ -178,17 +177,17 @@ pub fn parse(mut file: &mut io::Reader,
178177
}
179178

180179
// Check magic number
181-
let magic = file.read_le_u16_();
180+
let magic = file.read_le_u16();
182181
if (magic != 0x011A) {
183182
return Err(format!("invalid magic number: expected {:x} but found {:x}",
184183
0x011A, magic as uint));
185184
}
186185

187-
let names_bytes = file.read_le_i16_() as int;
188-
let bools_bytes = file.read_le_i16_() as int;
189-
let numbers_count = file.read_le_i16_() as int;
190-
let string_offsets_count = file.read_le_i16_() as int;
191-
let string_table_bytes = file.read_le_i16_() as int;
186+
let names_bytes = file.read_le_i16() as int;
187+
let bools_bytes = file.read_le_i16() as int;
188+
let numbers_count = file.read_le_i16() as int;
189+
let string_offsets_count = file.read_le_i16() as int;
190+
let string_table_bytes = file.read_le_i16() as int;
192191

193192
assert!(names_bytes > 0);
194193

@@ -247,7 +246,7 @@ pub fn parse(mut file: &mut io::Reader,
247246
let mut numbers_map = HashMap::new();
248247
if numbers_count != 0 {
249248
for i in range(0, numbers_count) {
250-
let n = file.read_le_u16_();
249+
let n = file.read_le_u16();
251250
if n != 0xFFFF {
252251
debug!("{}\\#{}", nnames[i], n);
253252
numbers_map.insert(nnames[i].to_owned(), n);
@@ -262,7 +261,7 @@ pub fn parse(mut file: &mut io::Reader,
262261
if string_offsets_count != 0 {
263262
let mut string_offsets = vec::with_capacity(10);
264263
for _ in range(0, string_offsets_count) {
265-
string_offsets.push(file.read_le_u16_());
264+
string_offsets.push(file.read_le_u16());
266265
}
267266

268267
debug!("offsets: {:?}", string_offsets);

branches/try/src/libextra/workcache.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use std::comm::{PortOne, oneshot};
2020
use std::{os, str, task};
2121
use std::rt::io;
2222
use std::rt::io::Writer;
23+
use std::rt::io::Reader;
2324
use std::rt::io::Decorator;
2425
use std::rt::io::mem::MemWriter;
2526
use std::rt::io::file::FileInfo;
@@ -481,7 +482,7 @@ impl<'self, T:Send +
481482
#[test]
482483
fn test() {
483484
use std::{os, run};
484-
use std::rt::io::ReaderUtil;
485+
use std::rt::io::Reader;
485486
use std::str::from_utf8_owned;
486487

487488
// Create a path to a new file 'filename' in the directory in which

branches/try/src/librustc/driver/driver.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -757,9 +757,7 @@ pub fn build_session_options(binary: @str,
757757

758758
let statik = debugging_opts & session::statik != 0;
759759

760-
let addl_lib_search_paths = matches.opt_strs("L").map(|s| {
761-
Path::new(s.as_slice())
762-
}).move_iter().collect();
760+
let addl_lib_search_paths = matches.opt_strs("L").map(|s| Path::new(s.as_slice()));
763761
let linker = matches.opt_str("linker");
764762
let linker_args = matches.opt_strs("link-args").flat_map( |a| {
765763
a.split_iter(' ').map(|arg| arg.to_owned()).collect()

branches/try/src/librustc/driver/session.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use syntax::parse::token;
2929
use syntax;
3030

3131
use std::int;
32-
use std::hashmap::{HashMap,HashSet};
32+
use std::hashmap::HashMap;
3333

3434
#[deriving(Eq)]
3535
pub enum Os { OsWin32, OsMacos, OsLinux, OsAndroid, OsFreebsd, }
@@ -158,9 +158,9 @@ pub struct options {
158158
save_temps: bool,
159159
jit: bool,
160160
output_type: back::link::output_type,
161-
addl_lib_search_paths: @mut HashSet<Path>, // This is mutable for rustpkg, which
162-
// updates search paths based on the
163-
// parsed code
161+
addl_lib_search_paths: @mut ~[Path], // This is mutable for rustpkg, which
162+
// updates search paths based on the
163+
// parsed code
164164
linker: Option<~str>,
165165
linker_args: ~[~str],
166166
maybe_sysroot: Option<@Path>,
@@ -366,7 +366,7 @@ pub fn basic_options() -> @options {
366366
save_temps: false,
367367
jit: false,
368368
output_type: link::output_type_exe,
369-
addl_lib_search_paths: @mut HashSet::new(),
369+
addl_lib_search_paths: @mut ~[],
370370
linker: None,
371371
linker_args: ~[],
372372
maybe_sysroot: None,

branches/try/src/librustc/metadata/encoder.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use middle::typeck;
2222
use middle;
2323

2424
use std::hashmap::{HashMap, HashSet};
25-
use std::rt::io::extensions::WriterByteConversions;
2625
use std::rt::io::{Writer, Seek, Decorator};
2726
use std::rt::io::mem::MemWriter;
2827
use std::str;
@@ -894,11 +893,11 @@ fn encode_info_for_item(ecx: &EncodeContext,
894893
vis: ast::visibility) {
895894
let tcx = ecx.tcx;
896895

897-
fn add_to_index_(item: @item, ebml_w: &writer::Encoder,
896+
fn add_to_index(item: @item, ebml_w: &writer::Encoder,
898897
index: @mut ~[entry<i64>]) {
899898
index.push(entry { val: item.id as i64, pos: ebml_w.writer.tell() });
900899
}
901-
let add_to_index: &fn() = || add_to_index_(item, ebml_w, index);
900+
let add_to_index: &fn() = || add_to_index(item, ebml_w, index);
902901

903902
debug!("encoding info for item at {}",
904903
ecx.tcx.sess.codemap.span_to_str(item.span));
@@ -1411,7 +1410,7 @@ fn encode_index<T:'static>(
14111410
assert!(elt.pos < 0xffff_ffff);
14121411
{
14131412
let wr: &mut MemWriter = ebml_w.writer;
1414-
wr.write_be_u32_(elt.pos as u32);
1413+
wr.write_be_u32(elt.pos as u32);
14151414
}
14161415
write_fn(ebml_w.writer, &elt.val);
14171416
ebml_w.end_tag();
@@ -1423,7 +1422,7 @@ fn encode_index<T:'static>(
14231422
for pos in bucket_locs.iter() {
14241423
assert!(*pos < 0xffff_ffff);
14251424
let wr: &mut MemWriter = ebml_w.writer;
1426-
wr.write_be_u32_(*pos as u32);
1425+
wr.write_be_u32(*pos as u32);
14271426
}
14281427
ebml_w.end_tag();
14291428
ebml_w.end_tag();
@@ -1436,7 +1435,7 @@ fn write_str(writer: @mut MemWriter, s: ~str) {
14361435
fn write_i64(writer: @mut MemWriter, &n: &i64) {
14371436
let wr: &mut MemWriter = writer;
14381437
assert!(n < 0x7fff_ffff);
1439-
wr.write_be_u32_(n as u32);
1438+
wr.write_be_u32(n as u32);
14401439
}
14411440

14421441
fn encode_meta_item(ebml_w: &mut writer::Encoder, mi: @MetaItem) {
@@ -1591,14 +1590,14 @@ fn encode_lang_items(ecx: &EncodeContext, ebml_w: &mut writer::Encoder) {
15911590
ebml_w.start_tag(tag_lang_items_item_id);
15921591
{
15931592
let wr: &mut MemWriter = ebml_w.writer;
1594-
wr.write_be_u32_(i as u32);
1593+
wr.write_be_u32(i as u32);
15951594
}
15961595
ebml_w.end_tag(); // tag_lang_items_item_id
15971596

15981597
ebml_w.start_tag(tag_lang_items_item_node_id);
15991598
{
16001599
let wr: &mut MemWriter = ebml_w.writer;
1601-
wr.write_be_u32_(id.node as u32);
1600+
wr.write_be_u32(id.node as u32);
16021601
}
16031602
ebml_w.end_tag(); // tag_lang_items_item_node_id
16041603

branches/try/src/librustc/metadata/filesearch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ pub trait FileSearch {
4040

4141
pub fn mk_filesearch(maybe_sysroot: &Option<@Path>,
4242
target_triple: &str,
43-
addl_lib_search_paths: @mut HashSet<Path>)
43+
addl_lib_search_paths: @mut ~[Path])
4444
-> @FileSearch {
4545
struct FileSearchImpl {
4646
sysroot: @Path,
47-
addl_lib_search_paths: @mut HashSet<Path>,
47+
addl_lib_search_paths: @mut ~[Path],
4848
target_triple: ~str
4949
}
5050
impl FileSearch for FileSearchImpl {

branches/try/src/librustc/rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use middle::lint;
3737

3838
use std::comm;
3939
use std::rt::io;
40-
use std::rt::io::extensions::ReaderUtil;
40+
use std::rt::io::Reader;
4141
use std::num;
4242
use std::os;
4343
use std::result;

branches/try/src/librustdoc/core.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use syntax;
2020

2121
use std::os;
2222
use std::local_data;
23-
use std::hashmap::{HashMap,HashSet};
23+
use std::hashmap::HashMap;
2424

2525
use visit_ast::RustdocVisitor;
2626
use clean;
@@ -39,7 +39,7 @@ pub struct CrateAnalysis {
3939

4040
/// Parses, resolves, and typechecks the given crate
4141
fn get_ast_and_resolve(cpath: &Path,
42-
libs: HashSet<Path>) -> (DocContext, CrateAnalysis) {
42+
libs: ~[Path]) -> (DocContext, CrateAnalysis) {
4343
use syntax::codemap::dummy_spanned;
4444
use rustc::driver::driver::{file_input, build_configuration,
4545
phase_1_parse_input,
@@ -89,7 +89,7 @@ fn get_ast_and_resolve(cpath: &Path,
8989
CrateAnalysis { reexports: reexports, exported_items: exported_items });
9090
}
9191

92-
pub fn run_core (libs: HashSet<Path>, path: &Path) -> (clean::Crate, CrateAnalysis) {
92+
pub fn run_core (libs: ~[Path], path: &Path) -> (clean::Crate, CrateAnalysis) {
9393
let (ctxt, analysis) = get_ast_and_resolve(path, libs);
9494
let ctxt = @ctxt;
9595
debug!("defmap:");

branches/try/src/librustdoc/rustdoc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
198198
info!("starting to run rustc");
199199
let (crate, analysis) = do std::task::try {
200200
let cr = cr.take();
201-
core::run_core(libs.take().move_iter().collect(), &cr)
201+
core::run_core(libs.take(), &cr)
202202
}.unwrap();
203203
info!("finished with rustc");
204204
local_data::set(analysiskey, analysis);

branches/try/src/librustpkg/context.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010

1111
// Context data structure used by rustpkg
1212

13+
use std::os;
1314
use extra::workcache;
1415
use rustc::driver::session::{OptLevel, No};
1516

16-
use std::hashmap::HashSet;
17-
use std::os;
18-
1917
#[deriving(Clone)]
2018
pub struct Context {
2119
// Config strings that the user passed in with --cfg
@@ -62,7 +60,7 @@ impl BuildContext {
6260
self.context.add_library_path(p);
6361
}
6462

65-
pub fn additional_library_paths(&self) -> HashSet<Path> {
63+
pub fn additional_library_paths(&self) -> ~[Path] {
6664
self.context.rustc_flags.additional_library_paths.clone()
6765
}
6866
}
@@ -98,7 +96,7 @@ pub struct RustcFlags {
9896
target_cpu: Option<~str>,
9997
// Additional library directories, which get passed with the -L flag
10098
// This can't be set with a rustpkg flag, only from package scripts
101-
additional_library_paths: HashSet<Path>,
99+
additional_library_paths: ~[Path],
102100
// Any -Z features
103101
experimental_features: Option<~[~str]>
104102
}
@@ -165,7 +163,7 @@ impl Context {
165163
}
166164

167165
pub fn add_library_path(&mut self, p: Path) {
168-
self.rustc_flags.additional_library_paths.insert(p);
166+
self.rustc_flags.additional_library_paths.push(p);
169167
}
170168
}
171169

@@ -229,7 +227,7 @@ impl RustcFlags {
229227
save_temps: false,
230228
target: None,
231229
target_cpu: None,
232-
additional_library_paths: HashSet::new(),
230+
additional_library_paths: ~[],
233231
experimental_features: None
234232
}
235233
}

branches/try/src/librustpkg/rustpkg.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ extern mod rustc;
2525
extern mod syntax;
2626

2727
use std::{os, result, run, str, task};
28-
use std::hashmap::HashSet;
2928
pub use std::path::Path;
3029

3130
use extra::workcache;
@@ -842,8 +841,7 @@ pub fn main_args(args: &[~str]) -> int {
842841
save_temps: save_temps,
843842
target: target,
844843
target_cpu: target_cpu,
845-
additional_library_paths:
846-
HashSet::new(), // No way to set this from the rustpkg command line
844+
additional_library_paths: ~[], // No way to set this from the rustpkg command line
847845
experimental_features: experimental_features
848846
};
849847

branches/try/src/librustpkg/util.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,11 @@ pub fn compile_input(context: &BuildContext,
285285
debug!("a dependency: {}", p.display());
286286
// Pass the directory containing a dependency
287287
// as an additional lib search path
288-
addl_lib_search_paths.insert(p);
288+
if !addl_lib_search_paths.contains(&p) {
289+
// Might be inefficient, but this set probably
290+
// won't get too large -- tjc
291+
addl_lib_search_paths.push(p);
292+
}
289293
});
290294

291295
// Inject the link attributes so we get the right package name and version

branches/try/src/librustpkg/workcache_support.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use std::rt::io;
12-
use std::rt::io::extensions::ReaderUtil;
12+
use std::rt::io::Reader;
1313
use std::rt::io::file::FileInfo;
1414
use extra::workcache;
1515
use sha1::{Digest, Sha1};

branches/try/src/libstd/rand/reader.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
1313
use option::{Some, None};
1414
use rt::io::Reader;
15-
use rt::io::ReaderByteConversions;
1615

1716
use rand::Rng;
1817

@@ -51,17 +50,17 @@ impl<R: Reader> Rng for ReaderRng<R> {
5150
// platform just involves blitting the bytes into the memory
5251
// of the u32, similarly for BE on BE; avoiding byteswapping.
5352
if cfg!(target_endian="little") {
54-
self.reader.read_le_u32_()
53+
self.reader.read_le_u32()
5554
} else {
56-
self.reader.read_be_u32_()
55+
self.reader.read_be_u32()
5756
}
5857
}
5958
fn next_u64(&mut self) -> u64 {
6059
// see above for explanation.
6160
if cfg!(target_endian="little") {
62-
self.reader.read_le_u64_()
61+
self.reader.read_le_u64()
6362
} else {
64-
self.reader.read_be_u64_()
63+
self.reader.read_be_u64()
6564
}
6665
}
6766
fn fill_bytes(&mut self, v: &mut [u8]) {

0 commit comments

Comments
 (0)