@@ -16,10 +16,17 @@ use crate::builtin::Variant;
1616use crate :: meta:: error:: { CallError , CallResult , ConvertError } ;
1717use crate :: meta:: {
1818 EngineFromGodot , EngineToGodot , FromGodot , GodotConvert , GodotType , InParamTuple ,
19- MethodParamOrReturnInfo , OutParamTuple , ParamTuple , ToGodot ,
19+ MethodParamOrReturnInfo , OutParamTuple , ParamTuple , ToGodot , TupleFromGodot ,
2020} ;
2121use crate :: obj:: { GodotClass , ValidatedObject } ;
2222
23+ /// Checks for `#[func]` expansions that all parameters implement `FromGodot` and the return type implements `ToGodot`.
24+ ///
25+ /// [`Signature`] itself only requires `EngineFromGodot` and `EngineToGodot`.
26+ #[ inline( always) ]
27+ #[ doc( hidden) ]
28+ pub fn ensure_func_bounds < Params : TupleFromGodot , Ret : ToGodot > ( ) { }
29+
2330/// A full signature for a function.
2431///
2532/// For in-calls (that is, calls from the Godot engine to Rust code) `Params` will implement [`InParamTuple`] and `Ret`
@@ -177,7 +184,6 @@ impl<Params: OutParamTuple, Ret: EngineFromGodot> Signature<Params, Ret> {
177184 /// Make a varcall to the Godot engine for a virtual function call.
178185 ///
179186 /// # Safety
180- ///
181187 /// - `object_ptr` must be a live instance of a class with a method named `method_sname_ptr`
182188 /// - The method must expect args `args`, and return a value of type `Ret`
183189 #[ cfg( since_api = "4.3" ) ]
@@ -224,7 +230,6 @@ impl<Params: OutParamTuple, Ret: EngineFromGodot> Signature<Params, Ret> {
224230 /// Make a ptrcall to the Godot engine for a utility function that has varargs.
225231 ///
226232 /// # Safety
227- ///
228233 /// - `utility_fn` must expect args `args`, varargs `varargs`, and return a value of type `Ret`
229234 // Note: this is doing a ptrcall, but uses variant conversions for it.
230235 #[ inline]
@@ -253,7 +258,6 @@ impl<Params: OutParamTuple, Ret: EngineFromGodot> Signature<Params, Ret> {
253258 /// Make a ptrcall to the Godot engine for a builtin method that has varargs.
254259 ///
255260 /// # Safety
256- ///
257261 /// - `builtin_fn` must expect args `args`, varargs `varargs`, and return a value of type `Ret`
258262 #[ inline]
259263 pub unsafe fn out_builtin_ptrcall_varargs (
@@ -317,7 +321,6 @@ impl<Params: OutParamTuple, Ret: EngineFromGodot> Signature<Params, Ret> {
317321 /// Make a ptrcall to the Godot engine for a builtin method.
318322 ///
319323 /// # Safety
320- ///
321324 /// - `builtin_fn` must expect explicit args `args`, and return a value of type `Ret`
322325 #[ inline]
323326 pub unsafe fn out_builtin_ptrcall (
@@ -346,7 +349,6 @@ impl<Params: OutParamTuple, Ret: EngineFromGodot> Signature<Params, Ret> {
346349 /// Make a ptrcall to the Godot engine for a utility function.
347350 ///
348351 /// # Safety
349- ///
350352 /// - `utility_fn` must expect explicit args `args`, and return a value of type `Ret`
351353 #[ inline]
352354 pub unsafe fn out_utility_ptrcall (
@@ -371,7 +373,6 @@ impl<Params: OutParamTuple, Ret: EngineFromGodot> Signature<Params, Ret> {
371373 /// Performs a ptrcall and processes the return value to give nice error output.
372374 ///
373375 /// # Safety
374- ///
375376 /// This calls [`GodotFfi::new_with_init`] and passes the ptr as the second argument to `f`, see that function for safety docs.
376377 unsafe fn raw_ptrcall (
377378 args : Params ,
0 commit comments