Skip to content

Commit 14c426d

Browse files
committed
Removed Generics from FnKind::ItemFn in libsyntax
1 parent 86ae349 commit 14c426d

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/librustc_resolve/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Resolver<'a> {
718718
_: Span,
719719
node_id: NodeId) {
720720
let rib_kind = match function_kind {
721-
FnKind::ItemFn(_, generics, ..) => {
722-
self.visit_generics(generics);
721+
FnKind::ItemFn(..) => {
723722
ItemRibKind
724723
}
725724
FnKind::Method(_, sig, _, _) => {

src/libsyntax/feature_gate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
15261526
span: Span,
15271527
_node_id: NodeId) {
15281528
// check for const fn declarations
1529-
if let FnKind::ItemFn(_, _, _, Spanned { node: ast::Constness::Const, .. }, _, _, _) =
1529+
if let FnKind::ItemFn(_, _, Spanned { node: ast::Constness::Const, .. }, _, _, _) =
15301530
fn_kind {
15311531
gate_feature_post!(&self, const_fn, span, "const fn is unstable");
15321532
}
@@ -1536,7 +1536,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
15361536
// point.
15371537

15381538
match fn_kind {
1539-
FnKind::ItemFn(_, _, _, _, abi, _, _) |
1539+
FnKind::ItemFn(_, _, _, abi, _, _) |
15401540
FnKind::Method(_, &ast::MethodSig { abi, .. }, _, _) => {
15411541
self.check_abi(abi, span);
15421542
}

src/libsyntax/visit.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use codemap::Spanned;
3131
#[derive(Copy, Clone, PartialEq, Eq)]
3232
pub enum FnKind<'a> {
3333
/// fn foo() or extern "Abi" fn foo()
34-
ItemFn(Ident, &'a Generics, Unsafety, Spanned<Constness>, Abi, &'a Visibility, &'a Block),
34+
ItemFn(Ident, Unsafety, Spanned<Constness>, Abi, &'a Visibility, &'a Block),
3535

3636
/// fn foo(&self)
3737
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) {
247247
visitor.visit_expr(expr);
248248
}
249249
ItemKind::Fn(ref declaration, unsafety, constness, abi, ref generics, ref body) => {
250-
visitor.visit_fn(FnKind::ItemFn(item.ident, generics, unsafety,
250+
visitor.visit_generics(generics);
251+
visitor.visit_fn(FnKind::ItemFn(item.ident, unsafety,
251252
constness, abi, &item.vis, body),
252253
declaration,
253254
item.span,
@@ -538,8 +539,7 @@ pub fn walk_fn<'a, V>(visitor: &mut V, kind: FnKind<'a>, declaration: &'a FnDecl
538539
where V: Visitor<'a>,
539540
{
540541
match kind {
541-
FnKind::ItemFn(_, generics, _, _, _, _, body) => {
542-
visitor.visit_generics(generics);
542+
FnKind::ItemFn(_, _, _, _, _, body) => {
543543
walk_fn_decl(visitor, declaration);
544544
visitor.visit_block(body);
545545
}

0 commit comments

Comments
 (0)