Skip to content

Commit 4d72b43

Browse files
committed
---
yaml --- r: 42947 b: refs/heads/try c: 9adfa59 h: refs/heads/master i: 42945: 75e6c42 42943: cede17b v: v3
1 parent bf8905d commit 4d72b43

Some content is hidden

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

99 files changed

+568
-555
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: 19dfec2aaf746535de1521f68421f9980dbf25de
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
5-
refs/heads/try: 8e643525d4e5bca993dada43615916c382a0645b
5+
refs/heads/try: 9adfa59d8e9432eef84297b6ed5d8f2967b9b8f9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/src/libcargo/cargo.rc

Lines changed: 9 additions & 9 deletions
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);

branches/try/src/libcore/num/f32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ pub pure fn to_str_digits(num: f32, dig: uint) -> ~str {
439439

440440
impl f32: to_str::ToStr {
441441
#[inline(always)]
442-
pure fn to_str() -> ~str { to_str_digits(self, 8) }
442+
pure fn to_str(&self) -> ~str { to_str_digits(*self, 8) }
443443
}
444444

445445
impl f32: num::ToStrRadix {

branches/try/src/libcore/num/f64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ pub pure fn to_str_digits(num: f64, dig: uint) -> ~str {
463463

464464
impl f64: to_str::ToStr {
465465
#[inline(always)]
466-
pure fn to_str() -> ~str { to_str_digits(self, 8) }
466+
pure fn to_str(&self) -> ~str { to_str_digits(*self, 8) }
467467
}
468468

469469
impl f64: num::ToStrRadix {

branches/try/src/libcore/num/float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ pub pure fn to_str_digits(num: float, digits: uint) -> ~str {
206206
207207
impl float: to_str::ToStr {
208208
#[inline(always)]
209-
pure fn to_str() -> ~str { to_str_digits(self, 8) }
209+
pure fn to_str(&self) -> ~str { to_str_digits(*self, 8) }
210210
}
211211
212212
impl float: num::ToStrRadix {

branches/try/src/libcore/num/int-template.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ pub pure fn str(i: T) -> ~str { to_str(i) }
287287
288288
impl T : ToStr {
289289
#[inline(always)]
290-
pure fn to_str() -> ~str {
291-
to_str(self)
290+
pure fn to_str(&self) -> ~str {
291+
to_str(*self)
292292
}
293293
}
294294

branches/try/src/libcore/num/uint-template.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ pub pure fn str(i: T) -> ~str { to_str(i) }
249249
250250
impl T : ToStr {
251251
#[inline(always)]
252-
pure fn to_str() -> ~str {
253-
to_str(self)
252+
pure fn to_str(&self) -> ~str {
253+
to_str(*self)
254254
}
255255
}
256256

branches/try/src/libcore/path.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ impl Path {
368368
}
369369

370370
impl PosixPath : ToStr {
371-
pure fn to_str() -> ~str {
371+
pure fn to_str(&self) -> ~str {
372372
let mut s = ~"";
373373
if self.is_absolute {
374374
s += "/";
@@ -531,7 +531,7 @@ impl PosixPath : GenericPath {
531531

532532

533533
impl WindowsPath : ToStr {
534-
pure fn to_str() -> ~str {
534+
pure fn to_str(&self) -> ~str {
535535
let mut s = ~"";
536536
match self.host {
537537
Some(ref h) => { s += "\\\\"; s += *h; }

branches/try/src/libcore/to_str.rs

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,52 +22,68 @@ use kinds::Copy;
2222
use str;
2323
use vec;
2424

25-
pub trait ToStr { pub pure fn to_str() -> ~str; }
25+
pub trait ToStr {
26+
pure fn to_str(&self) -> ~str;
27+
}
2628

2729
impl bool: ToStr {
2830
#[inline(always)]
29-
pure fn to_str() -> ~str { ::bool::to_str(self) }
31+
pure fn to_str(&self) -> ~str { ::bool::to_str(*self) }
3032
}
3133
impl (): ToStr {
3234
#[inline(always)]
33-
pure fn to_str() -> ~str { ~"()" }
35+
pure fn to_str(&self) -> ~str { ~"()" }
3436
}
3537
impl ~str: ToStr {
3638
#[inline(always)]
37-
pure fn to_str() -> ~str { copy self }
39+
pure fn to_str(&self) -> ~str { copy *self }
3840
}
3941
impl &str: ToStr {
4042
#[inline(always)]
41-
pure fn to_str() -> ~str { ::str::from_slice(self) }
43+
pure fn to_str(&self) -> ~str { ::str::from_slice(*self) }
4244
}
4345
impl @str: ToStr {
4446
#[inline(always)]
45-
pure fn to_str() -> ~str { ::str::from_slice(self) }
47+
pure fn to_str(&self) -> ~str { ::str::from_slice(*self) }
4648
}
4749

48-
impl<A: ToStr Copy, B: ToStr Copy> (A, B): ToStr {
50+
impl<A: ToStr, B: ToStr> (A, B): ToStr {
4951
#[inline(always)]
50-
pure fn to_str() -> ~str {
51-
let (a, b) = self;
52-
~"(" + a.to_str() + ~", " + b.to_str() + ~")"
52+
pure fn to_str(&self) -> ~str {
53+
// FIXME(#4760): this causes an llvm assertion
54+
//let &(ref a, ref b) = self;
55+
match *self {
56+
(ref a, ref b) => {
57+
~"(" + a.to_str() + ~", " + b.to_str() + ~")"
58+
}
59+
}
5360
}
5461
}
55-
impl<A: ToStr Copy, B: ToStr Copy, C: ToStr Copy> (A, B, C): ToStr {
62+
impl<A: ToStr, B: ToStr, C: ToStr> (A, B, C): ToStr {
5663
#[inline(always)]
57-
pure fn to_str() -> ~str {
58-
let (a, b, c) = self;
59-
~"(" + a.to_str() + ~", " + b.to_str() + ~", " + c.to_str() + ~")"
64+
pure fn to_str(&self) -> ~str {
65+
// FIXME(#4760): this causes an llvm assertion
66+
//let &(ref a, ref b, ref c) = self;
67+
match *self {
68+
(ref a, ref b, ref c) => {
69+
fmt!("(%s, %s, %s)",
70+
(*a).to_str(),
71+
(*b).to_str(),
72+
(*c).to_str()
73+
)
74+
}
75+
}
6076
}
6177
}
6278

6379
impl<A: ToStr> ~[A]: ToStr {
6480
#[inline(always)]
65-
pure fn to_str() -> ~str {
81+
pure fn to_str(&self) -> ~str {
6682
unsafe {
6783
// Bleh -- not really unsafe
6884
// push_str and push_char
6985
let mut acc = ~"[", first = true;
70-
for vec::each(self) |elt| {
86+
for self.each |elt| {
7187
unsafe {
7288
if first { first = false; }
7389
else { str::push_str(&mut acc, ~", "); }
@@ -82,11 +98,11 @@ impl<A: ToStr> ~[A]: ToStr {
8298
8399
impl<A: ToStr> @A: ToStr {
84100
#[inline(always)]
85-
pure fn to_str() -> ~str { ~"@" + (*self).to_str() }
101+
pure fn to_str(&self) -> ~str { ~"@" + (**self).to_str() }
86102
}
87103
impl<A: ToStr> ~A: ToStr {
88104
#[inline(always)]
89-
pure fn to_str() -> ~str { ~"~" + (*self).to_str() }
105+
pure fn to_str(&self) -> ~str { ~"~" + (**self).to_str() }
90106
}
91107

92108
#[cfg(test)]

branches/try/src/librustc/back/link.rs

Lines changed: 1 addition & 1 deletion
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);

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

Lines changed: 1 addition & 1 deletion
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(&lint_name) {
541+
match lint_dict.find(/*bad*/ copy lint_name) {
542542
None => {
543543
early_error(demitter, fmt!("unknown %s flag: %s",
544544
level_name, lint_name));

branches/try/src/librustc/lib/llvm.rs

Lines changed: 2 additions & 2 deletions
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 {

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

Lines changed: 2 additions & 2 deletions
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

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

Lines changed: 1 addition & 1 deletion
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
}

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

Lines changed: 8 additions & 8 deletions
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,

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

Lines changed: 1 addition & 1 deletion
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};

0 commit comments

Comments
 (0)