Skip to content

Commit eef8cc8

Browse files
pcwaltonemberian
authored andcommitted
---
yaml --- r: 68451 b: refs/heads/auto c: bb83055 h: refs/heads/master i: 68449: 2dd6293 68447: 207805d v: v3
1 parent 2d57ce4 commit eef8cc8

27 files changed

+744
-47
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: e015bee2866a802f17c84bd6d3a06212945a9d17
17+
refs/heads/auto: bb830558d13a8090988141c90ed49b16895c944a
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libextra/crypto/digest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ fn to_hex(rr: &[u8]) -> ~str {
4949
for rr.iter().advance() |b| {
5050
let hex = uint::to_str_radix(*b as uint, 16u);
5151
if hex.len() == 1 {
52-
s += "0";
52+
s.push_char('0');
5353
}
54-
s += hex;
54+
s.push_str(hex);
5555
}
5656
return s;
5757
}

branches/auto/src/libextra/terminfo/parm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,13 +470,14 @@ priv fn format(val: Param, op: FormatOp, flags: Flags) -> Result<~[u8],~str> {
470470
FormatHex|FormatHEX => 16,
471471
FormatString => util::unreachable()
472472
};
473-
let mut (s,_) = match op {
473+
let (s,_) = match op {
474474
FormatDigit => {
475475
let sign = if flags.sign { SignAll } else { SignNeg };
476476
to_str_bytes_common(&d, radix, false, sign, DigAll)
477477
}
478478
_ => to_str_bytes_common(&(d as uint), radix, false, SignNone, DigAll)
479479
};
480+
let mut s = s;
480481
if flags.precision > s.len() {
481482
let mut s_ = vec::with_capacity(flags.precision);
482483
let n = flags.precision - s.len();

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,12 @@ mod test {
403403

404404
fn make_crate(with_bin: bool, with_lib: bool) -> @ast::crate {
405405
let mut attrs = ~[];
406-
if with_bin { attrs += [make_crate_type_attr(@"bin")]; }
407-
if with_lib { attrs += [make_crate_type_attr(@"lib")]; }
406+
if with_bin {
407+
attrs.push(make_crate_type_attr(@"bin"));
408+
}
409+
if with_lib {
410+
attrs.push(make_crate_type_attr(@"lib"));
411+
}
408412
@codemap::respan(codemap::dummy_sp(), ast::crate_ {
409413
module: ast::_mod { view_items: ~[], items: ~[] },
410414
attrs: attrs,

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ fn each_auxiliary_node_id(item: @item, callback: &fn(node_id) -> bool)
484484
let mut continue = true;
485485
match item.node {
486486
item_enum(ref enum_def, _) => {
487-
for enum_def.variants.each |variant| {
487+
for enum_def.variants.iter().advance |variant| {
488488
continue = callback(variant.node.id);
489489
if !continue {
490490
break
@@ -516,7 +516,7 @@ fn encode_reexports(ecx: &EncodeContext,
516516
match ecx.reexports2.find(&id) {
517517
Some(ref exports) => {
518518
debug!("(encoding info for module) found reexports for %d", id);
519-
for exports.each |exp| {
519+
for exports.iter().advance |exp| {
520520
debug!("(encoding info for module) reexport '%s' for %d",
521521
exp.name, id);
522522
ebml_w.start_tag(tag_items_data_item_reexport);
@@ -900,7 +900,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
900900
encode_path(ecx, ebml_w, path, ast_map::path_name(item.ident));
901901

902902
// Encode all the items in this module.
903-
for fm.items.each |foreign_item| {
903+
for fm.items.iter().advance |foreign_item| {
904904
ebml_w.start_tag(tag_mod_child);
905905
ebml_w.wr_str(def_to_str(local_def(foreign_item.id)));
906906
ebml_w.end_tag();
@@ -1506,7 +1506,7 @@ fn encode_misc_info(ecx: &EncodeContext,
15061506
ebml_w: &mut writer::Encoder) {
15071507
ebml_w.start_tag(tag_misc_info);
15081508
ebml_w.start_tag(tag_misc_info_crate_items);
1509-
for crate.node.module.items.each |&item| {
1509+
for crate.node.module.items.iter().advance |&item| {
15101510
ebml_w.start_tag(tag_mod_child);
15111511
ebml_w.wr_str(def_to_str(local_def(item.id)));
15121512
ebml_w.end_tag();

branches/auto/src/librustc/middle/reachable.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl ReachableContext {
140140
}
141141
item_enum(ref enum_def, _) => {
142142
if privacy_context == PublicContext {
143-
for enum_def.variants.each |variant| {
143+
for enum_def.variants.iter().advance |variant| {
144144
reachable_symbols.insert(variant.node.id);
145145
}
146146
}
@@ -159,7 +159,7 @@ impl ReachableContext {
159159
};
160160

161161
// Mark all public methods as reachable.
162-
for methods.each |&method| {
162+
for methods.iter().advance |&method| {
163163
if should_be_considered_public(method) {
164164
reachable_symbols.insert(method.id);
165165
}
@@ -168,15 +168,15 @@ impl ReachableContext {
168168
if generics_require_inlining(generics) {
169169
// If the impl itself has generics, add all public
170170
// symbols to the worklist.
171-
for methods.each |&method| {
171+
for methods.iter().advance |&method| {
172172
if should_be_considered_public(method) {
173173
worklist.push(method.id)
174174
}
175175
}
176176
} else {
177177
// Otherwise, add only public methods that have
178178
// generics to the worklist.
179-
for methods.each |method| {
179+
for methods.iter().advance |method| {
180180
let generics = &method.generics;
181181
let attrs = &method.attrs;
182182
if generics_require_inlining(generics) ||
@@ -190,7 +190,7 @@ impl ReachableContext {
190190
item_trait(_, _, ref trait_methods) => {
191191
// Mark all provided methods as reachable.
192192
if privacy_context == PublicContext {
193-
for trait_methods.each |trait_method| {
193+
for trait_methods.iter().advance |trait_method| {
194194
match *trait_method {
195195
provided(method) => {
196196
reachable_symbols.insert(method.id);

branches/auto/src/librustc/middle/resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ impl Resolver {
12401240
// Create the module and add all methods.
12411241
match *ty {
12421242
Ty {
1243-
node: ty_path(path, _),
1243+
node: ty_path(path, _, _),
12441244
_
12451245
} if path.idents.len() == 1 => {
12461246
let name = path_to_ident(path);

branches/auto/src/librustc/middle/trans/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ pub fn GEPi(cx: block, base: ValueRef, ixs: &[uint]) -> ValueRef {
616616
// we care about.
617617
if ixs.len() < 16 {
618618
let mut small_vec = [ C_i32(0), ..16 ];
619-
for ixs.eachi |i, &ix| {
619+
for ixs.iter().enumerate().advance |(i, &ix)| {
620620
small_vec[i] = C_i32(ix as i32)
621621
}
622622
InBoundsGEP(cx, base, small_vec.slice(0, ixs.len()))

branches/auto/src/librustc/middle/trans/cabi_x86_64.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ enum RegClass {
3939
Memory
4040
}
4141

42-
impl Type {
42+
trait TypeMethods {
43+
fn is_reg_ty(&self) -> bool;
44+
}
45+
46+
impl TypeMethods for Type {
4347
fn is_reg_ty(&self) -> bool {
4448
match self.kind() {
4549
Integer | Pointer | Float | Double => true,

branches/auto/src/librustc/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1908,7 +1908,7 @@ impl TypeContents {
19081908
// this assertion.
19091909
assert!(self.intersects(TC_OWNED_POINTER));
19101910
}
1911-
let tc = TC_MANAGED + TC_DTOR + TypeContents::owned(cx);
1911+
let tc = TC_MANAGED + TC_DTOR + TypeContents::sendable(cx);
19121912
self.intersects(tc)
19131913
}
19141914

branches/auto/src/librustc/middle/typeck/check/method.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,16 +1088,19 @@ impl<'self> LookupContext<'self> {
10881088
_ => {}
10891089
}
10901090

1091-
return match candidate.method_ty.explicit_self {
1091+
let result = match candidate.method_ty.explicit_self {
10921092
sty_static => {
1093+
debug!("(is relevant?) explicit self is static");
10931094
false
10941095
}
10951096

10961097
sty_value => {
1098+
debug!("(is relevant?) explicit self is by-value");
10971099
self.fcx.can_mk_subty(rcvr_ty, candidate.rcvr_ty).is_ok()
10981100
}
10991101

11001102
sty_region(_, m) => {
1103+
debug!("(is relevant?) explicit self is a region");
11011104
match ty::get(rcvr_ty).sty {
11021105
ty::ty_rptr(_, mt) => {
11031106
mutability_matches(mt.mutbl, m) &&
@@ -1109,6 +1112,7 @@ impl<'self> LookupContext<'self> {
11091112
}
11101113

11111114
sty_box(m) => {
1115+
debug!("(is relevant?) explicit self is a box");
11121116
match ty::get(rcvr_ty).sty {
11131117
ty::ty_box(mt) => {
11141118
mutability_matches(mt.mutbl, m) &&
@@ -1120,6 +1124,7 @@ impl<'self> LookupContext<'self> {
11201124
}
11211125

11221126
sty_uniq(m) => {
1127+
debug!("(is relevant?) explicit self is a unique pointer");
11231128
match ty::get(rcvr_ty).sty {
11241129
ty::ty_uniq(mt) => {
11251130
mutability_matches(mt.mutbl, m) &&
@@ -1131,6 +1136,10 @@ impl<'self> LookupContext<'self> {
11311136
}
11321137
};
11331138

1139+
debug!("(is relevant?) %s", if result { "yes" } else { "no" });
1140+
1141+
return result;
1142+
11341143
fn mutability_matches(self_mutbl: ast::mutability,
11351144
candidate_mutbl: ast::mutability) -> bool {
11361145
//! True if `self_mutbl <: candidate_mutbl`

branches/auto/src/librustc/middle/typeck/coherence.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -895,8 +895,22 @@ impl CoherenceChecker {
895895
}
896896

897897
// Record all the trait methods.
898-
let implementation = @implementation;
898+
let mut implementation = @implementation;
899899
for associated_traits.iter().advance |trait_ref| {
900+
self.instantiate_default_methods(implementation.did,
901+
*trait_ref);
902+
903+
// XXX(sully): We could probably avoid this copy if there are no
904+
// default methods.
905+
let mut methods = copy implementation.methods;
906+
self.add_provided_methods_to_impl(&mut methods,
907+
&trait_ref.def_id,
908+
&implementation.did);
909+
implementation = @Impl {
910+
methods: methods,
911+
..*implementation
912+
};
913+
900914
self.add_trait_method(trait_ref.def_id, implementation);
901915
}
902916

@@ -929,9 +943,6 @@ impl CoherenceChecker {
929943
do iter_crate_data(crate_store) |crate_number, _crate_metadata| {
930944
for each_path(crate_store, crate_number) |_, def_like, _| {
931945
match def_like {
932-
dl_def(def_trait(def_id)) => {
933-
self.add_default_methods_for_external_trait(def_id);
934-
}
935946
dl_impl(def_id) => {
936947
self.add_external_impl(&mut impls_seen,
937948
crate_store,

branches/auto/src/librustc/util/ppaux.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,9 @@ pub fn parameterized(cx: ctxt,
488488
}
489489
};
490490

491-
strs += vec::map(tps, |t| ty_to_str(cx, *t));
491+
for tps.iter().advance |t| {
492+
strs.push(ty_to_str(cx, *t))
493+
}
492494

493495
if strs.len() > 0u {
494496
fmt!("%s<%s>", base, strs.connect(","))

0 commit comments

Comments
 (0)