about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-12-21 19:10:51 +0000
committerbors <bors@rust-lang.org>2015-12-21 19:10:51 +0000
commit709d00a2317002183b81df26e9b0b546483ba6f7 (patch)
tree654942b9ad325cf51cc4ab9bf72cfc950f7baa08 /src/libsyntax/parse/parser.rs
parent8cd034de9f523ee6b2498ae647b03660fc8f6fd0 (diff)
parent143b9d80d06c314b8cdf5c35ea9b6661006ee6c6 (diff)
downloadrust-709d00a2317002183b81df26e9b0b546483ba6f7.tar.gz
rust-709d00a2317002183b81df26e9b0b546483ba6f7.zip
Auto merge of #30460 - Ms2ger:BindingMode, r=alexcrichton
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index b625277f2a7..dbd34b49f7d 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -14,7 +14,7 @@ use abi;
 use ast::BareFnTy;
 use ast::{RegionTyParamBound, TraitTyParamBound, TraitBoundModifier};
 use ast::{Public, Unsafety};
-use ast::{Mod, BiAdd, Arg, Arm, Attribute, BindByRef, BindByValue};
+use ast::{Mod, BiAdd, Arg, Arm, Attribute, BindingMode};
 use ast::{BiBitAnd, BiBitOr, BiBitXor, BiRem, BiLt, Block};
 use ast::{BlockCheckMode, CaptureByRef, CaptureByValue, CaptureClause};
 use ast::{Constness, ConstTraitItem, Crate, CrateConfig};
@@ -3278,10 +3278,10 @@ impl<'a> Parser<'a> {
                 hi = self.last_span.hi;
 
                 let bind_type = match (is_ref, is_mut) {
-                    (true, true) => BindByRef(MutMutable),
-                    (true, false) => BindByRef(MutImmutable),
-                    (false, true) => BindByValue(MutMutable),
-                    (false, false) => BindByValue(MutImmutable),
+                    (true, true) => BindingMode::ByRef(MutMutable),
+                    (true, false) => BindingMode::ByRef(MutImmutable),
+                    (false, true) => BindingMode::ByValue(MutMutable),
+                    (false, false) => BindingMode::ByValue(MutImmutable),
                 };
                 let fieldpath = codemap::Spanned{span:self.last_span, node:fieldname};
                 let fieldpat = P(ast::Pat{
@@ -3376,11 +3376,11 @@ impl<'a> Parser<'a> {
             // At this point, token != _, &, &&, (, [
             if try!(self.eat_keyword(keywords::Mut)) {
                 // Parse mut ident @ pat
-                pat = try!(self.parse_pat_ident(BindByValue(MutMutable)));
+                pat = try!(self.parse_pat_ident(BindingMode::ByValue(MutMutable)));
             } else if try!(self.eat_keyword(keywords::Ref)) {
                 // Parse ref ident @ pat / ref mut ident @ pat
                 let mutbl = try!(self.parse_mutability());
-                pat = try!(self.parse_pat_ident(BindByRef(mutbl)));
+                pat = try!(self.parse_pat_ident(BindingMode::ByRef(mutbl)));
             } else if try!(self.eat_keyword(keywords::Box)) {
                 // Parse box pat
                 let subpat = try!(self.parse_pat());
@@ -3409,7 +3409,7 @@ impl<'a> Parser<'a> {
                         // Parse ident @ pat
                         // This can give false positives and parse nullary enums,
                         // they are dealt with later in resolve
-                        pat = try!(self.parse_pat_ident(BindByValue(MutImmutable)));
+                        pat = try!(self.parse_pat_ident(BindingMode::ByValue(MutImmutable)));
                     }
                 } else {
                     let (qself, path) = if try!(self.eat_lt()) {