From 83e831bc229c2346e2322aaad1fdaa219325a4b3 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Tue, 26 Mar 2013 22:24:32 -0700 Subject: [PATCH] syntax: Remove deprecated expr_vstore_fixed --- src/librustc/middle/check_const.rs | 1 - src/librustc/middle/const_eval.rs | 1 - src/librustc/middle/trans/consts.rs | 3 --- src/librustc/middle/trans/expr.rs | 3 --- src/librustc/middle/ty.rs | 1 - src/librustc/middle/typeck/check/mod.rs | 8 -------- src/libsyntax/ast.rs | 1 - src/libsyntax/ext/build.rs | 5 ----- src/libsyntax/parse/parser.rs | 2 +- src/libsyntax/print/pprust.rs | 15 +++------------ 10 files changed, 4 insertions(+), 36 deletions(-) diff --git a/src/librustc/middle/check_const.rs b/src/librustc/middle/check_const.rs index f9212d1ff7b..4bbedf5fc00 100644 --- a/src/librustc/middle/check_const.rs +++ b/src/librustc/middle/check_const.rs @@ -156,7 +156,6 @@ pub fn check_expr(sess: Session, expr_paren(e) => { check_expr(sess, def_map, method_map, tcx, e, is_const, v); } expr_vstore(_, expr_vstore_slice) | - expr_vstore(_, expr_vstore_fixed(_)) | expr_vec(_, m_imm) | expr_addr_of(m_imm, _) | expr_field(*) | diff --git a/src/librustc/middle/const_eval.rs b/src/librustc/middle/const_eval.rs index a25d873af41..d610b007f35 100644 --- a/src/librustc/middle/const_eval.rs +++ b/src/librustc/middle/const_eval.rs @@ -110,7 +110,6 @@ pub fn classify(e: @expr, ast::expr_vstore(e, vstore) => { match vstore { - ast::expr_vstore_fixed(_) | ast::expr_vstore_slice => classify(e, tcx), ast::expr_vstore_uniq | ast::expr_vstore_box | diff --git a/src/librustc/middle/trans/consts.rs b/src/librustc/middle/trans/consts.rs index 1362f97c08e..050fc0dd334 100644 --- a/src/librustc/middle/trans/consts.rs +++ b/src/librustc/middle/trans/consts.rs @@ -466,9 +466,6 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef { let (v, _, _) = const_vec(cx, e, *es); v } - ast::expr_vstore(e, ast::expr_vstore_fixed(_)) => { - const_expr(cx, e) - } ast::expr_vstore(sub, ast::expr_vstore_slice) => { match sub.node { ast::expr_lit(ref lit) => { diff --git a/src/librustc/middle/trans/expr.rs b/src/librustc/middle/trans/expr.rs index 6fa2b273746..5b66f4f3a65 100644 --- a/src/librustc/middle/trans/expr.rs +++ b/src/librustc/middle/trans/expr.rs @@ -714,9 +714,6 @@ fn trans_rvalue_dps_unadjusted(bcx: block, expr: @ast::expr, ast::expr_vstore(contents, ast::expr_vstore_mut_slice) => { return tvec::trans_slice_vstore(bcx, expr, contents, dest); } - ast::expr_vstore(contents, ast::expr_vstore_fixed(_)) => { - return tvec::trans_fixed_vstore(bcx, expr, contents, dest); - } ast::expr_vec(*) | ast::expr_repeat(*) => { return tvec::trans_fixed_vstore(bcx, expr, expr, dest); } diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index edf76ee7c36..475f2c7b13b 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -3117,7 +3117,6 @@ pub fn expr_kind(tcx: ctxt, ast::expr_lit(@codemap::spanned {node: lit_str(_), _}) | ast::expr_vstore(_, ast::expr_vstore_slice) | ast::expr_vstore(_, ast::expr_vstore_mut_slice) | - ast::expr_vstore(_, ast::expr_vstore_fixed(_)) | ast::expr_vec(*) => { RvalueDpsExpr } diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index adb8fd82883..8174899f55e 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -3337,14 +3337,6 @@ pub fn ast_expr_vstore_to_vstore(fcx: @mut FnCtxt, v: ast::expr_vstore) -> ty::vstore { match v { - ast::expr_vstore_fixed(None) => ty::vstore_fixed(n), - ast::expr_vstore_fixed(Some(u)) => { - if n != u { - let s = fmt!("fixed-size sequence mismatch: %u vs. %u",u, n); - fcx.ccx.tcx.sess.span_err(e.span,s); - } - ty::vstore_fixed(u) - } ast::expr_vstore_uniq => ty::vstore_uniq, ast::expr_vstore_box | ast::expr_vstore_mut_box => ty::vstore_box, ast::expr_vstore_slice | ast::expr_vstore_mut_slice => { diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index f873d6b6bb4..10b98ec3c08 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -386,7 +386,6 @@ pub enum vstore { #[auto_decode] #[deriving(Eq)] pub enum expr_vstore { - expr_vstore_fixed(Option), // [1,2,3,4] expr_vstore_uniq, // ~[1,2,3,4] expr_vstore_box, // @[1,2,3,4] expr_vstore_mut_box, // @mut [1,2,3,4] diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index ad71441e046..9499f95f0e7 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -152,11 +152,6 @@ pub fn mk_slice_vec_e(cx: @ext_ctxt, sp: span, +exprs: ~[@ast::expr]) mk_vstore_e(cx, sp, mk_base_vec_e(cx, sp, exprs), ast::expr_vstore_slice) } -pub fn mk_fixed_vec_e(cx: @ext_ctxt, sp: span, +exprs: ~[@ast::expr]) - -> @ast::expr { - mk_vstore_e(cx, sp, mk_base_vec_e(cx, sp, exprs), - ast::expr_vstore_fixed(None)) -} pub fn mk_base_str(cx: @ext_ctxt, sp: span, +s: ~str) -> @ast::expr { let lit = ast::lit_str(@s); return mk_lit(cx, sp, lit); diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index d7af59910b4..754f12cc170 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -28,7 +28,7 @@ use ast::{expr_lit, expr_log, expr_loop, expr_loop_body, expr_mac}; use ast::{expr_method_call, expr_paren, expr_path, expr_repeat}; use ast::{expr_ret, expr_swap, expr_struct, expr_tup, expr_unary}; use ast::{expr_vec, expr_vstore, expr_vstore_mut_box, expr_inline_asm}; -use ast::{expr_vstore_fixed, expr_vstore_slice, expr_vstore_box}; +use ast::{expr_vstore_slice, expr_vstore_box}; use ast::{expr_vstore_mut_slice, expr_while, extern_fn, field, fn_decl}; use ast::{expr_vstore_uniq, TyClosure, TyBareFn, Onceness, Once, Many}; use ast::{foreign_item, foreign_item_const, foreign_item_fn, foreign_mod}; diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index bda5b3671a9..d85b40537fa 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1024,8 +1024,6 @@ pub fn print_vstore(s: @ps, t: ast::vstore) { pub fn print_expr_vstore(s: @ps, t: ast::expr_vstore) { match t { - ast::expr_vstore_fixed(Some(i)) => word(s.s, fmt!("%u", i)), - ast::expr_vstore_fixed(None) => word(s.s, ~"_"), ast::expr_vstore_uniq => word(s.s, ~"~"), ast::expr_vstore_box => word(s.s, ~"@"), ast::expr_vstore_mut_box => { @@ -1100,16 +1098,9 @@ pub fn print_expr(s: @ps, &&expr: @ast::expr) { let ann_node = node_expr(s, expr); (s.ann.pre)(ann_node); match expr.node { - ast::expr_vstore(e, v) => match v { - ast::expr_vstore_fixed(_) => { - print_expr(s, e); - word(s.s, ~"/"); - print_expr_vstore(s, v); - } - _ => { - print_expr_vstore(s, v); - print_expr(s, e); - } + ast::expr_vstore(e, v) => { + print_expr_vstore(s, v); + print_expr(s, e); }, ast::expr_vec(ref exprs, mutbl) => { ibox(s, indent_unit);