diff options
| author | bors <bors@rust-lang.org> | 2015-12-15 01:18:01 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-12-15 01:18:01 +0000 |
| commit | 8f031bf96205ed4cb990c2c7aded84d5ac079254 (patch) | |
| tree | 0d8942d514c60919c8e6855926ed7252d2e227ad /src/libsyntax/ext | |
| parent | 44d9601ad3b388df34b7e7b9a1a1bfed32b4bce9 (diff) | |
| parent | ec8ea22c7f59fd898670060bceb6810cef68ca0a (diff) | |
| download | rust-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/ext')
| -rw-r--r-- | src/libsyntax/ext/build.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index 806f5a7ee22..cdc9cb02453 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -11,7 +11,6 @@ use abi; use ast::{Ident, Generics, Expr}; use ast; -use ast_util; use attr; use codemap::{Span, respan, Spanned, DUMMY_SP, Pos}; use ext::base::ExtCtxt; @@ -991,7 +990,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { name, inputs, output, - ast_util::empty_generics(), + Generics::default(), body) } @@ -1029,7 +1028,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { fn item_enum(&self, span: Span, name: Ident, enum_definition: ast::EnumDef) -> P<ast::Item> { self.item_enum_poly(span, name, enum_definition, - ast_util::empty_generics()) + Generics::default()) } fn item_struct(&self, span: Span, name: Ident, @@ -1038,7 +1037,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { span, name, struct_def, - ast_util::empty_generics() + Generics::default() ) } @@ -1086,7 +1085,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { } fn item_ty(&self, span: Span, name: Ident, ty: P<ast::Ty>) -> P<ast::Item> { - self.item_ty_poly(span, name, ty, ast_util::empty_generics()) + self.item_ty_poly(span, name, ty, Generics::default()) } fn attribute(&self, sp: Span, mi: P<ast::MetaItem>) -> ast::Attribute { |
