X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibsyntax%2Fext%2Fbuild.rs;h=d448eb63204ebd7f278e880e450c49b7d6f5b8e2;hb=ea47c2b6b349d7f252a6a734ced8204e6ef70546;hp=5b35b870c305a879d6664ad9c84f868fda071a93;hpb=f284cbc7af06a941de0cdd06291dc78d37268b9f;p=rust.git diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index 5b35b870c30..d448eb63204 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -868,7 +868,7 @@ fn arm_unreachable(&self, span: Span) -> ast::Arm { } fn expr_match(&self, span: Span, arg: P, arms: Vec) -> P { - self.expr(span, ast::ExprMatch(arg, arms, ast::MatchSource::Normal)) + self.expr(span, ast::ExprMatch(arg, arms)) } fn expr_if(&self, span: Span, cond: P, @@ -993,15 +993,20 @@ fn item_fn(&self, } fn variant(&self, span: Span, name: Ident, tys: Vec> ) -> ast::Variant { - let args = tys.into_iter().map(|ty| { - ast::VariantArg { ty: ty, id: ast::DUMMY_NODE_ID } + let fields = tys.into_iter().map(|ty| { + Spanned { span: ty.span, node: ast::StructField_ { + ty: ty, + kind: ast::UnnamedField(ast::Inherited), + attrs: Vec::new(), + id: ast::DUMMY_NODE_ID, + }} }).collect(); respan(span, ast::Variant_ { name: name, attrs: Vec::new(), - kind: ast::TupleVariantKind(args), + def: P(ast::StructDef { fields: fields, ctor_id: Some(ast::DUMMY_NODE_ID) }), id: ast::DUMMY_NODE_ID, disr_expr: None, }) @@ -1079,7 +1084,7 @@ fn item_ty(&self, span: Span, name: Ident, ty: P) -> P { fn attribute(&self, sp: Span, mi: P) -> ast::Attribute { respan(sp, ast::Attribute_ { id: attr::mk_attr_id(), - style: ast::AttrOuter, + style: ast::AttrStyle::Outer, value: mi, is_sugared_doc: false, })