Skip to content

Commit 79b0c89

Browse files
committed
Don't visit items in removed branches
Note that they will be visited anyway by base::trans_item, this just duplicates the items.
1 parent e9db5fb commit 79b0c89

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

Diff for: src/librustc_trans/trans/controlflow.rs

-10
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ use syntax::ast;
3030
use syntax::ast_util;
3131
use syntax::parse::token::InternedString;
3232
use syntax::parse::token;
33-
use syntax::visit::Visitor;
3433

3534
pub fn trans_stmt<'blk, 'tcx>(cx: Block<'blk, 'tcx>,
3635
s: &ast::Stmt)
@@ -171,16 +170,7 @@ pub fn trans_if<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
171170
// if true { .. } [else { .. }]
172171
bcx = trans_block(bcx, &*thn, dest);
173172
trans::debuginfo::clear_source_location(bcx.fcx);
174-
175-
if let Some(elexpr) = els {
176-
let mut trans = TransItemVisitor { ccx: bcx.fcx.ccx };
177-
trans.visit_expr(&*elexpr);
178-
}
179173
} else {
180-
// if false { .. } [else { .. }]
181-
let mut trans = TransItemVisitor { ccx: bcx.fcx.ccx };
182-
trans.visit_block(&*thn);
183-
184174
if let Some(elexpr) = els {
185175
bcx = expr::trans_into(bcx, &*elexpr, dest);
186176
trans::debuginfo::clear_source_location(bcx.fcx);

0 commit comments

Comments
 (0)