Skip to content

Commit 0bfa5ef

Browse files
committed
Avoid #[cfg] on parameter due to #[doc(cfg)] post-processing
1 parent 099d259 commit 0bfa5ef

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

godot-core/src/obj/traits.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -630,10 +630,15 @@ pub mod cap {
630630

631631
/// Auto-implemented for `#[godot_api] impl XyVirtual for MyClass` blocks
632632
pub trait ImplementsGodotVirtual: GodotClass {
633+
// Cannot use #[cfg(since_api = "4.4")] on the `hash` parameter, because the doc-postprocessing generates #[doc(cfg)],
634+
// which isn't valid in parameter position.
635+
636+
#[cfg(before_api = "4.4")]
637+
#[doc(hidden)]
638+
fn __virtual_call(name: &str) -> sys::GDExtensionClassCallVirtual;
639+
640+
#[cfg(since_api = "4.4")]
633641
#[doc(hidden)]
634-
fn __virtual_call(
635-
name: &str,
636-
#[cfg(since_api = "4.4")] hash: u32,
637-
) -> sys::GDExtensionClassCallVirtual;
642+
fn __virtual_call(name: &str, hash: u32) -> sys::GDExtensionClassCallVirtual;
638643
}
639644
}

0 commit comments

Comments
 (0)