summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorSeo Sanghyeon <sanxiyn@gmail.com>2013-12-17 03:01:40 +0900
committerSeo Sanghyeon <sanxiyn@gmail.com>2013-12-17 03:01:40 +0900
commit4a1336401072bdbac9601c97e278795b1a4b9763 (patch)
tree4c798b831e9e440cdb614180d502a4abbfea69c5 /src/libsyntax/parse
parent9eb89a6c6e60b0ed844258b6c00a68973828b0ba (diff)
downloadrust-4a1336401072bdbac9601c97e278795b1a4b9763.tar.gz
rust-4a1336401072bdbac9601c97e278795b1a4b9763.zip
Remove obsolete mutability from ast::Ty
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 33e3bae99a7..9ab6cc96d33 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1213,11 +1213,11 @@ impl Parser {
         } else if *self.token == token::AT {
             // MANAGED POINTER
             self.bump();
-            self.parse_box_or_uniq_pointee(ManagedSigil, ty_box)
+            self.parse_box_or_uniq_pointee(ManagedSigil)
         } else if *self.token == token::TILDE {
             // OWNED POINTER
             self.bump();
-            self.parse_box_or_uniq_pointee(OwnedSigil, ty_uniq)
+            self.parse_box_or_uniq_pointee(OwnedSigil)
         } else if *self.token == token::BINOP(token::STAR) {
             // STAR POINTER (bare pointer?)
             self.bump();
@@ -1225,13 +1225,13 @@ impl Parser {
         } else if *self.token == token::LBRACKET {
             // VECTOR
             self.expect(&token::LBRACKET);
-            let mt = mt { ty: self.parse_ty(false), mutbl: MutImmutable };
+            let t = self.parse_ty(false);
 
             // Parse the `, ..e` in `[ int, ..e ]`
             // where `e` is a const expression
             let t = match self.maybe_parse_fixed_vstore() {
-                None => ty_vec(mt),
-                Some(suffix) => ty_fixed_length_vec(mt, suffix)
+                None => ty_vec(t),
+                Some(suffix) => ty_fixed_length_vec(t, suffix)
             };
             self.expect(&token::RBRACKET);
             t
@@ -1284,8 +1284,7 @@ impl Parser {
 
     // parse the type following a @ or a ~
     pub fn parse_box_or_uniq_pointee(&self,
-                                     sigil: ast::Sigil,
-                                     ctor: |v: mt| -> ty_)
+                                     sigil: ast::Sigil)
                                      -> ty_ {
         // ~'foo fn() or ~fn() are parsed directly as obsolete fn types:
         match *self.token {
@@ -1309,9 +1308,9 @@ impl Parser {
         // rather than boxed ptrs.  But the special casing of str/vec is not
         // reflected in the AST type.
         if sigil == OwnedSigil {
-            ctor(mt { ty: self.parse_ty(false), mutbl: MutImmutable })
+            ty_uniq(self.parse_ty(false))
         } else {
-            ctor(self.parse_mt())
+            ty_box(self.parse_mt())
         }
     }