Skip to content

Commit 8c20852

Browse files
committed
---
yaml --- r: 82615 b: refs/heads/auto c: 9d07277 h: refs/heads/master i: 82613: 77aeb3f 82611: b2a8392 82607: 7a7891b v: v3
1 parent ccb3c2a commit 8c20852

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
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: 2ceebf10707d695497fa9b47b17ebdf7d1cc3c47
16+
refs/heads/auto: 9d0727736b237daeff2bc416ba0abb5713a35195
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -570,29 +570,30 @@ pub fn trans_lang_call_with_type_params(bcx: @mut Block,
570570
}
571571

572572

573-
struct CalleeTranslationVisitor;
573+
struct CalleeTranslationVisitor {
574+
flag: bool,
575+
}
574576

575-
impl Visitor<@mut bool> for CalleeTranslationVisitor {
577+
impl Visitor<()> for CalleeTranslationVisitor {
576578

577-
fn visit_item(&mut self, _:@ast::item, _:@mut bool) { }
579+
fn visit_item(&mut self, _:@ast::item, _:()) { }
578580

579-
fn visit_expr(&mut self, e:@ast::Expr, cx:@mut bool) {
581+
fn visit_expr(&mut self, e:@ast::Expr, _:()) {
580582

581-
if !*cx {
583+
if !self.flag {
582584
match e.node {
583-
ast::ExprRet(_) => *cx = true,
584-
_ => visit::walk_expr(self, e, cx),
585+
ast::ExprRet(_) => self.flag = true,
586+
_ => visit::walk_expr(self, e, ()),
585587
}
586588
}
587589
}
588590

589591
}
590592

591593
pub fn body_contains_ret(body: &ast::Block) -> bool {
592-
let cx = @mut false;
593-
let mut v = CalleeTranslationVisitor;
594-
visit::walk_block(&mut v, body, cx);
595-
*cx
594+
let mut v = CalleeTranslationVisitor{ flag: false };
595+
visit::walk_block(&mut v, body, ());
596+
v.flag
596597
}
597598

598599
pub fn trans_call_inner(in_cx: @mut Block,

0 commit comments

Comments
 (0)