Skip to content

Commit 0c5d22c

Browse files
author
Jorge Aparicio
committed
librustc_trans: use tuple indexing
1 parent 821b836 commit 0c5d22c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/librustc_trans/trans/consts.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fn const_vec(cx: &CrateContext, e: &ast::Expr,
9191
let vec_ty = ty::expr_ty(cx.tcx(), e);
9292
let unit_ty = ty::sequence_element_type(cx.tcx(), vec_ty);
9393
let llunitty = type_of::type_of(cx, unit_ty);
94-
let vs = es.iter().map(|e| const_expr(cx, &**e).val0())
94+
let vs = es.iter().map(|e| const_expr(cx, &**e).0)
9595
.collect::<Vec<_>>();
9696
// If the vector contains enums, an LLVM array won't work.
9797
let v = if vs.iter().any(|vi| val_ty(*vi) != llunitty) {
@@ -302,7 +302,7 @@ pub fn const_expr<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, e: &ast::Expr)
302302
// if it's assigned to a static.
303303
fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr) -> ValueRef {
304304
let map_list = |exprs: &[P<ast::Expr>]| {
305-
exprs.iter().map(|e| const_expr(cx, &**e).val0())
305+
exprs.iter().map(|e| const_expr(cx, &**e).0)
306306
.fold(Vec::new(), |mut l, val| { l.push(val); l })
307307
};
308308
unsafe {
@@ -575,7 +575,7 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr) -> ValueRef {
575575
let cs = field_tys.iter().enumerate()
576576
.map(|(ix, &field_ty)| {
577577
match fs.iter().find(|f| field_ty.name == f.ident.node.name) {
578-
Some(ref f) => const_expr(cx, &*f.expr).val0(),
578+
Some(ref f) => const_expr(cx, &*f.expr).0,
579579
None => {
580580
match base_val {
581581
Some((bv, _)) => {
@@ -594,7 +594,7 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr) -> ValueRef {
594594
})
595595
}
596596
ast::ExprVec(ref es) => {
597-
const_vec(cx, e, es.as_slice()).val0()
597+
const_vec(cx, e, es.as_slice()).0
598598
}
599599
ast::ExprRepeat(ref elem, ref count) => {
600600
let vec_ty = ty::expr_ty(cx.tcx(), e);
@@ -605,7 +605,7 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr) -> ValueRef {
605605
const_eval::const_uint(i) => i as uint,
606606
_ => cx.sess().span_bug(count.span, "count must be integral const expression.")
607607
};
608-
let vs = Vec::from_elem(n, const_expr(cx, &**elem).val0());
608+
let vs = Vec::from_elem(n, const_expr(cx, &**elem).0);
609609
if vs.iter().any(|vi| val_ty(*vi) != llunitty) {
610610
C_struct(cx, vs.as_slice(), false)
611611
} else {
@@ -673,10 +673,10 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr) -> ValueRef {
673673
_ => cx.sess().span_bug(e.span, "expected a struct or variant def")
674674
}
675675
}
676-
ast::ExprParen(ref e) => const_expr(cx, &**e).val0(),
676+
ast::ExprParen(ref e) => const_expr(cx, &**e).0,
677677
ast::ExprBlock(ref block) => {
678678
match block.expr {
679-
Some(ref expr) => const_expr(cx, &**expr).val0(),
679+
Some(ref expr) => const_expr(cx, &**expr).0,
680680
None => C_nil(cx)
681681
}
682682
}

0 commit comments

Comments
 (0)