Skip to content

Commit a5f69c9

Browse files
committed
---
yaml --- r: 146256 b: refs/heads/try2 c: 17b87d2 h: refs/heads/master v: v3
1 parent 4ba70c8 commit a5f69c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1628
-2091
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: c0222cda27d0a1a06e7f227dfb1f0f6f87d2e742
8+
refs/heads/try2: 17b87d20304db1e8727754b7ef900dc3c986d878
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/rt.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ RUNTIME_CXXS_$(1)_$(2) := \
8989
rt/rust_upcall.cpp \
9090
rt/rust_uv.cpp \
9191
rt/miniz.cpp \
92+
rt/memory_region.cpp \
93+
rt/boxed_region.cpp \
9294
rt/rust_android_dummy.cpp \
9395
rt/rust_test_helpers.cpp
9496

branches/try2/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::Reader;
26+
use std::rt::io::extensions::ReaderUtil;
2727
use std::rt::io::file::FileInfo;
2828
use std::os;
2929
use std::str;

branches/try2/src/libextra/json.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ 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;
2526
use std::rt::io::mem::MemWriter;
2627
use std::num;
2728
use std::str;
@@ -842,7 +843,7 @@ impl<T : Iterator<char>> Parser<T> {
842843
}
843844

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

branches/try2/src/libextra/sync.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ mod tests {
918918
let m = Mutex::new();
919919
let m2 = m.clone();
920920

921-
let result: result::Result<(), ~Any> = do task::try {
921+
let result: result::Result<(),()> = do task::try {
922922
do m2.lock {
923923
fail!();
924924
}
@@ -935,7 +935,7 @@ mod tests {
935935
let m = Mutex::new();
936936
let m2 = m.clone();
937937

938-
let result: result::Result<(), ~Any> = do task::try {
938+
let result: result::Result<(),()> = do task::try {
939939
let (p, c) = comm::stream();
940940
do task::spawn || { // linked
941941
let _ = p.recv(); // wait for sibling to get in the mutex
@@ -963,7 +963,7 @@ mod tests {
963963
let m2 = m.clone();
964964
let (p, c) = comm::stream();
965965

966-
let result: result::Result<(), ~Any> = do task::try {
966+
let result: result::Result<(),()> = do task::try {
967967
let mut sibling_convos = ~[];
968968
do 2.times {
969969
let (p, c) = comm::stream();
@@ -1272,7 +1272,7 @@ mod tests {
12721272
let x = RWLock::new();
12731273
let x2 = x.clone();
12741274

1275-
let result: result::Result<(), ~Any> = do task::try || {
1275+
let result: result::Result<(),()> = do task::try || {
12761276
do lock_rwlock_in_mode(&x2, mode1) {
12771277
fail!();
12781278
}

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

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

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

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

179180
// Check magic number
180-
let magic = file.read_le_u16();
181+
let magic = file.read_le_u16_();
181182
if (magic != 0x011A) {
182183
return Err(format!("invalid magic number: expected {:x} but found {:x}",
183184
0x011A, magic as uint));
184185
}
185186

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;
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;
191192

192193
assert!(names_bytes > 0);
193194

@@ -246,7 +247,7 @@ pub fn parse(file: &mut io::Reader,
246247
let mut numbers_map = HashMap::new();
247248
if numbers_count != 0 {
248249
for i in range(0, numbers_count) {
249-
let n = file.read_le_u16();
250+
let n = file.read_le_u16_();
250251
if n != 0xFFFF {
251252
debug!("{}\\#{}", nnames[i], n);
252253
numbers_map.insert(nnames[i].to_owned(), n);
@@ -261,7 +262,7 @@ pub fn parse(file: &mut io::Reader,
261262
if string_offsets_count != 0 {
262263
let mut string_offsets = vec::with_capacity(10);
263264
for _ in range(0, string_offsets_count) {
264-
string_offsets.push(file.read_le_u16());
265+
string_offsets.push(file.read_le_u16_());
265266
}
266267

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

branches/try2/src/libextra/test.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,8 @@ pub fn run_test(force_ignore: bool,
873873
task.spawn(testfn_cell.take());
874874

875875
let task_result = result_future.recv();
876-
let test_result = calc_result(&desc, task_result.is_ok());
876+
let test_result = calc_result(&desc,
877+
task_result == task::Success);
877878
monitor_ch.send((desc.clone(), test_result));
878879
}
879880
}

branches/try2/src/libextra/workcache.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ 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;
2423
use std::rt::io::Decorator;
2524
use std::rt::io::mem::MemWriter;
2625
use std::rt::io::file::FileInfo;
@@ -482,7 +481,7 @@ impl<'self, T:Send +
482481
#[test]
483482
fn test() {
484483
use std::{os, run};
485-
use std::rt::io::Reader;
484+
use std::rt::io::ReaderUtil;
486485
use std::str::from_utf8_owned;
487486

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

branches/try2/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/try2/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/try2/src/librustc/metadata/encoder.rs

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

2424
use std::hashmap::{HashMap, HashSet};
25+
use std::rt::io::extensions::WriterByteConversions;
2526
use std::rt::io::{Writer, Seek, Decorator};
2627
use std::rt::io::mem::MemWriter;
2728
use std::str;
@@ -893,11 +894,11 @@ fn encode_info_for_item(ecx: &EncodeContext,
893894
vis: ast::visibility) {
894895
let tcx = ecx.tcx;
895896

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

902903
debug!("encoding info for item at {}",
903904
ecx.tcx.sess.codemap.span_to_str(item.span));
@@ -1410,7 +1411,7 @@ fn encode_index<T:'static>(
14101411
assert!(elt.pos < 0xffff_ffff);
14111412
{
14121413
let wr: &mut MemWriter = ebml_w.writer;
1413-
wr.write_be_u32(elt.pos as u32);
1414+
wr.write_be_u32_(elt.pos as u32);
14141415
}
14151416
write_fn(ebml_w.writer, &elt.val);
14161417
ebml_w.end_tag();
@@ -1422,7 +1423,7 @@ fn encode_index<T:'static>(
14221423
for pos in bucket_locs.iter() {
14231424
assert!(*pos < 0xffff_ffff);
14241425
let wr: &mut MemWriter = ebml_w.writer;
1425-
wr.write_be_u32(*pos as u32);
1426+
wr.write_be_u32_(*pos as u32);
14261427
}
14271428
ebml_w.end_tag();
14281429
ebml_w.end_tag();
@@ -1435,7 +1436,7 @@ fn write_str(writer: @mut MemWriter, s: ~str) {
14351436
fn write_i64(writer: @mut MemWriter, &n: &i64) {
14361437
let wr: &mut MemWriter = writer;
14371438
assert!(n < 0x7fff_ffff);
1438-
wr.write_be_u32(n as u32);
1439+
wr.write_be_u32_(n as u32);
14391440
}
14401441

14411442
fn encode_meta_item(ebml_w: &mut writer::Encoder, mi: @MetaItem) {
@@ -1590,14 +1591,14 @@ fn encode_lang_items(ecx: &EncodeContext, ebml_w: &mut writer::Encoder) {
15901591
ebml_w.start_tag(tag_lang_items_item_id);
15911592
{
15921593
let wr: &mut MemWriter = ebml_w.writer;
1593-
wr.write_be_u32(i as u32);
1594+
wr.write_be_u32_(i as u32);
15941595
}
15951596
ebml_w.end_tag(); // tag_lang_items_item_id
15961597

15971598
ebml_w.start_tag(tag_lang_items_item_node_id);
15981599
{
15991600
let wr: &mut MemWriter = ebml_w.writer;
1600-
wr.write_be_u32(id.node as u32);
1601+
wr.write_be_u32_(id.node as u32);
16011602
}
16021603
ebml_w.end_tag(); // tag_lang_items_item_node_id
16031604

branches/try2/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/try2/src/librustc/middle/trans/base.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2844,8 +2844,6 @@ pub fn declare_intrinsics(llmod: ModuleRef) -> HashMap<&'static str, ValueRef> {
28442844
ifn!(intrinsics, "llvm.umul.with.overflow.i64",
28452845
[Type::i64(), Type::i64()], Type::struct_([Type::i64(), Type::i1()], false));
28462846

2847-
ifn!(intrinsics, "llvm.expect.i1", [Type::i1(), Type::i1()], Type::i1());
2848-
28492847
return intrinsics;
28502848
}
28512849

branches/try2/src/librustc/middle/trans/common.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ pub fn type_is_immediate(ccx: &mut CrateContext, ty: ty::t) -> bool {
7070
return true;
7171
}
7272
match ty::get(ty).sty {
73-
ty::ty_bot => true,
7473
ty::ty_struct(*) | ty::ty_enum(*) | ty::ty_tup(*) => {
7574
let llty = sizing_type_of(ccx, ty);
7675
llsize_of_alloc(ccx, llty) <= llsize_of_alloc(ccx, ccx.int_type)

branches/try2/src/librustc/middle/trans/expr.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -981,9 +981,7 @@ fn trans_lvalue_unadjusted(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock {
981981
debug!("trans_index: len {}", bcx.val_to_str(len));
982982

983983
let bounds_check = ICmp(bcx, lib::llvm::IntUGE, ix_val, len);
984-
let expect = ccx.intrinsics.get_copy(&("llvm.expect.i1"));
985-
let expected = Call(bcx, expect, [bounds_check, C_i1(false)], []);
986-
let bcx = do with_cond(bcx, expected) |bcx| {
984+
let bcx = do with_cond(bcx, bounds_check) |bcx| {
987985
controlflow::trans_fail_bounds_check(bcx, index_expr.span, ix_val, len)
988986
};
989987
let elt = InBoundsGEP(bcx, base, [ix_val]);

branches/try2/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::Reader;
40+
use std::rt::io::extensions::ReaderUtil;
4141
use std::num;
4242
use std::os;
4343
use std::result;

branches/try2/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/try2/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);

0 commit comments

Comments
 (0)