godot-core 0.4.1

Internal crate used by godot-rust
Documentation
/*
 * Copyright (c) godot-rust; Bromeon and contributors.
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 */

// ----------------------------------------------------------------------------------------------------------------------------------------------
// Compatibility

// Code generated by Rust derive macros cannot cause any deprecation warnings, due to questionable "feature"
// https://github.com/rust-lang/rust/pull/58994. Fortunately, an extra layer of indirection solves most problems: we generate a declarative
// macro that itself isn't deprecated, but _its_ expansion is. Since the expansion happens in a later step, the warning is emitted.

// Usage example.
//
// 1. Declare a const fn which describes the deprecation warning.
//
//     #[deprecated = "#[base] is no longer needed; Base<T> is recognized directly. \n\
//             More information on https://github.com/godot-rust/gdext/pull/577."]
//     pub const fn base_attribute() {}
//
// 2. At the place of usage, use the `emit_deprecated_warning!` macro to emit the warning. This can be generated by codegen, as well.
//
//     #[cfg(feature = "custom-godot")]
//     __deprecated::emit_deprecated_warning!(feature_custom_godot);

#[macro_export]
macro_rules! emit_deprecated_warning {
    ($warning_fn:ident) => {
        const _: () = $crate::__deprecated::$warning_fn();
    };
}

pub use crate::emit_deprecated_warning;

// ----------------------------------------------------------------------------------------------------------------------------------------------
// Library-side deprecations -- see usage description above.

#[deprecated = "\n\
    #[class(no_init, base=EditorPlugin)] will crash when opened in the editor.\n\
    EditorPlugin classes are automatically instantiated by Godot and require a default constructor.\n\
    Use #[class(init)] instead, or provide a custom init() function in the IEditorPlugin impl."]
pub const fn class_no_init_editor_plugin() {}

// ----------------------------------------------------------------------------------------------------------------------------------------------
// Godot-side deprecations (we may mark them deprecated but keep support).

// Past removals: `radians` in #[export(range)].