Merge pull request #445 from dtolnay/fn

Provide rust::Fn call operator in generated header
diff --git a/gen/src/builtin.rs b/gen/src/builtin.rs
index f3240d0..8a25769 100644
--- a/gen/src/builtin.rs
+++ b/gen/src/builtin.rs
@@ -72,6 +72,10 @@
         builtin.unsafe_bitcopy = true;
     }
 
+    if builtin.rust_fn {
+        include.utility = true;
+    }
+
     if builtin.rust_error {
         include.exception = true;
         builtin.friend_impl = true;
diff --git a/include/cxx.h b/include/cxx.h
index b048e27..0313d34 100644
--- a/include/cxx.h
+++ b/include/cxx.h
@@ -215,7 +215,6 @@
 #endif // CXXBRIDGE05_RUST_VEC
 
 #ifndef CXXBRIDGE05_RUST_FN
-#define CXXBRIDGE05_RUST_FN
 template <typename Signature, bool Throws = false>
 class Fn;
 
@@ -316,6 +315,8 @@
 void panic [[noreturn]] (const char *msg);
 #endif // CXXBRIDGE05_PANIC
 
+#ifndef CXXBRIDGE05_RUST_FN
+#define CXXBRIDGE05_RUST_FN
 template <typename Ret, typename... Args, bool Throws>
 Ret Fn<Ret(Args...), Throws>::operator()(Args... args) const noexcept(!Throws) {
   return (*this->trampoline)(std::move(args)..., this->fn);
@@ -325,6 +326,7 @@
 Fn<Ret(Args...), Throws> Fn<Ret(Args...), Throws>::operator*() const noexcept {
   return *this;
 }
+#endif // CXXBRIDGE05_RUST_FN
 
 #ifndef CXXBRIDGE05_RUST_BITCOPY
 #define CXXBRIDGE05_RUST_BITCOPY