From 4fc2516e890ef1fb57b14fcfa623c753aafc4e7d Mon Sep 17 00:00:00 2001 From: valtog Date: Wed, 30 Oct 2019 22:05:46 +0000 Subject: [PATCH] Skip type and roundtrip tests for function types Function types can mean pointers in Rust, but in C they are not interchangeable. This causes jemallocator to fail its test. --- src/lib.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4f7b78a..4051821 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2271,11 +2271,14 @@ impl<'a, 'v> Visitor<'v> for Generator<'a> { let prev_abi = self.abi; let public = i.vis == ast::Visibility::Public; match i.node { - ast::ItemKind::Ty(ref ty, ref generics) if public => { - self.assert_no_generics(i.ident, generics); - self.test_type(&i.ident.to_string(), ty); - self.test_roundtrip(&i.ident.to_string(), None); - } + ast::ItemKind::Ty(ref ty, ref generics) if public => match &ty.node { + ast::TyKind::BareFn(_) => (), + _ => { + self.assert_no_generics(i.ident, generics); + self.test_type(&i.ident.to_string(), ty); + self.test_roundtrip(&i.ident.to_string(), None); + } + }, ast::ItemKind::Struct(ref s, ref generics) | ast::ItemKind::Union(ref s, ref generics)