Skip to content

Commit ccb3c2a

Browse files
committed
---
yaml --- r: 82614 b: refs/heads/auto c: 2ceebf1 h: refs/heads/master v: v3
1 parent 77aeb3f commit ccb3c2a

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 411dce85eadd4ef8abac9b538c8907ca20865bdd
16+
refs/heads/auto: 2ceebf10707d695497fa9b47b17ebdf7d1cc3c47
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,11 +2194,13 @@ pub fn trans_enum_def(ccx: @mut CrateContext, enum_definition: &ast::enum_def,
21942194
}
21952195
}
21962196

2197-
pub struct TransItemVisitor;
2197+
pub struct TransItemVisitor {
2198+
ccx: @mut CrateContext,
2199+
}
21982200

2199-
impl Visitor<@mut CrateContext> for TransItemVisitor {
2200-
fn visit_item(&mut self, i: @ast::item, ccx: @mut CrateContext) {
2201-
trans_item(ccx, i);
2201+
impl Visitor<()> for TransItemVisitor {
2202+
fn visit_item(&mut self, i: @ast::item, _:()) {
2203+
trans_item(self.ccx, i);
22022204
}
22032205
}
22042206

@@ -2235,8 +2237,8 @@ pub fn trans_item(ccx: @mut CrateContext, item: &ast::item) {
22352237
} else {
22362238
// Be sure to travel more than just one layer deep to catch nested
22372239
// items in blocks and such.
2238-
let mut v = TransItemVisitor;
2239-
v.visit_block(body, ccx);
2240+
let mut v = TransItemVisitor{ ccx: ccx };
2241+
v.visit_block(body, ());
22402242
}
22412243
}
22422244
ast::item_impl(ref generics, _, _, ref ms) => {
@@ -2288,8 +2290,8 @@ pub fn trans_item(ccx: @mut CrateContext, item: &ast::item) {
22882290
// functions, but the trait still needs to be walked. Otherwise default
22892291
// methods with items will not get translated and will cause ICE's when
22902292
// metadata time comes around.
2291-
let mut v = TransItemVisitor;
2292-
visit::walk_item(&mut v, item, ccx);
2293+
let mut v = TransItemVisitor{ ccx: ccx };
2294+
visit::walk_item(&mut v, item, ());
22932295
}
22942296
_ => {/* fall through */ }
22952297
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ pub fn trans_impl(ccx: @mut CrateContext,
6161
// Both here and below with generic methods, be sure to recurse and look for
6262
// items that we need to translate.
6363
if !generics.ty_params.is_empty() {
64-
let mut v = TransItemVisitor;
64+
let mut v = TransItemVisitor{ ccx: ccx };
6565
for method in methods.iter() {
66-
visit::walk_method_helper(&mut v, *method, ccx);
66+
visit::walk_method_helper(&mut v, *method, ());
6767
}
6868
return;
6969
}
@@ -80,8 +80,8 @@ pub fn trans_impl(ccx: @mut CrateContext,
8080
None,
8181
llfn);
8282
} else {
83-
let mut v = TransItemVisitor;
84-
visit::walk_method_helper(&mut v, *method, ccx);
83+
let mut v = TransItemVisitor{ ccx: ccx };
84+
visit::walk_method_helper(&mut v, *method, ());
8585
}
8686
}
8787
}

0 commit comments

Comments
 (0)