deny(missing_docs) for bevy_derive (#19483)
# Objective Deny missing docs in bevy_derive, towards https://github.com/bevyengine/bevy/issues/3492.
This commit is contained in:
parent
723b52abd3
commit
e7a309ff5f
@ -1,4 +1,5 @@
|
|||||||
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
|
//! Assorted proc macro derive functions.
|
||||||
|
|
||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||||
#![doc(
|
#![doc(
|
||||||
@ -188,11 +189,34 @@ pub fn derive_deref_mut(input: TokenStream) -> TokenStream {
|
|||||||
derefs::derive_deref_mut(input)
|
derefs::derive_deref_mut(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Generates the required main function boilerplate for Android.
|
||||||
#[proc_macro_attribute]
|
#[proc_macro_attribute]
|
||||||
pub fn bevy_main(attr: TokenStream, item: TokenStream) -> TokenStream {
|
pub fn bevy_main(attr: TokenStream, item: TokenStream) -> TokenStream {
|
||||||
bevy_main::bevy_main(attr, item)
|
bevy_main::bevy_main(attr, item)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Adds `enum_variant_index` and `enum_variant_name` functions to enums.
|
||||||
|
///
|
||||||
|
/// # Example
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// use bevy_derive::{EnumVariantMeta};
|
||||||
|
///
|
||||||
|
/// #[derive(EnumVariantMeta)]
|
||||||
|
/// enum MyEnum {
|
||||||
|
/// A,
|
||||||
|
/// B,
|
||||||
|
/// }
|
||||||
|
///
|
||||||
|
/// let a = MyEnum::A;
|
||||||
|
/// let b = MyEnum::B;
|
||||||
|
///
|
||||||
|
/// assert_eq!(0, a.enum_variant_index());
|
||||||
|
/// assert_eq!("A", a.enum_variant_name());
|
||||||
|
///
|
||||||
|
/// assert_eq!(1, b.enum_variant_index());
|
||||||
|
/// assert_eq!("B", b.enum_variant_name());
|
||||||
|
/// ```
|
||||||
#[proc_macro_derive(EnumVariantMeta)]
|
#[proc_macro_derive(EnumVariantMeta)]
|
||||||
pub fn derive_enum_variant_meta(input: TokenStream) -> TokenStream {
|
pub fn derive_enum_variant_meta(input: TokenStream) -> TokenStream {
|
||||||
enum_variant_meta::derive_enum_variant_meta(input)
|
enum_variant_meta::derive_enum_variant_meta(input)
|
||||||
|
Loading…
Reference in New Issue
Block a user