about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-12-15 01:18:01 +0000
committerbors <bors@rust-lang.org>2015-12-15 01:18:01 +0000
commit8f031bf96205ed4cb990c2c7aded84d5ac079254 (patch)
tree0d8942d514c60919c8e6855926ed7252d2e227ad /src/libsyntax/parse
parent44d9601ad3b388df34b7e7b9a1a1bfed32b4bce9 (diff)
parentec8ea22c7f59fd898670060bceb6810cef68ca0a (diff)
downloadrust-8f031bf96205ed4cb990c2c7aded84d5ac079254.tar.gz
rust-8f031bf96205ed4cb990c2c7aded84d5ac079254.zip
Auto merge of #30105 - faineance:master, r=nrc
Issue: #30058
Updated for:
 - Stmt
 - BinOp_
 - UnOp
 - UintTy, IntTy and FloatTy
 - Lit
 - Generics

A possible inconsistancy?
The `Stmt` methods are on the spanned varient:
```rust
pub type Stmt = Spanned<Stmt_>;

impl Stmt {
    pub fn id(s: &Stmt) -> Option<NodeId> {
        match s.node {
          StmtDecl(_, id) => Some(id),
          StmtExpr(_, id) => Some(id),
          StmtSemi(_, id) => Some(id),
          StmtMac(..) => None,
      }
  }
}
```
Whilst the methods for BinOp are on the non spanned version.
````rust
impl BinOp_ {
    pub fn to_string(op: BinOp_) -> &'static str { ... }
    pub fn lazy(b: BinOp_) -> bool { ... }

    pub fn is_shift(b: BinOp_) -> bool { ... }
    pub fn is_comparison(b: BinOp_) -> bool { ... }
    /// Returns `true` if the binary operator takes its arguments by value
    pub fn is_by_value(b: BinOp_) -> bool { ... }

}
pub type BinOp = Spanned<BinOp_>;
````
r? @Manishearth
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 7502a8cbc35..9398f1a5733 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -2872,7 +2872,7 @@ impl<'a> Parser<'a> {
     fn check_no_chained_comparison(&mut self, lhs: &Expr, outer_op: &AssocOp) {
         debug_assert!(outer_op.is_comparison());
         match lhs.node {
-            ExprBinary(op, _, _) if ast_util::is_comparison_binop(op.node) => {
+            ExprBinary(op, _, _) if op.node.is_comparison() => {
                 // respan to include both operators
                 let op_span = mk_sp(op.span.lo, self.span.hi);
                 self.span_err(op_span,
@@ -4000,7 +4000,7 @@ impl<'a> Parser<'a> {
                 }
             })
         } else {
-            Ok(ast_util::empty_generics())
+            Ok(ast::Generics::default())
         }
     }