diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-12-31 12:55:39 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-01-03 14:02:01 -0800 |
| commit | 82a09b9a04cb72088e2ec0bd66810445efba5c2e (patch) | |
| tree | 65c6cfdf535419182323133e8e524f177046e18d | |
| parent | 88281290ffdf79d1c3700935a3116fb1a22f458f (diff) | |
| download | rust-82a09b9a04cb72088e2ec0bd66810445efba5c2e.tar.gz rust-82a09b9a04cb72088e2ec0bd66810445efba5c2e.zip | |
librustc: Remove `@mut` support from the parser
| -rw-r--r-- | src/librustc/front/feature_gate.rs | 5 | ||||
| -rw-r--r-- | src/librustc/middle/check_const.rs | 5 | ||||
| -rw-r--r-- | src/librustc/middle/const_eval.rs | 1 | ||||
| -rw-r--r-- | src/librustc/middle/kind.rs | 2 | ||||
| -rw-r--r-- | src/librustc/middle/lint.rs | 2 | ||||
| -rw-r--r-- | src/librustc/middle/trans/consts.rs | 4 | ||||
| -rw-r--r-- | src/librustc/middle/trans/expr.rs | 8 | ||||
| -rw-r--r-- | src/librustc/middle/ty.rs | 1 | ||||
| -rw-r--r-- | src/librustc/middle/typeck/astconv.rs | 4 | ||||
| -rw-r--r-- | src/librustc/middle/typeck/check/mod.rs | 29 | ||||
| -rw-r--r-- | src/librustdoc/clean.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/html/format.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ast.rs | 5 | ||||
| -rw-r--r-- | src/libsyntax/ast_util.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/ext/build.rs | 11 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/ty.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/fold.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/visit.rs | 4 |
20 files changed, 52 insertions, 81 deletions
diff --git a/src/librustc/front/feature_gate.rs b/src/librustc/front/feature_gate.rs index 6bbf18de693..fa0be72b830 100644 --- a/src/librustc/front/feature_gate.rs +++ b/src/librustc/front/feature_gate.rs @@ -189,9 +189,8 @@ impl Visitor<()> for Context { fn visit_expr(&mut self, e: @ast::Expr, _: ()) { match e.node { - ast::ExprUnary(_, ast::UnBox(..), _) | - ast::ExprVstore(_, ast::ExprVstoreBox) | - ast::ExprVstore(_, ast::ExprVstoreMutBox) => { + ast::ExprUnary(_, ast::UnBox, _) | + ast::ExprVstore(_, ast::ExprVstoreBox) => { self.gate_box(e.span); } _ => {} diff --git a/src/librustc/middle/check_const.rs b/src/librustc/middle/check_const.rs index a6a51e95083..c56a268c48f 100644 --- a/src/librustc/middle/check_const.rs +++ b/src/librustc/middle/check_const.rs @@ -116,7 +116,7 @@ pub fn check_expr(v: &mut CheckCrateVisitor, if is_const { match e.node { ExprUnary(_, UnDeref, _) => { } - ExprUnary(_, UnBox(_), _) | ExprUnary(_, UnUniq, _) => { + ExprUnary(_, UnBox, _) | ExprUnary(_, UnUniq, _) => { sess.span_err(e.span, "cannot do allocations in constant expressions"); return; @@ -197,8 +197,7 @@ pub fn check_expr(v: &mut CheckCrateVisitor, immutable values"); }, ExprVstore(_, ExprVstoreUniq) | - ExprVstore(_, ExprVstoreBox) | - ExprVstore(_, ExprVstoreMutBox) => { + ExprVstore(_, ExprVstoreBox) => { sess.span_err(e.span, "cannot allocate vectors in constant expressions") }, diff --git a/src/librustc/middle/const_eval.rs b/src/librustc/middle/const_eval.rs index e7dddd18aee..20db51861d6 100644 --- a/src/librustc/middle/const_eval.rs +++ b/src/librustc/middle/const_eval.rs @@ -239,7 +239,6 @@ impl ConstEvalVisitor { ast::ExprVstoreSlice => self.classify(e), ast::ExprVstoreUniq | ast::ExprVstoreBox | - ast::ExprVstoreMutBox | ast::ExprVstoreMutSlice => non_const } } diff --git a/src/librustc/middle/kind.rs b/src/librustc/middle/kind.rs index 70abd94ea31..49e57306c12 100644 --- a/src/librustc/middle/kind.rs +++ b/src/librustc/middle/kind.rs @@ -306,7 +306,7 @@ pub fn check_expr(cx: &mut Context, e: @Expr) { } match e.node { - ExprUnary(_, UnBox(_), interior) => { + ExprUnary(_, UnBox, interior) => { let interior_type = ty::expr_ty(cx.tcx, interior); let _ = check_durable(cx.tcx, interior_type, interior.span); } diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index 7503419f8b6..07893280624 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -1068,7 +1068,7 @@ fn check_unnecessary_allocation(cx: &Context, e: &ast::Expr) { } } ast::ExprUnary(_, ast::UnUniq, _) | - ast::ExprUnary(_, ast::UnBox(..), _) => BoxAllocation, + ast::ExprUnary(_, ast::UnBox, _) => BoxAllocation, _ => return }; diff --git a/src/librustc/middle/trans/consts.rs b/src/librustc/middle/trans/consts.rs index 0dd8b841bcf..9c3a7f4f671 100644 --- a/src/librustc/middle/trans/consts.rs +++ b/src/librustc/middle/trans/consts.rs @@ -377,9 +377,7 @@ fn const_expr_unadjusted(cx: @CrateContext, let ty = ty::expr_ty(cx.tcx, e); let is_float = ty::type_is_fp(ty); return (match u { - ast::UnBox(_) | - ast::UnUniq | - ast::UnDeref => { + ast::UnBox | ast::UnUniq | ast::UnDeref => { let (dv, _dt) = const_deref(cx, te, ty, true); dv } diff --git a/src/librustc/middle/trans/expr.rs b/src/librustc/middle/trans/expr.rs index 6cece563a82..640f9339a7d 100644 --- a/src/librustc/middle/trans/expr.rs +++ b/src/librustc/middle/trans/expr.rs @@ -590,8 +590,7 @@ fn trans_rvalue_datum_unadjusted(bcx: @Block, expr: &ast::Expr) -> DatumBlock { ast::ExprPath(_) | ast::ExprSelf => { return trans_def_datum_unadjusted(bcx, expr, bcx.def(expr.id)); } - ast::ExprVstore(contents, ast::ExprVstoreBox) | - ast::ExprVstore(contents, ast::ExprVstoreMutBox) => { + ast::ExprVstore(contents, ast::ExprVstoreBox) => { return tvec::trans_uniq_or_managed_vstore(bcx, heap_managed, expr, contents); } @@ -1406,9 +1405,8 @@ fn trans_unary_datum(bcx: @Block, }; immediate_rvalue_bcx(bcx, llneg, un_ty) } - ast::UnBox(_) => { - trans_boxed_expr(bcx, un_ty, sub_expr, sub_ty, - heap_managed) + ast::UnBox => { + trans_boxed_expr(bcx, un_ty, sub_expr, sub_ty, heap_managed) } ast::UnUniq => { let heap = heap_for_unique(bcx, un_ty); diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 79eb26091dc..3ae29eade77 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -3257,7 +3257,6 @@ pub fn expr_kind(tcx: ctxt, ast::ExprAddrOf(..) | ast::ExprBinary(..) | ast::ExprVstore(_, ast::ExprVstoreBox) | - ast::ExprVstore(_, ast::ExprVstoreMutBox) | ast::ExprVstore(_, ast::ExprVstoreUniq) => { RvalueDatumExpr } diff --git a/src/librustc/middle/typeck/astconv.rs b/src/librustc/middle/typeck/astconv.rs index 24c4b3399bc..746389c6044 100644 --- a/src/librustc/middle/typeck/astconv.rs +++ b/src/librustc/middle/typeck/astconv.rs @@ -401,8 +401,8 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>( let typ = match ast_ty.node { ast::ty_nil => ty::mk_nil(), ast::ty_bot => ty::mk_bot(), - ast::ty_box(ref mt) => { - let mt = ast::mt { ty: mt.ty, mutbl: ast::MutImmutable }; + ast::ty_box(ty) => { + let mt = ast::mt { ty: ty, mutbl: ast::MutImmutable }; mk_pointer(this, rscope, &mt, ty::vstore_box, |tmt| ty::mk_box(tcx, tmt.ty)) } diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index dde55f320bc..088104e84ef 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -2628,15 +2628,12 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt, } ast::ExprVec(ref args, mutbl) => { let tt = ast_expr_vstore_to_vstore(fcx, ev, vst); - let mutability; let mut any_error = false; let mut any_bot = false; - match vst { - ast::ExprVstoreMutBox | ast::ExprVstoreMutSlice => { - mutability = ast::MutMutable - } - _ => mutability = mutbl - } + let mutability = match vst { + ast::ExprVstoreMutSlice => ast::MutMutable, + _ => mutbl, + }; let t: ty::t = fcx.infcx().next_ty_var(); for e in args.iter() { check_expr_has_type(fcx, *e, t); @@ -2650,11 +2647,9 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt, } if any_error { ty::mk_err() - } - else if any_bot { + } else if any_bot { ty::mk_bot() - } - else { + } else { ty::mk_evec(tcx, ty::mt {ty: t, mutbl: mutability}, tt) } } @@ -2663,10 +2658,8 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt, let _ = ty::eval_repeat_count(fcx, count_expr); let tt = ast_expr_vstore_to_vstore(fcx, ev, vst); let mutability = match vst { - ast::ExprVstoreMutBox | ast::ExprVstoreMutSlice => { - ast::MutMutable - } - _ => mutbl + ast::ExprVstoreMutSlice => ast::MutMutable, + _ => mutbl, }; let t: ty::t = fcx.infcx().next_ty_var(); check_expr_has_type(fcx, element, t); @@ -2741,7 +2734,7 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt, ast::ExprUnary(callee_id, unop, oprnd) => { let exp_inner = unpack_expected(fcx, expected, |sty| { match unop { - ast::UnBox(_) | ast::UnUniq => match *sty { + ast::UnBox | ast::UnUniq => match *sty { ty::ty_box(ty) => Some(ty), ty::ty_uniq(ref mt) => Some(mt.ty), _ => None @@ -2755,7 +2748,7 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt, if !ty::type_is_error(oprnd_t) && !ty::type_is_bot(oprnd_t) { match unop { - ast::UnBox(_) => { + ast::UnBox => { oprnd_t = ty::mk_box(tcx, oprnd_t) } ast::UnUniq => { @@ -3920,7 +3913,7 @@ pub fn ast_expr_vstore_to_vstore(fcx: @FnCtxt, -> ty::vstore { match v { ast::ExprVstoreUniq => ty::vstore_uniq, - ast::ExprVstoreBox | ast::ExprVstoreMutBox => ty::vstore_box, + ast::ExprVstoreBox => ty::vstore_box, ast::ExprVstoreSlice | ast::ExprVstoreMutSlice => { let r = fcx.infcx().next_region_var(infer::AddrOfSlice(e.span)); ty::vstore_slice(r) diff --git a/src/librustdoc/clean.rs b/src/librustdoc/clean.rs index 4bcf1985ef2..52dbba13ea8 100644 --- a/src/librustdoc/clean.rs +++ b/src/librustdoc/clean.rs @@ -594,7 +594,7 @@ pub enum Type { /// aka ty_bot Bottom, Unique(~Type), - Managed(Mutability, ~Type), + Managed(~Type), RawPointer(Mutability, ~Type), BorrowedRef { lifetime: Option<Lifetime>, mutability: Mutability, type_: ~Type}, // region, raw, other boxes, mutable @@ -620,7 +620,7 @@ impl Clean<Type> for ast::Ty { ty_rptr(ref l, ref m) => BorrowedRef {lifetime: l.clean(), mutability: m.mutbl.clean(), type_: ~m.ty.clean()}, - ty_box(ref m) => Managed(m.mutbl.clean(), ~m.ty.clean()), + ty_box(ty) => Managed(~ty.clean()), ty_uniq(ty) => Unique(~ty.clean()), ty_vec(ty) => Vector(~ty.clean()), ty_fixed_length_vec(ty, ref e) => FixedVector(~ty.clean(), diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 04da17d4ec4..b32ca037261 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -340,13 +340,7 @@ impl fmt::Default for clean::Type { clean::Unit => f.buf.write("()".as_bytes()), clean::Bottom => f.buf.write("!".as_bytes()), clean::Unique(ref t) => write!(f.buf, "~{}", **t), - clean::Managed(m, ref t) => { - write!(f.buf, "@{}{}", - match m { - clean::Mutable => "mut ", - clean::Immutable => "", - }, **t) - } + clean::Managed(ref t) => write!(f.buf, "@{}", **t), clean::RawPointer(m, ref t) => { write!(f.buf, "*{}{}", match m { diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 4d744f4df29..3523d63ef60 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -415,7 +415,6 @@ pub enum Vstore { pub enum ExprVstore { ExprVstoreUniq, // ~[1,2,3,4] ExprVstoreBox, // @[1,2,3,4] - ExprVstoreMutBox, // @mut [1,2,3,4] ExprVstoreSlice, // &[1,2,3,4] ExprVstoreMutSlice, // &mut [1,2,3,4] } @@ -444,7 +443,7 @@ pub enum BinOp { #[deriving(Clone, Eq, Encodable, Decodable, IterBytes)] pub enum UnOp { - UnBox(Mutability), + UnBox, UnUniq, UnDeref, UnNot, @@ -875,7 +874,7 @@ pub struct TyBareFn { pub enum ty_ { ty_nil, ty_bot, /* bottom type */ - ty_box(mt), + ty_box(P<Ty>), ty_uniq(P<Ty>), ty_vec(P<Ty>), ty_fixed_length_vec(P<Ty>, @Expr), diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 70e4922aabf..f99fed517b1 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -137,13 +137,13 @@ pub fn is_shift_binop(b: BinOp) -> bool { } } -pub fn unop_to_str(op: UnOp) -> ~str { +pub fn unop_to_str(op: UnOp) -> &'static str { match op { - UnBox(mt) => if mt == MutMutable { ~"@mut " } else { ~"@" }, - UnUniq => ~"~", - UnDeref => ~"*", - UnNot => ~"!", - UnNeg => ~"-" + UnBox => "@", + UnUniq => "~", + UnDeref => "*", + UnNot => "!", + UnNeg => "-", } } diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index 1a3513ab81c..481472e8f0b 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -54,7 +54,7 @@ pub trait AstBuilder { lifetime: Option<ast::Lifetime>, mutbl: ast::Mutability) -> P<ast::Ty>; fn ty_uniq(&self, span: Span, ty: P<ast::Ty>) -> P<ast::Ty>; - fn ty_box(&self, span: Span, ty: P<ast::Ty>, mutbl: ast::Mutability) -> P<ast::Ty>; + fn ty_box(&self, span: Span, ty: P<ast::Ty>) -> P<ast::Ty>; fn ty_option(&self, ty: P<ast::Ty>) -> P<ast::Ty>; fn ty_infer(&self, sp: Span) -> P<ast::Ty>; @@ -311,12 +311,13 @@ impl AstBuilder for ExtCtxt { self.ty(span, ast::ty_rptr(lifetime, self.ty_mt(ty, mutbl))) } + fn ty_uniq(&self, span: Span, ty: P<ast::Ty>) -> P<ast::Ty> { self.ty(span, ast::ty_uniq(ty)) } - fn ty_box(&self, span: Span, - ty: P<ast::Ty>, mutbl: ast::Mutability) -> P<ast::Ty> { - self.ty(span, ast::ty_box(self.ty_mt(ty, mutbl))) + + fn ty_box(&self, span: Span, ty: P<ast::Ty>) -> P<ast::Ty> { + self.ty(span, ast::ty_box(ty)) } fn ty_option(&self, ty: P<ast::Ty>) -> P<ast::Ty> { @@ -494,7 +495,7 @@ impl AstBuilder for ExtCtxt { } fn expr_managed(&self, sp: Span, e: @ast::Expr) -> @ast::Expr { - self.expr_unary(sp, ast::UnBox(ast::MutImmutable), e) + self.expr_unary(sp, ast::UnBox, e) } fn expr_field_access(&self, sp: Span, expr: @ast::Expr, ident: ast::Ident) -> @ast::Expr { diff --git a/src/libsyntax/ext/deriving/ty.rs b/src/libsyntax/ext/deriving/ty.rs index 10e07520a84..89bed626c1e 100644 --- a/src/libsyntax/ext/deriving/ty.rs +++ b/src/libsyntax/ext/deriving/ty.rs @@ -24,7 +24,7 @@ use opt_vec::OptVec; /// The types of pointers pub enum PtrTy<'a> { Send, // ~ - Managed(ast::Mutability), // @[mut] + Managed, // @ Borrowed(Option<&'a str>, ast::Mutability), // &['lifetime] [mut] } @@ -138,8 +138,8 @@ impl<'a> Ty<'a> { Send => { cx.ty_uniq(span, raw_ty) } - Managed(mutbl) => { - cx.ty_box(span, raw_ty, mutbl) + Managed => { + cx.ty_box(span, raw_ty) } Borrowed(ref lt, mutbl) => { let lt = mk_lifetime(cx, span, lt); @@ -251,7 +251,7 @@ pub fn get_explicit_self(cx: &ExtCtxt, span: Span, self_ptr: &Option<PtrTy>) span, match *ptr { Send => ast::sty_uniq(ast::MutImmutable), - Managed(mutbl) => ast::sty_box(mutbl), + Managed => ast::sty_box(ast::MutImmutable), Borrowed(ref lt, mutbl) => { let lt = lt.map(|s| cx.lifetime(span, cx.ident_of(s))); ast::sty_region(lt, mutbl) diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 4a2adc04fbd..dea30d181da 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -238,7 +238,7 @@ pub trait ast_fold { fn fold_ty(&mut self, t: P<Ty>) -> P<Ty> { let node = match t.node { ty_nil | ty_bot | ty_infer => t.node.clone(), - ty_box(ref mt) => ty_box(fold_mt(mt, self)), + ty_box(ty) => ty_box(self.fold_ty(ty)), ty_uniq(ty) => ty_uniq(self.fold_ty(ty)), ty_vec(ty) => ty_vec(self.fold_ty(ty)), ty_ptr(ref mt) => ty_ptr(fold_mt(mt, self)), diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index ca856a53116..40a2ef86e4f 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -29,8 +29,7 @@ use ast::{ExprField, ExprFnBlock, ExprIf, ExprIndex}; use ast::{ExprLit, ExprLogLevel, ExprLoop, ExprMac}; use ast::{ExprMethodCall, ExprParen, ExprPath, ExprProc, ExprRepeat}; use ast::{ExprRet, ExprSelf, ExprStruct, ExprTup, ExprUnary}; -use ast::{ExprVec, ExprVstore, ExprVstoreMutBox}; -use ast::{ExprVstoreSlice, ExprVstoreBox}; +use ast::{ExprVec, ExprVstore, ExprVstoreSlice, ExprVstoreBox}; use ast::{ExprVstoreMutSlice, ExprWhile, ExprForLoop, extern_fn, Field, fn_decl}; use ast::{ExprVstoreUniq, Onceness, Once, Many}; use ast::{foreign_item, foreign_item_static, foreign_item_fn, foreign_mod}; @@ -1300,7 +1299,7 @@ impl Parser { if sigil == OwnedSigil { ty_uniq(self.parse_ty(false)) } else { - ty_box(self.parse_mt()) + ty_box(self.parse_ty(false)) } } @@ -2300,17 +2299,14 @@ impl Parser { } token::AT => { self.bump(); - let m = self.parse_mutability(); let e = self.parse_prefix_expr(); hi = e.span.hi; // HACK: turn @[...] into a @-evec ex = match e.node { - ExprVec(..) | ExprRepeat(..) if m == MutMutable => - ExprVstore(e, ExprVstoreMutBox), ExprVec(..) | ExprLit(@codemap::Spanned { node: lit_str(..), span: _}) | - ExprRepeat(..) if m == MutImmutable => ExprVstore(e, ExprVstoreBox), - _ => self.mk_unary(UnBox(m), e) + ExprRepeat(..) => ExprVstore(e, ExprVstoreBox), + _ => self.mk_unary(UnBox, e) }; } token::TILDE => { diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 0d68f117460..15dfacc41f1 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -422,7 +422,7 @@ pub fn print_type(s: &mut ps, ty: &ast::Ty) { match ty.node { ast::ty_nil => word(&mut s.s, "()"), ast::ty_bot => word(&mut s.s, "!"), - ast::ty_box(ref mt) => { word(&mut s.s, "@"); print_mt(s, mt); } + ast::ty_box(ty) => { word(&mut s.s, "@"); print_type(s, ty); } ast::ty_uniq(ty) => { word(&mut s.s, "~"); print_type(s, ty); } ast::ty_vec(ty) => { word(&mut s.s, "["); @@ -1083,10 +1083,6 @@ pub fn print_expr_vstore(s: &mut ps, t: ast::ExprVstore) { match t { ast::ExprVstoreUniq => word(&mut s.s, "~"), ast::ExprVstoreBox => word(&mut s.s, "@"), - ast::ExprVstoreMutBox => { - word(&mut s.s, "@"); - word(&mut s.s, "mut"); - } ast::ExprVstoreSlice => word(&mut s.s, "&"), ast::ExprVstoreMutSlice => { word(&mut s.s, "&"); diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 2e83a038c58..29567ab9442 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -302,10 +302,10 @@ pub fn skip_ty<E, V:Visitor<E>>(_: &mut V, _: &Ty, _: E) { pub fn walk_ty<E:Clone, V:Visitor<E>>(visitor: &mut V, typ: &Ty, env: E) { match typ.node { - ty_uniq(ty) | ty_vec(ty) => { + ty_uniq(ty) | ty_vec(ty) | ty_box(ty) => { visitor.visit_ty(ty, env) } - ty_box(ref mutable_type) | ty_ptr(ref mutable_type) => { + ty_ptr(ref mutable_type) => { visitor.visit_ty(mutable_type.ty, env) } ty_rptr(ref lifetime, ref mutable_type) => { |
