Skip to content

Commit 33e2c97

Browse files
committed
Merge branch 'incoming' into removing
2 parents 2dcb3ed + f1b05ec commit 33e2c97

Some content is hidden

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

93 files changed

+624
-583
lines changed

configure

+1-1
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ then
515515
| cut -d ' ' -f 2)
516516

517517
case $CFG_CLANG_VERSION in
518-
(3.0svn | 3.0 | 3.1* | 3.2* | 4.0* | 4.1*)
518+
(3.0svn | 3.0 | 3.1* | 3.2* | 4.0* | 4.1* | 4.2*)
519519
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
520520
CFG_C_COMPILER="clang"
521521
;;

src/libcargo/cargo.rc

+9-9
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ pub fn configure(opts: Options) -> Cargo {
731731
need_dir(&c.bindir);
732732

733733
for sources.each_key_ref |&k| {
734-
let mut s = sources.get(k);
734+
let mut s = sources.get(&k);
735735
load_source_packages(&c, s);
736736
sources.insert(k, s);
737737
}
@@ -981,7 +981,7 @@ pub fn install_named(c: &mut Cargo, wd: &Path, name: ~str) {
981981

982982
pub fn install_uuid_specific(c: &mut Cargo, wd: &Path, src: ~str,
983983
uuid: ~str) {
984-
match c.sources.find(src) {
984+
match c.sources.find(&src) {
985985
Some(s) => {
986986
for s.packages.each |p| {
987987
if p.uuid == uuid {
@@ -997,7 +997,7 @@ pub fn install_uuid_specific(c: &mut Cargo, wd: &Path, src: ~str,
997997

998998
pub fn install_named_specific(c: &mut Cargo, wd: &Path, src: ~str,
999999
name: ~str) {
1000-
match c.sources.find(src) {
1000+
match c.sources.find(&src) {
10011001
Some(s) => {
10021002
for s.packages.each |p| {
10031003
if p.name == name {
@@ -1064,7 +1064,7 @@ pub fn cmd_uninstall(c: &Cargo) {
10641064
}
10651065

10661066
pub fn install_query(c: &mut Cargo, wd: &Path, target: ~str) {
1067-
match c.dep_cache.find(target) {
1067+
match c.dep_cache.find(&target) {
10681068
Some(inst) => {
10691069
if inst {
10701070
return;
@@ -1156,7 +1156,7 @@ pub fn cmd_install(c: &mut Cargo) {
11561156

11571157
pub fn sync(c: &Cargo) {
11581158
for c.sources.each_key_ref |&k| {
1159-
let mut s = c.sources.get(k);
1159+
let mut s = c.sources.get(&k);
11601160
sync_one(c, s);
11611161
c.sources.insert(k, s);
11621162
}
@@ -1558,7 +1558,7 @@ pub fn cmd_list(c: &Cargo) {
15581558
if !valid_pkg_name(*name) {
15591559
error(fmt!("'%s' is an invalid source name", *name));
15601560
} else {
1561-
match c.sources.find(*name) {
1561+
match c.sources.find(name) {
15621562
Some(source) => {
15631563
print_source(source);
15641564
}
@@ -1754,7 +1754,7 @@ pub fn cmd_sources(c: &Cargo) {
17541754
return;
17551755
}
17561756

1757-
match c.sources.find(name) {
1757+
match c.sources.find(&name) {
17581758
Some(source) => {
17591759
let old = copy source.url;
17601760
let method = assume_source_method(url);
@@ -1785,7 +1785,7 @@ pub fn cmd_sources(c: &Cargo) {
17851785
return;
17861786
}
17871787

1788-
match c.sources.find(name) {
1788+
match c.sources.find(&name) {
17891789
Some(source) => {
17901790
let old = copy source.method;
17911791

@@ -1823,7 +1823,7 @@ pub fn cmd_sources(c: &Cargo) {
18231823
return;
18241824
}
18251825

1826-
match c.sources.find(name) {
1826+
match c.sources.find(&name) {
18271827
Some(source) => {
18281828
c.sources.remove(&name);
18291829
c.sources.insert(newn, source);

src/libcore/either.rs

+17
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,23 @@ pub pure fn unwrap_right<T,U>(eith: Either<T,U>) -> U {
150150
}
151151

152152
impl<T, U> Either<T, U> {
153+
#[inline(always)]
154+
fn either<V>(&self, f_left: fn(&T) -> V, f_right: fn(&U) -> V) -> V {
155+
either(f_left, f_right, self)
156+
}
157+
158+
#[inline(always)]
159+
fn flip(self) -> Either<U, T> { flip(self) }
160+
161+
#[inline(always)]
162+
fn to_result(self) -> Result<U, T> { to_result(self) }
163+
164+
#[inline(always)]
165+
fn is_left(&self) -> bool { is_left(self) }
166+
167+
#[inline(always)]
168+
fn is_right(&self) -> bool { is_right(self) }
169+
153170
#[inline(always)]
154171
fn unwrap_left(self) -> T { unwrap_left(self) }
155172

src/libcore/io.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -490,25 +490,25 @@ pub fn FILERes(f: *libc::FILE) -> FILERes {
490490
}
491491
}
492492

493-
pub fn FILE_reader(f: *libc::FILE, cleanup: bool) -> Reader {
493+
pub fn FILE_reader(f: *libc::FILE, cleanup: bool) -> @Reader {
494494
if cleanup {
495-
Wrapper { base: f, cleanup: FILERes(f) } as Reader
495+
@Wrapper { base: f, cleanup: FILERes(f) } as @Reader
496496
} else {
497-
f as Reader
497+
@f as @Reader
498498
}
499499
}
500500

501501
// FIXME (#2004): this should either be an trait-less impl, a set of
502502
// top-level functions that take a reader, or a set of default methods on
503503
// reader (which can then be called reader)
504504

505-
pub fn stdin() -> Reader {
505+
pub fn stdin() -> @Reader {
506506
unsafe {
507-
rustrt::rust_get_stdin() as Reader
507+
rustrt::rust_get_stdin() as @Reader
508508
}
509509
}
510510

511-
pub fn file_reader(path: &Path) -> Result<Reader, ~str> {
511+
pub fn file_reader(path: &Path) -> Result<@Reader, ~str> {
512512
unsafe {
513513
let f = os::as_c_charp(path.to_str(), |pathbuf| {
514514
os::as_c_charp("r", |modebuf|
@@ -555,11 +555,11 @@ impl BytesReader: Reader {
555555
fn tell(&self) -> uint { self.pos }
556556
}
557557
558-
pub pure fn with_bytes_reader<t>(bytes: &[u8], f: fn(Reader) -> t) -> t {
559-
f(BytesReader { bytes: bytes, pos: 0u } as Reader)
558+
pub pure fn with_bytes_reader<t>(bytes: &[u8], f: fn(@Reader) -> t) -> t {
559+
f(@BytesReader { bytes: bytes, pos: 0u } as @Reader)
560560
}
561561
562-
pub pure fn with_str_reader<T>(s: &str, f: fn(Reader) -> T) -> T {
562+
pub pure fn with_str_reader<T>(s: &str, f: fn(@Reader) -> T) -> T {
563563
str::byte_slice(s, |bytes| with_bytes_reader(bytes, f))
564564
}
565565

src/libcore/prelude.rs

+16-19
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,37 @@
1212

1313
/* Reexported core operators */
1414

15+
pub use either::{Either, Left, Right};
1516
pub use kinds::{Const, Copy, Owned, Durable};
16-
pub use ops::{Drop};
1717
pub use ops::{Add, Sub, Mul, Div, Modulo, Neg, Not};
1818
pub use ops::{BitAnd, BitOr, BitXor};
19+
pub use ops::{Drop};
1920
pub use ops::{Shl, Shr, Index};
2021
pub use option::{Option, Some, None};
2122
pub use result::{Result, Ok, Err};
2223

2324
/* Reexported types and traits */
2425

25-
pub use path::Path;
26+
pub use clone::Clone;
27+
pub use cmp::{Eq, Ord};
28+
pub use container::{Container, Mutable, Map, Set};
29+
pub use hash::Hash;
30+
pub use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
31+
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
32+
pub use num::Num;
2633
pub use path::GenericPath;
27-
pub use path::WindowsPath;
34+
pub use path::Path;
2835
pub use path::PosixPath;
29-
30-
pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
36+
pub use path::WindowsPath;
37+
pub use pipes::{GenericChan, GenericPort};
38+
pub use ptr::Ptr;
3139
pub use str::{StrSlice, Trimmable};
32-
pub use container::{Container, Mutable};
40+
pub use to_bytes::IterBytes;
41+
pub use to_str::ToStr;
42+
pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
3343
pub use vec::{CopyableVector, ImmutableVector};
3444
pub use vec::{ImmutableEqVector, ImmutableCopyableVector};
3545
pub use vec::{OwnedVector, OwnedCopyableVector};
36-
pub use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
37-
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
38-
pub use container::{Container, Mutable, Map, Set};
39-
pub use pipes::{GenericChan, GenericPort};
40-
41-
pub use num::Num;
42-
pub use ptr::Ptr;
43-
pub use to_str::ToStr;
44-
pub use clone::Clone;
45-
46-
pub use cmp::{Eq, Ord};
47-
pub use hash::Hash;
48-
pub use to_bytes::IterBytes;
4946

5047
/* Reexported modules */
5148

src/libcore/private.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ pub mod tests {
486486
res.recv();
487487
}
488488
489-
#[test] #[should_fail] #[ignore(cfg(windows))]
489+
#[test] #[should_fail] #[ignore(reason = "random red")]
490490
pub fn exclusive_unwrap_conflict() {
491491
let x = exclusive(~~"hello");
492492
let x2 = ~mut Some(x.clone());

src/librustc/back/link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ pub fn symbol_hash(tcx: ty::ctxt, symbol_hasher: &hash::State, t: ty::t,
596596
}
597597
598598
pub fn get_symbol_hash(ccx: @crate_ctxt, t: ty::t) -> @str {
599-
match ccx.type_hashcodes.find(t) {
599+
match ccx.type_hashcodes.find(&t) {
600600
Some(h) => h,
601601
None => {
602602
let hash = symbol_hash(ccx.tcx, ccx.symbol_hasher, t, ccx.link_meta);

src/librustc/driver/driver.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ pub fn build_session_options(+binary: ~str,
538538
getopts::opt_strs(matches, level_name));
539539
for flags.each |lint_name| {
540540
let lint_name = str::replace(*lint_name, ~"-", ~"_");
541-
match lint_dict.find(/*bad*/ copy lint_name) {
541+
match lint_dict.find(&lint_name) {
542542
None => {
543543
early_error(demitter, fmt!("unknown %s flag: %s",
544544
level_name, lint_name));

src/librustc/lib/llvm.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1331,11 +1331,11 @@ pub fn associate_type(tn: type_names, s: @str, t: TypeRef) {
13311331
}
13321332

13331333
pub fn type_has_name(tn: type_names, t: TypeRef) -> Option<@str> {
1334-
return tn.type_names.find(t);
1334+
return tn.type_names.find(&t);
13351335
}
13361336

13371337
pub fn name_has_type(tn: type_names, s: @str) -> Option<TypeRef> {
1338-
return tn.named_types.find(s);
1338+
return tn.named_types.find(&s);
13391339
}
13401340

13411341
pub fn mk_type_names() -> type_names {

src/librustc/metadata/cstore.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub fn mk_cstore(intr: @ident_interner) -> CStore {
7474

7575
pub fn get_crate_data(cstore: CStore, cnum: ast::crate_num)
7676
-> crate_metadata {
77-
return p(cstore).metas.get(cnum);
77+
return p(cstore).metas.get(&cnum);
7878
}
7979

8080
pub fn get_crate_hash(cstore: CStore, cnum: ast::crate_num) -> ~str {
@@ -139,7 +139,7 @@ pub fn add_use_stmt_cnum(cstore: CStore, use_id: ast::node_id,
139139

140140
pub fn find_use_stmt_cnum(cstore: CStore,
141141
use_id: ast::node_id) -> Option<ast::crate_num> {
142-
p(cstore).use_crate_map.find(use_id)
142+
p(cstore).use_crate_map.find(&use_id)
143143
}
144144

145145
// returns hashes of crates directly used by this crate. Hashes are

src/librustc/metadata/decoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ pub fn translate_def_id(cdata: cmd, did: ast::def_id) -> ast::def_id {
10991099
return ast::def_id { crate: cdata.cnum, node: did.node };
11001100
}
11011101

1102-
match cdata.cnum_map.find(did.crate) {
1102+
match cdata.cnum_map.find(&did.crate) {
11031103
option::Some(n) => ast::def_id { crate: n, node: did.node },
11041104
option::None => die!(~"didn't find a crate in the cnum_map")
11051105
}

src/librustc/metadata/encoder.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ pub fn encode_def_id(ebml_w: writer::Encoder, id: def_id) {
118118

119119
fn encode_region_param(ecx: @encode_ctxt, ebml_w: writer::Encoder,
120120
it: @ast::item) {
121-
let opt_rp = ecx.tcx.region_paramd_items.find(it.id);
121+
let opt_rp = ecx.tcx.region_paramd_items.find(&it.id);
122122
for opt_rp.each |rp| {
123123
do ebml_w.wr_tag(tag_region_param) {
124124
(*rp).encode(&ebml_w);
@@ -184,7 +184,7 @@ fn encode_ty_type_param_bounds(ebml_w: writer::Encoder, ecx: @encode_ctxt,
184184
fn encode_type_param_bounds(ebml_w: writer::Encoder, ecx: @encode_ctxt,
185185
params: &[ty_param]) {
186186
let ty_param_bounds =
187-
@params.map(|param| ecx.tcx.ty_param_bounds.get(param.id));
187+
@params.map(|param| ecx.tcx.ty_param_bounds.get(&param.id));
188188
encode_ty_type_param_bounds(ebml_w, ecx, ty_param_bounds);
189189
}
190190

@@ -224,7 +224,7 @@ fn encode_type(ecx: @encode_ctxt, ebml_w: writer::Encoder, typ: ty::t) {
224224

225225
fn encode_symbol(ecx: @encode_ctxt, ebml_w: writer::Encoder, id: node_id) {
226226
ebml_w.start_tag(tag_items_data_item_symbol);
227-
let sym = match ecx.item_symbols.find(id) {
227+
let sym = match ecx.item_symbols.find(&id) {
228228
Some(ref x) => (/*bad*/copy *x),
229229
None => {
230230
ecx.diag.handler().bug(
@@ -238,7 +238,7 @@ fn encode_symbol(ecx: @encode_ctxt, ebml_w: writer::Encoder, id: node_id) {
238238
fn encode_discriminant(ecx: @encode_ctxt, ebml_w: writer::Encoder,
239239
id: node_id) {
240240
ebml_w.start_tag(tag_items_data_item_symbol);
241-
ebml_w.writer.write(str::to_bytes(ecx.discrim_symbols.get(id)));
241+
ebml_w.writer.write(str::to_bytes(ecx.discrim_symbols.get(&id)));
242242
ebml_w.end_tag();
243243
}
244244

@@ -349,7 +349,7 @@ fn encode_info_for_mod(ecx: @encode_ctxt, ebml_w: writer::Encoder,
349349

350350
// Encode the reexports of this module.
351351
debug!("(encoding info for module) encoding reexports for %d", id);
352-
match ecx.reexports2.find(id) {
352+
match ecx.reexports2.find(&id) {
353353
Some(ref exports) => {
354354
debug!("(encoding info for module) found reexports for %d", id);
355355
for (*exports).each |exp| {
@@ -813,7 +813,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: writer::Encoder,
813813
encode_name(ecx, ebml_w, ty_m.ident);
814814
encode_family(ebml_w,
815815
purity_static_method_family(ty_m.purity));
816-
let polyty = ecx.tcx.tcache.get(local_def(ty_m.id));
816+
let polyty = ecx.tcx.tcache.get(&local_def(ty_m.id));
817817
encode_ty_type_param_bounds(ebml_w, ecx, polyty.bounds);
818818
encode_type(ecx, ebml_w, polyty.ty);
819819
let mut m_path = vec::append(~[], path); // :-(
@@ -881,7 +881,7 @@ fn encode_info_for_items(ecx: @encode_ctxt, ebml_w: writer::Encoder,
881881
let ebml_w = copy ebml_w;
882882
|i, cx, v| {
883883
visit::visit_item(i, cx, v);
884-
match ecx.tcx.items.get(i.id) {
884+
match ecx.tcx.items.get(&i.id) {
885885
ast_map::node_item(_, pt) => {
886886
encode_info_for_item(ecx, ebml_w, i,
887887
index, *pt);
@@ -894,7 +894,7 @@ fn encode_info_for_items(ecx: @encode_ctxt, ebml_w: writer::Encoder,
894894
let ebml_w = copy ebml_w;
895895
|ni, cx, v| {
896896
visit::visit_foreign_item(ni, cx, v);
897-
match ecx.tcx.items.get(ni.id) {
897+
match ecx.tcx.items.get(&ni.id) {
898898
ast_map::node_foreign_item(_, abi, pt) => {
899899
encode_info_for_foreign_item(ecx, ebml_w, ni,
900900
index, /*bad*/copy *pt,

src/librustc/metadata/tydecode.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ fn parse_ty(st: @pstate, conv: conv_did) -> ty::t {
329329
let len = parse_hex(st);
330330
assert (next(st) == '#');
331331
let key = creader_cache_key { cnum: st.crate, pos: pos, len: len };
332-
match st.tcx.rcache.find(key) {
332+
match st.tcx.rcache.find(&key) {
333333
Some(tt) => return tt,
334334
None => {
335335
let ps = @{pos: pos ,.. copy *st};

src/librustc/metadata/tyencode.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn cx_uses_abbrevs(cx: @ctxt) -> bool {
5656
pub fn enc_ty(w: io::Writer, cx: @ctxt, t: ty::t) {
5757
match cx.abbrevs {
5858
ac_no_abbrevs => {
59-
let result_str = match cx.tcx.short_names_cache.find(t) {
59+
let result_str = match cx.tcx.short_names_cache.find(&t) {
6060
Some(s) => /*bad*/copy *s,
6161
None => {
6262
let s = do io::with_str_writer |wr| {
@@ -69,7 +69,7 @@ pub fn enc_ty(w: io::Writer, cx: @ctxt, t: ty::t) {
6969
w.write_str(result_str);
7070
}
7171
ac_use_abbrevs(abbrevs) => {
72-
match abbrevs.find(t) {
72+
match abbrevs.find(&t) {
7373
Some(a) => { w.write_str(*a.s); return; }
7474
None => {
7575
let pos = w.tell();

0 commit comments

Comments
 (0)