Removed Generics from FnKind::ItemFn in libsyntax
This commit is contained in:
parent
86ae34900f
commit
14c426da99
3 changed files with 7 additions and 8 deletions
|
@ -718,8 +718,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Resolver<'a> {
|
|||
_: Span,
|
||||
node_id: NodeId) {
|
||||
let rib_kind = match function_kind {
|
||||
FnKind::ItemFn(_, generics, ..) => {
|
||||
self.visit_generics(generics);
|
||||
FnKind::ItemFn(..) => {
|
||||
ItemRibKind
|
||||
}
|
||||
FnKind::Method(_, sig, _, _) => {
|
||||
|
|
|
@ -1526,7 +1526,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
|
|||
span: Span,
|
||||
_node_id: NodeId) {
|
||||
// check for const fn declarations
|
||||
if let FnKind::ItemFn(_, _, _, Spanned { node: ast::Constness::Const, .. }, _, _, _) =
|
||||
if let FnKind::ItemFn(_, _, Spanned { node: ast::Constness::Const, .. }, _, _, _) =
|
||||
fn_kind {
|
||||
gate_feature_post!(&self, const_fn, span, "const fn is unstable");
|
||||
}
|
||||
|
@ -1536,7 +1536,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
|
|||
// point.
|
||||
|
||||
match fn_kind {
|
||||
FnKind::ItemFn(_, _, _, _, abi, _, _) |
|
||||
FnKind::ItemFn(_, _, _, abi, _, _) |
|
||||
FnKind::Method(_, &ast::MethodSig { abi, .. }, _, _) => {
|
||||
self.check_abi(abi, span);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ use codemap::Spanned;
|
|||
#[derive(Copy, Clone, PartialEq, Eq)]
|
||||
pub enum FnKind<'a> {
|
||||
/// fn foo() or extern "Abi" fn foo()
|
||||
ItemFn(Ident, &'a Generics, Unsafety, Spanned<Constness>, Abi, &'a Visibility, &'a Block),
|
||||
ItemFn(Ident, Unsafety, Spanned<Constness>, Abi, &'a Visibility, &'a Block),
|
||||
|
||||
/// fn foo(&self)
|
||||
Method(Ident, &'a MethodSig, Option<&'a Visibility>, &'a Block),
|
||||
|
@ -247,7 +247,8 @@ pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) {
|
|||
visitor.visit_expr(expr);
|
||||
}
|
||||
ItemKind::Fn(ref declaration, unsafety, constness, abi, ref generics, ref body) => {
|
||||
visitor.visit_fn(FnKind::ItemFn(item.ident, generics, unsafety,
|
||||
visitor.visit_generics(generics);
|
||||
visitor.visit_fn(FnKind::ItemFn(item.ident, unsafety,
|
||||
constness, abi, &item.vis, body),
|
||||
declaration,
|
||||
item.span,
|
||||
|
@ -538,8 +539,7 @@ pub fn walk_fn<'a, V>(visitor: &mut V, kind: FnKind<'a>, declaration: &'a FnDecl
|
|||
where V: Visitor<'a>,
|
||||
{
|
||||
match kind {
|
||||
FnKind::ItemFn(_, generics, _, _, _, _, body) => {
|
||||
visitor.visit_generics(generics);
|
||||
FnKind::ItemFn(_, _, _, _, _, body) => {
|
||||
walk_fn_decl(visitor, declaration);
|
||||
visitor.visit_block(body);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue