diff options
| author | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2016-02-08 12:44:45 +0100 |
|---|---|---|
| committer | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2016-02-11 12:34:48 +0100 |
| commit | 47b0784ba8e62a2e1b877750baeae10d16555fff (patch) | |
| tree | e92bc429f6fec64ef930c8cf63bf0ec30d41c69e /src/libsyntax/parse | |
| parent | 3b57d40fe5a813ac957667ac04938753e3100f55 (diff) | |
| download | rust-47b0784ba8e62a2e1b877750baeae10d16555fff.tar.gz rust-47b0784ba8e62a2e1b877750baeae10d16555fff.zip | |
[breaking-change] don't glob export ast::BlockCheckMode variants
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/classify.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 14 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/libsyntax/parse/classify.rs b/src/libsyntax/parse/classify.rs index 1193224bdb6..ef50b3adad3 100644 --- a/src/libsyntax/parse/classify.rs +++ b/src/libsyntax/parse/classify.rs @@ -12,7 +12,7 @@ // Predicates on exprs and stmts that the pretty-printer and parser use -use ast; +use ast::{self, BlockCheckMode}; /// Does this expression require a semicolon to be treated /// as a statement? The negation of this: 'can this expression @@ -37,7 +37,7 @@ pub fn expr_requires_semi_to_be_stmt(e: &ast::Expr) -> bool { pub fn expr_is_simple_block(e: &ast::Expr) -> bool { match e.node { - ast::ExprBlock(ref block) => block.rules == ast::DefaultBlock, + ast::ExprBlock(ref block) => block.rules == BlockCheckMode::Default, _ => false, } } diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index becce9ba7d9..4c2e00341bc 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -988,7 +988,7 @@ mod tests { span: sp(17,19)})), expr: None, id: ast::DUMMY_NODE_ID, - rules: ast::DefaultBlock, // no idea + rules: ast::BlockCheckMode::Default, // no idea span: sp(15,21), })), vis: ast::Inherited, diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 3f7173b179c..f8c981ce9f6 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -18,7 +18,7 @@ use ast::{Mod, Arg, Arm, Attribute, BindingMode}; use ast::Block; use ast::{BlockCheckMode, CaptureByRef, CaptureByValue, CaptureClause}; use ast::{Constness, ConstTraitItem, Crate, CrateConfig}; -use ast::{Decl, DeclItem, DeclLocal, DefaultBlock}; +use ast::{Decl, DeclItem, DeclLocal}; use ast::{EMPTY_CTXT, EnumDef, ExplicitSelf}; use ast::{Expr, Expr_, ExprAddrOf, ExprMatch, ExprAgain}; use ast::{ExprAssign, ExprAssignOp, ExprBinary, ExprBlock, ExprBox}; @@ -53,7 +53,7 @@ use ast::{TyFixedLengthVec, TyBareFn, TyTypeof, TyInfer}; use ast::{TyParam, TyParamBounds, TyParen, TyPath, TyPtr}; use ast::{TyRptr, TyTup, TyU32, TyVec}; use ast::TypeTraitItem; -use ast::{UnnamedField, UnsafeBlock}; +use ast::UnnamedField; use ast::{ViewPath, ViewPathGlob, ViewPathList, ViewPathSimple}; use ast::{Visibility, WhereClause}; use attr::{ThinAttributes, ThinAttributesExt, AttributesExt}; @@ -2104,7 +2104,7 @@ impl<'a> Parser<'a> { } }, token::OpenDelim(token::Brace) => { - return self.parse_block_expr(lo, DefaultBlock, attrs); + return self.parse_block_expr(lo, BlockCheckMode::Default, attrs); }, token::BinOp(token::Or) | token::OrOr => { let lo = self.span.lo; @@ -2220,7 +2220,7 @@ impl<'a> Parser<'a> { if self.eat_keyword(keywords::Unsafe) { return self.parse_block_expr( lo, - UnsafeBlock(ast::UserProvided), + BlockCheckMode::Unsafe(ast::UserProvided), attrs); } if self.eat_keyword(keywords::Return) { @@ -3062,7 +3062,7 @@ impl<'a> Parser<'a> { stmts: vec![], span: body_expr.span, expr: Some(body_expr), - rules: DefaultBlock, + rules: BlockCheckMode::Default, }) } _ => { @@ -3826,7 +3826,7 @@ impl<'a> Parser<'a> { "place this code inside a block")); } - self.parse_block_tail(lo, DefaultBlock) + self.parse_block_tail(lo, BlockCheckMode::Default) } /// Parse a block. Inner attrs are allowed. @@ -3836,7 +3836,7 @@ impl<'a> Parser<'a> { let lo = self.span.lo; try!(self.expect(&token::OpenDelim(token::Brace))); Ok((try!(self.parse_inner_attributes()), - try!(self.parse_block_tail(lo, DefaultBlock)))) + try!(self.parse_block_tail(lo, BlockCheckMode::Default)))) } /// Parse the rest of a block expression or function body |
