diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-11-08 16:50:41 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-08 16:50:41 +0100 |
| commit | 65c77bc09ab38b3d9377168d673ed7b0a2c1e0c3 (patch) | |
| tree | 32241bdad56a558bbfa93093ba4cc65797df3498 /src/libsyntax/parse/parser | |
| parent | 76db11c1651dd4826532693fcb5469a30e5d61e6 (diff) | |
| parent | b4c6abcf9e6c1d2710e7ad6a9ce44b3ca6b10d52 (diff) | |
| download | rust-65c77bc09ab38b3d9377168d673ed7b0a2c1e0c3.tar.gz rust-65c77bc09ab38b3d9377168d673ed7b0a2c1e0c3.zip | |
Rollup merge of #66188 - Centril:fnsig, r=davidtwco
`MethodSig` -> `FnSig` & Use it in `ItemKind::Fn` In both AST & HIR, rename `MethodSig` to `FnSig` and then proceed to use it in `ItemKind::Fn` so that the overall structure is more regular. r? @davidtwco
Diffstat (limited to 'src/libsyntax/parse/parser')
| -rw-r--r-- | src/libsyntax/parse/parser/item.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/parse/parser/item.rs b/src/libsyntax/parse/parser/item.rs index 3c618d75d34..531ad532a54 100644 --- a/src/libsyntax/parse/parser/item.rs +++ b/src/libsyntax/parse/parser/item.rs @@ -8,7 +8,7 @@ use crate::ast::{ItemKind, ImplItem, ImplItemKind, TraitItem, TraitItemKind, Use use crate::ast::{PathSegment, IsAuto, Constness, IsAsync, Unsafety, Defaultness}; use crate::ast::{Visibility, VisibilityKind, Mutability, FnHeader, ForeignItem, ForeignItemKind}; use crate::ast::{Ty, TyKind, Generics, GenericBounds, TraitRef, EnumDef, VariantData, StructField}; -use crate::ast::{Mac, MacDelimiter, Block, BindingMode, FnDecl, MethodSig, SelfKind, Param}; +use crate::ast::{Mac, MacDelimiter, Block, BindingMode, FnDecl, FnSig, SelfKind, Param}; use crate::parse::token; use crate::tokenstream::{TokenTree, TokenStream}; use crate::symbol::{kw, sym}; @@ -1800,7 +1800,7 @@ impl<'a> Parser<'a> { is_name_required: |_| true, })?; let (inner_attrs, body) = self.parse_inner_attrs_and_block()?; - let kind = ItemKind::Fn(decl, header, generics, body); + let kind = ItemKind::Fn(FnSig { decl, header }, generics, body); self.mk_item_with_info(attrs, lo, vis, (ident, kind, Some(inner_attrs))) } @@ -1897,14 +1897,14 @@ impl<'a> Parser<'a> { fn parse_method_sig( &mut self, is_name_required: fn(&token::Token) -> bool, - ) -> PResult<'a, (Ident, MethodSig, Generics)> { + ) -> PResult<'a, (Ident, FnSig, Generics)> { let header = self.parse_fn_front_matter()?; let (ident, decl, generics) = self.parse_fn_sig(ParamCfg { is_self_allowed: true, allow_c_variadic: false, is_name_required, })?; - Ok((ident, MethodSig { header, decl }, generics)) + Ok((ident, FnSig { header, decl }, generics)) } /// Parses all the "front matter" for a `fn` declaration, up to |
