pub fn lambda(&self, span: Span, ids: Vec<ast::Ident>, body: P<ast::Expr>) -> P<ast::Expr> {
let fn_decl = self.fn_decl(
ids.iter().map(|id| self.param(span, *id, self.ty(span, ast::TyKind::Infer))).collect(),
- ast::FunctionRetTy::Default(span),
+ ast::FnRetTy::Default(span),
);
// FIXME -- We are using `span` as the span of the `|...|`
}
// FIXME: unused `self`
- pub fn fn_decl(&self, inputs: Vec<ast::Param>, output: ast::FunctionRetTy) -> P<ast::FnDecl> {
+ pub fn fn_decl(&self, inputs: Vec<ast::Param>, output: ast::FnRetTy) -> P<ast::FnDecl> {
P(ast::FnDecl { inputs, output })
}
mutbl: ast::Mutability,
expr: P<ast::Expr>,
) -> P<ast::Item> {
- self.item(span, name, Vec::new(), ast::ItemKind::Static(ty, mutbl, expr))
+ self.item(span, name, Vec::new(), ast::ItemKind::Static(ty, mutbl, Some(expr)))
}
pub fn item_const(
ty: P<ast::Ty>,
expr: P<ast::Expr>,
) -> P<ast::Item> {
- self.item(span, name, Vec::new(), ast::ItemKind::Const(ty, expr))
+ self.item(span, name, Vec::new(), ast::ItemKind::Const(ty, Some(expr)))
}
pub fn attribute(&self, mi: ast::MetaItem) -> ast::Attribute {