diff options
| author | Ms2ger <Ms2ger@gmail.com> | 2015-12-18 14:23:01 +0100 |
|---|---|---|
| committer | Ms2ger <Ms2ger@gmail.com> | 2015-12-20 22:15:26 +0100 |
| commit | 143b9d80d06c314b8cdf5c35ea9b6661006ee6c6 (patch) | |
| tree | baa456a3b18bf99ae6e88db63ea6852a0ec79a60 /src/libsyntax/parse | |
| parent | f963eb2870f6e2b972cd9d432dc0ece954ab6452 (diff) | |
| download | rust-143b9d80d06c314b8cdf5c35ea9b6661006ee6c6.tar.gz rust-143b9d80d06c314b8cdf5c35ea9b6661006ee6c6.zip | |
Stop re-exporting the ast::BindingMode variants.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index e9c8173a4d9..176dd1ea203 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -890,7 +890,7 @@ mod tests { assert!(panictry!(parser.parse_pat()) == P(ast::Pat{ id: ast::DUMMY_NODE_ID, - node: ast::PatIdent(ast::BindByValue(ast::MutImmutable), + node: ast::PatIdent(ast::BindingMode::ByValue(ast::MutImmutable), Spanned{ span:sp(0, 1), node: str_to_ident("b") }, @@ -926,7 +926,7 @@ mod tests { pat: P(ast::Pat { id: ast::DUMMY_NODE_ID, node: ast::PatIdent( - ast::BindByValue(ast::MutImmutable), + ast::BindingMode::ByValue(ast::MutImmutable), Spanned{ span: sp(6,7), node: str_to_ident("b")}, diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 712f4e38012..f658e831d7b 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}; @@ -3274,10 +3274,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{ @@ -3372,11 +3372,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()); @@ -3405,7 +3405,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()) { |
