diff options
| author | bors <bors@rust-lang.org> | 2016-02-12 14:56:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-02-12 14:56:20 +0000 |
| commit | c7640aa2aaad857bbc9f9a1002f8e1aaf520752e (patch) | |
| tree | 057b1cbdee3abfa8a925cf655376f7abeaba6b07 /src/libsyntax_ext | |
| parent | 9257e8956edf003ee73b4d5ba4dc46c4d07a7e72 (diff) | |
| parent | 77cc5764b9d8b53e01788886d3b3882dffc0001e (diff) | |
| download | rust-c7640aa2aaad857bbc9f9a1002f8e1aaf520752e.tar.gz rust-c7640aa2aaad857bbc9f9a1002f8e1aaf520752e.zip | |
Auto merge of #31583 - petrochenkov:indi_ast, r=Manishearth
cc #31487 plugin-[breaking-change] The AST part of https://github.com/rust-lang/rust/pull/30087 r? @Manishearth
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/deriving/debug.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax_ext/deriving/generic/mod.rs | 20 | ||||
| -rw-r--r-- | src/libsyntax_ext/format.rs | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/libsyntax_ext/deriving/debug.rs b/src/libsyntax_ext/deriving/debug.rs index 858066cb626..6439e9aa498 100644 --- a/src/libsyntax_ext/deriving/debug.rs +++ b/src/libsyntax_ext/deriving/debug.rs @@ -141,7 +141,7 @@ fn show_substructure(cx: &mut ExtCtxt, span: Span, fn stmt_let_undescore(cx: &mut ExtCtxt, sp: Span, - expr: P<ast::Expr>) -> P<ast::Stmt> { + expr: P<ast::Expr>) -> ast::Stmt { let local = P(ast::Local { pat: cx.pat_wild(sp), ty: None, @@ -151,5 +151,5 @@ fn stmt_let_undescore(cx: &mut ExtCtxt, attrs: None, }); let decl = respan(sp, ast::DeclKind::Local(local)); - P(respan(sp, ast::StmtKind::Decl(P(decl), ast::DUMMY_NODE_ID))) + respan(sp, ast::StmtKind::Decl(P(decl), ast::DUMMY_NODE_ID)) } diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index 1e4babfac1e..160d230f86b 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -312,7 +312,7 @@ pub enum SubstructureFields<'a> { /// variants for the enum itself, and the third component is a list of /// `Ident`s bound to the variant index values for each of the actual /// input `Self` arguments. - EnumNonMatchingCollapsed(Vec<Ident>, &'a [P<ast::Variant>], &'a [Ident]), + EnumNonMatchingCollapsed(Vec<Ident>, &'a [ast::Variant], &'a [Ident]), /// A static method where `Self` is a struct. StaticStruct(&'a ast::VariantData, StaticFields), @@ -466,12 +466,12 @@ impl<'a> TraitDef<'a> { type_ident: Ident, generics: &Generics, field_tys: Vec<P<ast::Ty>>, - methods: Vec<P<ast::ImplItem>>) -> P<ast::Item> { + methods: Vec<ast::ImplItem>) -> P<ast::Item> { let trait_path = self.path.to_path(cx, self.span, type_ident, generics); // Transform associated types from `deriving::ty::Ty` into `ast::ImplItem` let associated_types = self.associated_types.iter().map(|&(ident, ref type_def)| { - P(ast::ImplItem { + ast::ImplItem { id: ast::DUMMY_NODE_ID, span: self.span, ident: ident, @@ -482,7 +482,7 @@ impl<'a> TraitDef<'a> { type_ident, generics )), - }) + } }); let Generics { mut lifetimes, ty_params, mut where_clause } = @@ -857,7 +857,7 @@ impl<'a> MethodDef<'a> { abi: Abi, explicit_self: ast::ExplicitSelf, arg_types: Vec<(Ident, P<ast::Ty>)> , - body: P<Expr>) -> P<ast::ImplItem> { + body: P<Expr>) -> ast::ImplItem { // create the generics that aren't for Self let fn_generics = self.generics.to_generics(cx, trait_.span, type_ident, generics); @@ -888,7 +888,7 @@ impl<'a> MethodDef<'a> { }; // Create the method. - P(ast::ImplItem { + ast::ImplItem { id: ast::DUMMY_NODE_ID, attrs: self.attributes.clone(), span: trait_.span, @@ -902,7 +902,7 @@ impl<'a> MethodDef<'a> { constness: ast::Constness::NotConst, decl: fn_decl }, body_block) - }) + } } /// ```ignore @@ -1139,7 +1139,7 @@ impl<'a> MethodDef<'a> { let mk_self_pat = |cx: &mut ExtCtxt, self_arg_name: &str| { let (p, idents) = trait_.create_enum_variant_pattern( cx, type_ident, - &**variant, + variant, self_arg_name, ast::Mutability::Immutable); (cx.pat(sp, ast::PatRegion(p, ast::Mutability::Immutable)), idents) @@ -1209,7 +1209,7 @@ impl<'a> MethodDef<'a> { // Self arg, assuming all are instances of VariantK. // Build up code associated with such a case. let substructure = EnumMatching(index, - &**variant, + variant, field_tuples); let arm_expr = self.call_substructure_method( cx, trait_, type_ident, &self_args[..], nonself_args, @@ -1250,7 +1250,7 @@ impl<'a> MethodDef<'a> { // let __self2_vi = unsafe { // std::intrinsics::discriminant_value(&__arg2) } as i32; // ``` - let mut index_let_stmts: Vec<P<ast::Stmt>> = Vec::new(); + let mut index_let_stmts: Vec<ast::Stmt> = Vec::new(); //We also build an expression which checks whether all discriminants are equal // discriminant_test = __self0_vi == __self1_vi && __self0_vi == __self2_vi && ... diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index 4e24eb9f6d7..fd68ba73427 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -461,7 +461,7 @@ impl<'a, 'b> Context<'a, 'b> { // Wrap the declaration in a block so that it forms a single expression. ecx.expr_block(ecx.block(sp, - vec![P(respan(sp, ast::StmtKind::Decl(P(decl), ast::DUMMY_NODE_ID)))], + vec![respan(sp, ast::StmtKind::Decl(P(decl), ast::DUMMY_NODE_ID))], Some(ecx.expr_ident(sp, name)))) } |
