diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs index ece311adba..8bf666c9d1 100644 --- a/crates/bevy_app/src/app.rs +++ b/crates/bevy_app/src/app.rs @@ -99,7 +99,7 @@ impl Debug for App { /// /// # Example /// -/// ```rust +/// ``` /// # use bevy_app::{App, AppLabel, SubApp, Main}; /// # use bevy_ecs::prelude::*; /// # use bevy_ecs::schedule::ScheduleLabel; @@ -678,7 +678,7 @@ impl App { /// This vector will be length zero if no plugins of that type have been added. /// If multiple copies of the same plugin are added to the [`App`], they will be listed in insertion order in this vector. /// - /// ```rust + /// ``` /// # use bevy_app::prelude::*; /// # #[derive(Default)] /// # struct ImagePlugin { @@ -755,8 +755,8 @@ impl App { /// Registers the type `T` in the [`TypeRegistry`](bevy_reflect::TypeRegistry) resource, /// adding reflect data as specified in the [`Reflect`](bevy_reflect::Reflect) derive: - /// ```rust,ignore - /// #[derive(Reflect)] + /// ```ignore (No serde "derive" feature) + /// #[derive(Component, Serialize, Deserialize, Reflect)] /// #[reflect(Component, Serialize, Deserialize)] // will register ReflectComponent, ReflectSerialize, ReflectDeserialize /// ``` /// @@ -776,7 +776,7 @@ impl App { /// this method can be used to insert additional type data. /// /// # Example - /// ```rust + /// ``` /// use bevy_app::App; /// use bevy_reflect::{ReflectSerialize, ReflectDeserialize}; /// @@ -930,7 +930,7 @@ impl App { /// /// ## Example /// - /// ```rust + /// ``` /// # use bevy_app::prelude::*; /// # use bevy_ecs::prelude::*; /// # use bevy_ecs::schedule::{LogLevel, ScheduleBuildSettings}; @@ -968,7 +968,7 @@ impl App { /// /// ## Example /// - /// ```rust + /// ``` /// # use bevy_app::prelude::*; /// # use bevy_ecs::prelude::*; /// # use bevy_ecs::schedule::{LogLevel, ScheduleBuildSettings}; diff --git a/crates/bevy_app/src/plugin_group.rs b/crates/bevy_app/src/plugin_group.rs index a299c0a4f1..257f869d12 100644 --- a/crates/bevy_app/src/plugin_group.rs +++ b/crates/bevy_app/src/plugin_group.rs @@ -194,7 +194,7 @@ impl PluginGroupBuilder { } /// A plugin group which doesn't do anything. Useful for examples: -/// ```rust +/// ``` /// # use bevy_app::prelude::*; /// use bevy_app::NoopPluginGroup as MinimalPlugins; /// diff --git a/crates/bevy_asset/src/path.rs b/crates/bevy_asset/src/path.rs index 21dbebab85..6899131691 100644 --- a/crates/bevy_asset/src/path.rs +++ b/crates/bevy_asset/src/path.rs @@ -302,7 +302,7 @@ impl<'a> AssetPath<'a> { /// Resolves a relative asset path via concatenation. The result will be an `AssetPath` which /// is resolved relative to this "base" path. /// - /// ```rust + /// ``` /// # use bevy_asset::AssetPath; /// assert_eq!(AssetPath::parse("a/b").resolve("c"), Ok(AssetPath::parse("a/b/c"))); /// assert_eq!(AssetPath::parse("a/b").resolve("./c"), Ok(AssetPath::parse("a/b/c"))); @@ -352,7 +352,7 @@ impl<'a> AssetPath<'a> { /// primary use case for this method is resolving relative paths embedded within asset files, /// which are relative to the asset in which they are contained. /// - /// ```rust + /// ``` /// # use bevy_asset::AssetPath; /// assert_eq!(AssetPath::parse("a/b").resolve_embed("c"), Ok(AssetPath::parse("a/c"))); /// assert_eq!(AssetPath::parse("a/b").resolve_embed("./c"), Ok(AssetPath::parse("a/c"))); diff --git a/crates/bevy_asset/src/reflect.rs b/crates/bevy_asset/src/reflect.rs index 352007cb22..4ba8e3eed3 100644 --- a/crates/bevy_asset/src/reflect.rs +++ b/crates/bevy_asset/src/reflect.rs @@ -61,7 +61,7 @@ impl ReflectAsset { /// Furthermore, this does *not* allow you to have look up two distinct handles, /// you can only have at most one alive at the same time. /// This means that this is *not allowed*: - /// ```rust,no_run + /// ```no_run /// # use bevy_asset::{ReflectAsset, UntypedHandle}; /// # use bevy_ecs::prelude::World; /// # let reflect_asset: ReflectAsset = unimplemented!(); @@ -176,7 +176,7 @@ impl FromType for ReflectAsset { /// the [`ReflectAsset`] type data on the corresponding `T` asset type: /// /// -/// ```rust,no_run +/// ```no_run /// # use bevy_reflect::{TypeRegistry, prelude::*}; /// # use bevy_ecs::prelude::*; /// use bevy_asset::{ReflectHandle, ReflectAsset}; diff --git a/crates/bevy_core/src/name.rs b/crates/bevy_core/src/name.rs index 7cae9c796d..1f6f40c7ce 100644 --- a/crates/bevy_core/src/name.rs +++ b/crates/bevy_core/src/name.rs @@ -88,7 +88,7 @@ impl std::fmt::Debug for Name { /// Convenient query for giving a human friendly name to an entity. /// -/// ```rust +/// ``` /// # use bevy_core::prelude::*; /// # use bevy_ecs::prelude::*; /// # #[derive(Component)] pub struct Score(f32); diff --git a/crates/bevy_diagnostic/src/diagnostic.rs b/crates/bevy_diagnostic/src/diagnostic.rs index 70b8362b15..1d01376f94 100644 --- a/crates/bevy_diagnostic/src/diagnostic.rs +++ b/crates/bevy_diagnostic/src/diagnostic.rs @@ -296,7 +296,7 @@ impl RegisterDiagnostic for App { /// /// Will initialize a [`DiagnosticsStore`] if it doesn't exist. /// - /// ```rust + /// ``` /// use bevy_app::App; /// use bevy_diagnostic::{Diagnostic, DiagnosticsPlugin, DiagnosticId, RegisterDiagnostic}; /// diff --git a/crates/bevy_ecs/src/change_detection.rs b/crates/bevy_ecs/src/change_detection.rs index 99a4fe747d..93ae4c1ca7 100644 --- a/crates/bevy_ecs/src/change_detection.rs +++ b/crates/bevy_ecs/src/change_detection.rs @@ -358,7 +358,7 @@ macro_rules! impl_methods { /// You should never modify the argument passed to the closure -- if you want to modify the data /// without flagging a change, consider using [`DetectChangesMut::bypass_change_detection`] to make your intent explicit. /// - /// ```rust + /// ``` /// # use bevy_ecs::prelude::*; /// # #[derive(PartialEq)] pub struct Vec2; /// # impl Vec2 { pub const ZERO: Self = Self; } diff --git a/crates/bevy_ecs/src/component.rs b/crates/bevy_ecs/src/component.rs index 3e0d28df7d..e017ea4f54 100644 --- a/crates/bevy_ecs/src/component.rs +++ b/crates/bevy_ecs/src/component.rs @@ -553,7 +553,7 @@ impl Components { /// Returns [`None`] if the `Component` type has not /// yet been initialized using [`Components::init_component()`]. /// - /// ```rust + /// ``` /// use bevy_ecs::prelude::*; /// /// let mut world = World::new(); @@ -591,7 +591,7 @@ impl Components { /// Returns [`None`] if the `Resource` type has not /// yet been initialized using [`Components::init_resource()`]. /// - /// ```rust + /// ``` /// use bevy_ecs::prelude::*; /// /// let mut world = World::new(); @@ -807,7 +807,7 @@ impl ComponentTicks { /// However, components and resources that make use of interior mutability might require manual updates. /// /// # Example - /// ```rust,no_run + /// ```no_run /// # use bevy_ecs::{world::World, component::ComponentTicks}; /// let world: World = unimplemented!(); /// let component_ticks: ComponentTicks = unimplemented!(); @@ -823,7 +823,7 @@ impl ComponentTicks { /// A [`SystemParam`] that provides access to the [`ComponentId`] for a specific type. /// /// # Example -/// ```rust +/// ``` /// # use bevy_ecs::{system::Local, component::{Component, ComponentId, ComponentIdFor}}; /// #[derive(Component)] /// struct Player; diff --git a/crates/bevy_ecs/src/entity/map_entities.rs b/crates/bevy_ecs/src/entity/map_entities.rs index 1989020572..a37c4b6ee7 100644 --- a/crates/bevy_ecs/src/entity/map_entities.rs +++ b/crates/bevy_ecs/src/entity/map_entities.rs @@ -12,7 +12,7 @@ use bevy_utils::EntityHashMap; /// /// ## Example /// -/// ```rust +/// ``` /// use bevy_ecs::prelude::*; /// use bevy_ecs::entity::{EntityMapper, MapEntities}; /// diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs index 4971ad7bf3..e459baf7a1 100644 --- a/crates/bevy_ecs/src/query/state.rs +++ b/crates/bevy_ecs/src/query/state.rs @@ -306,7 +306,7 @@ impl QueryState { /// /// # Examples /// - /// ```rust + /// ``` /// use bevy_ecs::prelude::*; /// use bevy_ecs::query::QueryEntityError; /// @@ -376,7 +376,7 @@ impl QueryState { /// In case of a nonexisting entity or mismatched component, a [`QueryEntityError`] is /// returned instead. /// - /// ```rust + /// ``` /// use bevy_ecs::prelude::*; /// use bevy_ecs::query::QueryEntityError; /// diff --git a/crates/bevy_ecs/src/reflect/component.rs b/crates/bevy_ecs/src/reflect/component.rs index d91e367c41..b4755b6d6a 100644 --- a/crates/bevy_ecs/src/reflect/component.rs +++ b/crates/bevy_ecs/src/reflect/component.rs @@ -13,8 +13,17 @@ //! type, it tells the derive macro for `Reflect` to add the following single line to its //! [`get_type_registration`] method (see the relevant code[^1]). //! -//! ```ignore +//! ``` +//! # use bevy_reflect::{FromType, Reflect}; +//! # use bevy_ecs::prelude::{ReflectComponent, Component}; +//! # #[derive(Default, Reflect, Component)] +//! # struct A; +//! # impl A { +//! # fn foo() { +//! # let mut registration = bevy_reflect::TypeRegistration::of::(); //! registration.insert::(FromType::::from_type()); +//! # } +//! # } //! ``` //! //! This line adds a `ReflectComponent` to the registration data for the type in question. diff --git a/crates/bevy_ecs/src/reflect/entity_commands.rs b/crates/bevy_ecs/src/reflect/entity_commands.rs index d1ca60eb12..6954d27e3d 100644 --- a/crates/bevy_ecs/src/reflect/entity_commands.rs +++ b/crates/bevy_ecs/src/reflect/entity_commands.rs @@ -27,7 +27,7 @@ pub trait ReflectCommandExt { /// /// # Example /// - /// ```rust + /// ``` /// // Note that you need to register the component type in the AppTypeRegistry prior to using /// // reflection. You can use the helpers on the App with `app.register_type::()` /// // or write to the TypeRegistry directly to register all your components @@ -97,7 +97,7 @@ pub trait ReflectCommandExt { /// /// # Example /// - /// ```rust + /// ``` /// // Note that you need to register the component type in the AppTypeRegistry prior to using /// // reflection. You can use the helpers on the App with `app.register_type::()` /// // or write to the TypeRegistry directly to register all your components diff --git a/crates/bevy_ecs/src/schedule/state.rs b/crates/bevy_ecs/src/schedule/state.rs index 9792f51584..a300af43a7 100644 --- a/crates/bevy_ecs/src/schedule/state.rs +++ b/crates/bevy_ecs/src/schedule/state.rs @@ -29,7 +29,7 @@ pub use bevy_ecs_macros::States; /// /// # Example /// -/// ```rust +/// ``` /// use bevy_ecs::prelude::States; /// /// #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, Default, States)] diff --git a/crates/bevy_ecs/src/system/function_system.rs b/crates/bevy_ecs/src/system/function_system.rs index 9056a16481..98f58b6924 100644 --- a/crates/bevy_ecs/src/system/function_system.rs +++ b/crates/bevy_ecs/src/system/function_system.rs @@ -111,7 +111,7 @@ impl SystemMeta { /// # Example /// /// Basic usage: -/// ```rust +/// ``` /// # use bevy_ecs::prelude::*; /// # use bevy_ecs::system::SystemState; /// # use bevy_ecs::event::Events; @@ -144,7 +144,7 @@ impl SystemMeta { /// // You need to manually call `.apply(world)` on the `SystemState` to apply them. /// ``` /// Caching: -/// ```rust +/// ``` /// # use bevy_ecs::prelude::*; /// # use bevy_ecs::system::SystemState; /// # use bevy_ecs::event::Events; @@ -576,7 +576,7 @@ where /// /// To create something like [`PipeSystem`], but in entirely safe code. /// -/// ```rust +/// ``` /// use std::num::ParseIntError; /// /// use bevy_ecs::prelude::*; diff --git a/crates/bevy_ecs/src/system/query.rs b/crates/bevy_ecs/src/system/query.rs index 72b4271dbc..1d34d8d30a 100644 --- a/crates/bevy_ecs/src/system/query.rs +++ b/crates/bevy_ecs/src/system/query.rs @@ -903,7 +903,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> Query<'w, 's, D, F> { /// This method panics if there is a query mismatch or a non-existing entity. /// /// # Examples - /// ```rust, no_run + /// ``` no_run /// use bevy_ecs::prelude::*; /// /// #[derive(Component)] @@ -1011,7 +1011,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> Query<'w, 's, D, F> { /// /// # Examples /// - /// ```rust, no_run + /// ``` no_run /// use bevy_ecs::prelude::*; /// /// #[derive(Component)] diff --git a/crates/bevy_ecs/src/system/system_registry.rs b/crates/bevy_ecs/src/system/system_registry.rs index 5a9d7269d1..c04ff35b7c 100644 --- a/crates/bevy_ecs/src/system/system_registry.rs +++ b/crates/bevy_ecs/src/system/system_registry.rs @@ -151,7 +151,7 @@ impl World { /// /// ## Running a system /// - /// ```rust + /// ``` /// # use bevy_ecs::prelude::*; /// #[derive(Resource, Default)] /// struct Counter(u8); @@ -171,7 +171,7 @@ impl World { /// /// ## Change detection /// - /// ```rust + /// ``` /// # use bevy_ecs::prelude::*; /// #[derive(Resource, Default)] /// struct ChangeDetector; @@ -195,7 +195,7 @@ impl World { /// /// ## Getting system output /// - /// ```rust + /// ``` /// # use bevy_ecs::prelude::*; /// /// #[derive(Resource)] @@ -243,7 +243,7 @@ impl World { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_ecs::prelude::*; /// #[derive(Resource, Default)] /// struct Counter(u8); diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs index 6fb2d2cffb..fe6533e831 100644 --- a/crates/bevy_ecs/src/world/mod.rs +++ b/crates/bevy_ecs/src/world/mod.rs @@ -207,7 +207,7 @@ impl World { /// Returns [`None`] if the `Component` type has not yet been initialized within /// the `World` using [`World::init_component`]. /// - /// ```rust + /// ``` /// use bevy_ecs::prelude::*; /// /// let mut world = World::new(); diff --git a/crates/bevy_input/src/common_conditions.rs b/crates/bevy_input/src/common_conditions.rs index 502ded76e8..06e0b96375 100644 --- a/crates/bevy_input/src/common_conditions.rs +++ b/crates/bevy_input/src/common_conditions.rs @@ -4,7 +4,7 @@ use std::hash::Hash; /// Stateful run condition that can be toggled via a input press using [`ButtonInput::just_pressed`]. /// -/// ```rust,no_run +/// ```no_run /// use bevy::prelude::*; /// use bevy::input::common_conditions::input_toggle_active; /// @@ -22,7 +22,7 @@ use std::hash::Hash; /// /// If you want other systems to be able to access whether the toggled state is active, /// you should use a custom resource or a state for that: -/// ```rust,no_run +/// ```no_run /// use bevy::prelude::*; /// use bevy::input::common_conditions::input_just_pressed; /// @@ -71,7 +71,7 @@ where /// Run condition that is active if [`ButtonInput::just_pressed`] is true for the given input. /// -/// ```rust,no_run +/// ```no_run /// use bevy::prelude::*; /// use bevy::input::common_conditions::input_just_pressed; /// fn main() { diff --git a/crates/bevy_macro_utils/src/fq_std.rs b/crates/bevy_macro_utils/src/fq_std.rs index ecaff7088f..46bfdd43da 100644 --- a/crates/bevy_macro_utils/src/fq_std.rs +++ b/crates/bevy_macro_utils/src/fq_std.rs @@ -7,30 +7,33 @@ //! //! # Example //! Instead of writing this: -//! ```ignore +//! ``` +//! # use quote::quote; //! quote!( //! fn get_id() -> Option { //! Some(0) //! } -//! ) +//! ); //! ``` //! Or this: -//! ```ignore +//! ``` +//! # use quote::quote; //! quote!( //! fn get_id() -> ::core::option::Option { //! ::core::option::Option::Some(0) //! } -//! ) +//! ); //! ``` //! We should write this: -//! ```ignore -//! use crate::fq_std::FQOption; +//! ``` +//! use bevy_macro_utils::fq_std::FQOption; +//! # use quote::quote; //! //! quote!( //! fn get_id() -> #FQOption { //! #FQOption::Some(0) //! } -//! ) +//! ); //! ``` use proc_macro2::TokenStream; diff --git a/crates/bevy_math/src/rects/irect.rs b/crates/bevy_math/src/rects/irect.rs index b8a1b21a79..8f5cad3161 100644 --- a/crates/bevy_math/src/rects/irect.rs +++ b/crates/bevy_math/src/rects/irect.rs @@ -26,7 +26,7 @@ impl IRect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::IRect; /// let r = IRect::new(0, 4, 10, 6); // w=10 h=2 /// let r = IRect::new(2, 3, 5, -1); // w=3 h=4 @@ -43,7 +43,7 @@ impl IRect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{IRect, IVec2}; /// // Unit rect from [0,0] to [1,1] /// let r = IRect::from_corners(IVec2::ZERO, IVec2::ONE); // w=1 h=1 @@ -70,7 +70,7 @@ impl IRect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{IRect, IVec2}; /// let r = IRect::from_center_size(IVec2::ZERO, IVec2::new(3, 2)); // w=2 h=2 /// assert_eq!(r.min, IVec2::splat(-1)); @@ -91,7 +91,7 @@ impl IRect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{IRect, IVec2}; /// let r = IRect::from_center_half_size(IVec2::ZERO, IVec2::ONE); // w=2 h=2 /// assert_eq!(r.min, IVec2::splat(-1)); @@ -113,7 +113,7 @@ impl IRect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{IRect, IVec2}; /// let r = IRect::from_corners(IVec2::ZERO, IVec2::new(0, 1)); // w=0 h=1 /// assert!(r.is_empty()); @@ -127,7 +127,7 @@ impl IRect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::IRect; /// let r = IRect::new(0, 0, 5, 1); // w=5 h=1 /// assert_eq!(r.width(), 5); @@ -141,7 +141,7 @@ impl IRect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::IRect; /// let r = IRect::new(0, 0, 5, 1); // w=5 h=1 /// assert_eq!(r.height(), 1); @@ -155,7 +155,7 @@ impl IRect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{IRect, IVec2}; /// let r = IRect::new(0, 0, 5, 1); // w=5 h=1 /// assert_eq!(r.size(), IVec2::new(5, 1)); @@ -173,7 +173,7 @@ impl IRect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{IRect, IVec2}; /// let r = IRect::new(0, 0, 4, 3); // w=4 h=3 /// assert_eq!(r.half_size(), IVec2::new(2, 1)); @@ -191,7 +191,7 @@ impl IRect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{IRect, IVec2}; /// let r = IRect::new(0, 0, 5, 2); // w=5 h=2 /// assert_eq!(r.center(), IVec2::new(2, 1)); @@ -205,7 +205,7 @@ impl IRect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::IRect; /// let r = IRect::new(0, 0, 5, 1); // w=5 h=1 /// assert!(r.contains(r.center())); @@ -223,7 +223,7 @@ impl IRect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{IRect, IVec2}; /// let r1 = IRect::new(0, 0, 5, 1); // w=5 h=1 /// let r2 = IRect::new(1, -1, 3, 3); // w=2 h=4 @@ -246,7 +246,7 @@ impl IRect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{IRect, IVec2}; /// let r = IRect::new(0, 0, 5, 1); // w=5 h=1 /// let u = r.union_point(IVec2::new(3, 6)); @@ -269,7 +269,7 @@ impl IRect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{IRect, IVec2}; /// let r1 = IRect::new(0, 0, 5, 1); // w=5 h=1 /// let r2 = IRect::new(1, -1, 3, 3); // w=2 h=4 @@ -297,7 +297,7 @@ impl IRect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{IRect, IVec2}; /// let r = IRect::new(0, 0, 5, 1); // w=5 h=1 /// let r2 = r.inset(3); // w=11 h=7 diff --git a/crates/bevy_math/src/rects/rect.rs b/crates/bevy_math/src/rects/rect.rs index d3c5aa5bb5..91377302ec 100644 --- a/crates/bevy_math/src/rects/rect.rs +++ b/crates/bevy_math/src/rects/rect.rs @@ -26,7 +26,7 @@ impl Rect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::Rect; /// let r = Rect::new(0., 4., 10., 6.); // w=10 h=2 /// let r = Rect::new(2., 3., 5., -1.); // w=3 h=4 @@ -43,7 +43,7 @@ impl Rect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{Rect, Vec2}; /// // Unit rect from [0,0] to [1,1] /// let r = Rect::from_corners(Vec2::ZERO, Vec2::ONE); // w=1 h=1 @@ -66,7 +66,7 @@ impl Rect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{Rect, Vec2}; /// let r = Rect::from_center_size(Vec2::ZERO, Vec2::ONE); // w=1 h=1 /// assert!(r.min.abs_diff_eq(Vec2::splat(-0.5), 1e-5)); @@ -87,7 +87,7 @@ impl Rect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{Rect, Vec2}; /// let r = Rect::from_center_half_size(Vec2::ZERO, Vec2::ONE); // w=2 h=2 /// assert!(r.min.abs_diff_eq(Vec2::splat(-1.), 1e-5)); @@ -109,7 +109,7 @@ impl Rect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{Rect, Vec2}; /// let r = Rect::from_corners(Vec2::ZERO, Vec2::new(0., 1.)); // w=0 h=1 /// assert!(r.is_empty()); @@ -123,7 +123,7 @@ impl Rect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::Rect; /// let r = Rect::new(0., 0., 5., 1.); // w=5 h=1 /// assert!((r.width() - 5.).abs() <= 1e-5); @@ -137,7 +137,7 @@ impl Rect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::Rect; /// let r = Rect::new(0., 0., 5., 1.); // w=5 h=1 /// assert!((r.height() - 1.).abs() <= 1e-5); @@ -151,7 +151,7 @@ impl Rect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{Rect, Vec2}; /// let r = Rect::new(0., 0., 5., 1.); // w=5 h=1 /// assert!(r.size().abs_diff_eq(Vec2::new(5., 1.), 1e-5)); @@ -165,7 +165,7 @@ impl Rect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{Rect, Vec2}; /// let r = Rect::new(0., 0., 5., 1.); // w=5 h=1 /// assert!(r.half_size().abs_diff_eq(Vec2::new(2.5, 0.5), 1e-5)); @@ -179,7 +179,7 @@ impl Rect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{Rect, Vec2}; /// let r = Rect::new(0., 0., 5., 1.); // w=5 h=1 /// assert!(r.center().abs_diff_eq(Vec2::new(2.5, 0.5), 1e-5)); @@ -193,7 +193,7 @@ impl Rect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::Rect; /// let r = Rect::new(0., 0., 5., 1.); // w=5 h=1 /// assert!(r.contains(r.center())); @@ -211,7 +211,7 @@ impl Rect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{Rect, Vec2}; /// let r1 = Rect::new(0., 0., 5., 1.); // w=5 h=1 /// let r2 = Rect::new(1., -1., 3., 3.); // w=2 h=4 @@ -234,7 +234,7 @@ impl Rect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{Rect, Vec2}; /// let r = Rect::new(0., 0., 5., 1.); // w=5 h=1 /// let u = r.union_point(Vec2::new(3., 6.)); @@ -257,7 +257,7 @@ impl Rect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{Rect, Vec2}; /// let r1 = Rect::new(0., 0., 5., 1.); // w=5 h=1 /// let r2 = Rect::new(1., -1., 3., 3.); // w=2 h=4 @@ -285,7 +285,7 @@ impl Rect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{Rect, Vec2}; /// let r = Rect::new(0., 0., 5., 1.); // w=5 h=1 /// let r2 = r.inset(3.); // w=11 h=7 @@ -314,7 +314,7 @@ impl Rect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{Rect, Vec2}; /// let r = Rect::new(2., 3., 4., 6.); /// let s = Rect::new(0., 0., 10., 10.); diff --git a/crates/bevy_math/src/rects/urect.rs b/crates/bevy_math/src/rects/urect.rs index 73517de305..56c9482d87 100644 --- a/crates/bevy_math/src/rects/urect.rs +++ b/crates/bevy_math/src/rects/urect.rs @@ -26,7 +26,7 @@ impl URect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::URect; /// let r = URect::new(0, 4, 10, 6); // w=10 h=2 /// let r = URect::new(2, 4, 5, 0); // w=3 h=4 @@ -43,7 +43,7 @@ impl URect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{URect, UVec2}; /// // Unit rect from [0,0] to [1,1] /// let r = URect::from_corners(UVec2::ZERO, UVec2::ONE); // w=1 h=1 @@ -70,7 +70,7 @@ impl URect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{URect, UVec2}; /// let r = URect::from_center_size(UVec2::ONE, UVec2::splat(2)); // w=2 h=2 /// assert_eq!(r.min, UVec2::splat(0)); @@ -91,7 +91,7 @@ impl URect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{URect, UVec2}; /// let r = URect::from_center_half_size(UVec2::ONE, UVec2::ONE); // w=2 h=2 /// assert_eq!(r.min, UVec2::splat(0)); @@ -110,7 +110,7 @@ impl URect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{URect, UVec2}; /// let r = URect::from_corners(UVec2::ZERO, UVec2::new(0, 1)); // w=0 h=1 /// assert!(r.is_empty()); @@ -124,7 +124,7 @@ impl URect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::URect; /// let r = URect::new(0, 0, 5, 1); // w=5 h=1 /// assert_eq!(r.width(), 5); @@ -138,7 +138,7 @@ impl URect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::URect; /// let r = URect::new(0, 0, 5, 1); // w=5 h=1 /// assert_eq!(r.height(), 1); @@ -152,7 +152,7 @@ impl URect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{URect, UVec2}; /// let r = URect::new(0, 0, 5, 1); // w=5 h=1 /// assert_eq!(r.size(), UVec2::new(5, 1)); @@ -170,7 +170,7 @@ impl URect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{URect, UVec2}; /// let r = URect::new(0, 0, 4, 2); // w=4 h=2 /// assert_eq!(r.half_size(), UVec2::new(2, 1)); @@ -188,7 +188,7 @@ impl URect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{URect, UVec2}; /// let r = URect::new(0, 0, 4, 2); // w=4 h=2 /// assert_eq!(r.center(), UVec2::new(2, 1)); @@ -202,7 +202,7 @@ impl URect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::URect; /// let r = URect::new(0, 0, 5, 1); // w=5 h=1 /// assert!(r.contains(r.center())); @@ -220,7 +220,7 @@ impl URect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{URect, UVec2}; /// let r1 = URect::new(0, 0, 5, 1); // w=5 h=1 /// let r2 = URect::new(1, 0, 3, 8); // w=2 h=4 @@ -243,7 +243,7 @@ impl URect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{URect, UVec2}; /// let r = URect::new(0, 0, 5, 1); // w=5 h=1 /// let u = r.union_point(UVec2::new(3, 6)); @@ -266,7 +266,7 @@ impl URect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{URect, UVec2}; /// let r1 = URect::new(0, 0, 2, 2); // w=2 h=2 /// let r2 = URect::new(1, 1, 3, 3); // w=2 h=2 @@ -294,7 +294,7 @@ impl URect { /// /// # Examples /// - /// ```rust + /// ``` /// # use bevy_math::{URect, UVec2}; /// let r = URect::new(4, 4, 6, 6); // w=2 h=2 /// let r2 = r.inset(1); // w=4 h=4 diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/container_attributes.rs b/crates/bevy_reflect/bevy_reflect_derive/src/container_attributes.rs index f3960df7c4..ee388731d7 100644 --- a/crates/bevy_reflect/bevy_reflect_derive/src/container_attributes.rs +++ b/crates/bevy_reflect/bevy_reflect_derive/src/container_attributes.rs @@ -168,9 +168,9 @@ impl TypePathAttrs { /// /// Registering the `Default` implementation: /// -/// ```ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// // Import ReflectDefault so it's accessible by the derive macro -/// use bevy_reflect::prelude::ReflectDefault. +/// use bevy_reflect::prelude::ReflectDefault; /// /// #[derive(Reflect, Default)] /// #[reflect(Default)] @@ -179,7 +179,7 @@ impl TypePathAttrs { /// /// Registering the `Hash` implementation: /// -/// ```ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// // `Hash` is a "special trait" and does not need (nor have) a ReflectHash struct /// /// #[derive(Reflect, Hash)] @@ -189,7 +189,7 @@ impl TypePathAttrs { /// /// Registering the `Hash` implementation using a custom function: /// -/// ```ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// // This function acts as our `Hash` implementation and /// // corresponds to the `Reflect::reflect_hash` method. /// fn get_hash(foo: &Foo) -> Option { diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/derive_data.rs b/crates/bevy_reflect/bevy_reflect_derive/src/derive_data.rs index e013e68b77..ce8777bbc0 100644 --- a/crates/bevy_reflect/bevy_reflect_derive/src/derive_data.rs +++ b/crates/bevy_reflect/bevy_reflect_derive/src/derive_data.rs @@ -29,7 +29,7 @@ pub(crate) enum ReflectDerive<'a> { /// /// # Example /// -/// ```ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// #[derive(Reflect)] /// // traits /// // |----------------------------------------| @@ -54,7 +54,7 @@ pub(crate) struct ReflectMeta<'a> { /// /// # Example /// -/// ```ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// #[derive(Reflect)] /// #[reflect(PartialEq, Serialize, Deserialize, Default)] /// struct ThingThatImReflecting { @@ -73,7 +73,7 @@ pub(crate) struct ReflectStruct<'a> { /// /// # Example /// -/// ```ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// #[derive(Reflect)] /// #[reflect(PartialEq, Serialize, Deserialize, Default)] /// enum ThingThatImReflecting { @@ -573,7 +573,7 @@ impl<'a> EnumVariant<'a> { /// /// # Example /// -/// ```rust,ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// # use syn::parse_quote; /// # use bevy_reflect_derive::ReflectTypePath; /// let path: syn::Path = parse_quote!(::core::marker::PhantomData)?; diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/lib.rs b/crates/bevy_reflect/bevy_reflect_derive/src/lib.rs index 8620103ca5..d0d59f3655 100644 --- a/crates/bevy_reflect/bevy_reflect_derive/src/lib.rs +++ b/crates/bevy_reflect/bevy_reflect_derive/src/lib.rs @@ -318,7 +318,7 @@ pub fn derive_type_uuid(input: TokenStream) -> TokenStream { /// /// # Example /// -/// ```ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// # use std::any::TypeId; /// # use bevy_reflect_derive::{Reflect, reflect_trait}; /// #[reflect_trait] // Generates `ReflectMyTrait` @@ -372,20 +372,20 @@ pub fn reflect_trait(args: TokenStream, input: TokenStream) -> TokenStream { /// /// Types can be passed with or without registering type data: /// -/// ```ignore -/// impl_reflect_value!(::my_crate::Foo); -/// impl_reflect_value!(::my_crate::Bar(Debug, Default, Serialize, Deserialize)); +/// ```ignore (bevy_reflect is not accessible from this crate) +/// impl_reflect_value!(my_crate::Foo); +/// impl_reflect_value!(my_crate::Bar(Debug, Default, Serialize, Deserialize)); /// ``` /// /// Generic types can also specify their parameters and bounds: /// -/// ```ignore -/// impl_reflect_value!(::my_crate::Foo where T1: Bar (Default, Serialize, Deserialize)); +/// ```ignore (bevy_reflect is not accessible from this crate) +/// impl_reflect_value!(my_crate::Foo where T1: Bar (Default, Serialize, Deserialize)); /// ``` /// /// Custom type paths can be specified: /// -/// ```ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// impl_reflect_value!((in not_my_crate as NotFoo) Foo(Debug, Default)); /// ``` /// @@ -440,7 +440,7 @@ pub fn impl_reflect_value(input: TokenStream) -> TokenStream { /// /// # Example /// Implementing `Reflect` for `bevy::prelude::Vec3` as a struct type: -/// ```ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// use bevy::prelude::Vec3; /// /// impl_reflect_struct!( @@ -515,7 +515,7 @@ pub fn impl_reflect_struct(input: TokenStream) -> TokenStream { /// /// # Examples /// -/// ```ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// impl_from_reflect_value!(foo where T1: Bar); /// ``` /// @@ -560,27 +560,27 @@ pub fn impl_from_reflect_value(input: TokenStream) -> TokenStream { /// # Examples /// /// Implementing `TypePath` on a foreign type: -/// ```rust,ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// impl_type_path!(::foreign_crate::foo::bar::Baz); /// ``` /// /// On a generic type: -/// ```rust,ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// impl_type_path!(::foreign_crate::Foo); /// ``` /// /// On a primitive (note this will not compile for a non-primitive type): -/// ```rust,ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// impl_type_path!(bool); /// ``` /// /// With a custom type path: -/// ```rust,ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// impl_type_path!((in other_crate::foo::bar) Baz); /// ``` /// /// With a custom type path and a custom type name: -/// ```rust,ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// impl_type_path!((in other_crate::foo as Baz) Bar); /// ``` /// diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/reflect_value.rs b/crates/bevy_reflect/bevy_reflect_derive/src/reflect_value.rs index b3d0f663a3..da06e78667 100644 --- a/crates/bevy_reflect/bevy_reflect_derive/src/reflect_value.rs +++ b/crates/bevy_reflect/bevy_reflect_derive/src/reflect_value.rs @@ -10,7 +10,7 @@ use syn::{parenthesized, Attribute, Generics, Path}; /// /// This takes the form: /// -/// ```ignore +/// ```ignore (Method expecting TokenStream is better represented with raw tokens) /// // Standard /// ::my_crate::foo::Bar(TraitA, TraitB) /// diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/utility.rs b/crates/bevy_reflect/bevy_reflect_derive/src/utility.rs index 0cd4c88b4c..7bce217f27 100644 --- a/crates/bevy_reflect/bevy_reflect_derive/src/utility.rs +++ b/crates/bevy_reflect/bevy_reflect_derive/src/utility.rs @@ -18,7 +18,13 @@ pub(crate) fn get_bevy_reflect_path() -> Path { /// /// # Example /// -/// ```ignore +/// ``` +/// # use proc_macro2::Ident; +/// # // We can't import this method because of its visibility. +/// # fn get_reflect_ident(name: &str) -> Ident { +/// # let reflected = format!("Reflect{name}"); +/// # Ident::new(&reflected, proc_macro2::Span::call_site()) +/// # } /// let reflected: Ident = get_reflect_ident("Hash"); /// assert_eq!("ReflectHash", reflected.to_string()); /// ``` @@ -195,7 +201,7 @@ impl WhereClauseOptions { /// # Example /// /// The struct: -/// ```ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// #[derive(Reflect)] /// struct Foo { /// a: T, @@ -206,7 +212,7 @@ impl WhereClauseOptions { /// will have active types: `[T]` and ignored types: `[U]` /// /// The `extend_where_clause` function will yield the following `where` clause: -/// ```ignore +/// ```ignore (bevy_reflect is not accessible from this crate) /// where /// T: Reflect, // active_trait_bounds /// U: Any + Send + Sync, // ignored_trait_bounds diff --git a/crates/bevy_reflect/src/lib.rs b/crates/bevy_reflect/src/lib.rs index 3ed140c6f2..231ab7d0e0 100644 --- a/crates/bevy_reflect/src/lib.rs +++ b/crates/bevy_reflect/src/lib.rs @@ -1557,7 +1557,7 @@ mod tests { /// /// # Example /// - /// ```ignore + /// ```ignore (This is only used for a unit test, no need to doc test) /// let some_struct = SomeStruct; /// ``` #[derive(Reflect)] diff --git a/crates/bevy_reflect/src/serde/de.rs b/crates/bevy_reflect/src/serde/de.rs index 0411ca1e2b..6212a74d78 100644 --- a/crates/bevy_reflect/src/serde/de.rs +++ b/crates/bevy_reflect/src/serde/de.rs @@ -219,7 +219,7 @@ impl Container for TupleVariantInfo { /// /// # Example /// -/// ```ignore +/// ```ignore (Can't import private struct from doctest) /// let expected = vec!["foo", "bar", "baz"]; /// assert_eq!("`foo`, `bar`, `baz`", format!("{}", ExpectedValues(expected))); /// ``` diff --git a/crates/bevy_reflect/src/type_path.rs b/crates/bevy_reflect/src/type_path.rs index 99f9b81e6e..d48e620d68 100644 --- a/crates/bevy_reflect/src/type_path.rs +++ b/crates/bevy_reflect/src/type_path.rs @@ -36,7 +36,7 @@ use std::fmt; /// /// # Example /// -/// ```rust +/// ``` /// use bevy_reflect::TypePath; /// /// // This type path will not change with compiler versions or recompiles, diff --git a/crates/bevy_reflect/src/type_registry.rs b/crates/bevy_reflect/src/type_registry.rs index ad32f5b7a2..6de79e5a4f 100644 --- a/crates/bevy_reflect/src/type_registry.rs +++ b/crates/bevy_reflect/src/type_registry.rs @@ -101,8 +101,8 @@ impl TypeRegistry { } /// Registers the type `T`, adding reflect data as specified in the [`Reflect`] derive: - /// ```rust,ignore - /// #[derive(Reflect)] + /// ```ignore (Neither bevy_ecs nor serde "derive" are available.) + /// #[derive(Component, serde::Serialize, serde::Deserialize, Reflect)] /// #[reflect(Component, Serialize, Deserialize)] // will register ReflectComponent, ReflectSerialize, ReflectDeserialize /// ``` pub fn register(&mut self) @@ -143,7 +143,7 @@ impl TypeRegistry { /// this method can be used to insert additional type data. /// /// # Example - /// ```rust + /// ``` /// use bevy_reflect::{TypeRegistry, ReflectSerialize, ReflectDeserialize}; /// /// let mut type_registry = TypeRegistry::default(); @@ -499,7 +499,7 @@ impl Deserialize<'a> + Reflect> FromType for ReflectDeserialize { /// from a pointer. /// /// # Example -/// ```rust +/// ``` /// use bevy_reflect::{TypeRegistry, Reflect, ReflectFromPtr}; /// use bevy_ptr::Ptr; /// use std::ptr::NonNull; diff --git a/crates/bevy_render/src/extract_param.rs b/crates/bevy_render/src/extract_param.rs index e6b1ea1802..02c925d4eb 100644 --- a/crates/bevy_render/src/extract_param.rs +++ b/crates/bevy_render/src/extract_param.rs @@ -27,7 +27,7 @@ use std::ops::{Deref, DerefMut}; /// /// ## Examples /// -/// ```rust +/// ``` /// use bevy_ecs::prelude::*; /// use bevy_render::Extract; /// # #[derive(Component)] diff --git a/crates/bevy_render/src/render_phase/draw.rs b/crates/bevy_render/src/render_phase/draw.rs index d1eee845bf..9837799fbc 100644 --- a/crates/bevy_render/src/render_phase/draw.rs +++ b/crates/bevy_render/src/render_phase/draw.rs @@ -149,15 +149,21 @@ impl DrawFunctions

{ /// Multiple render commands can be combined together by wrapping them in a tuple. /// /// # Example -/// The `DrawPbr` draw function is created from the following render command +/// +/// The `DrawMaterial` draw function is created from the following render command /// tuple. Const generics are used to set specific bind group locations: /// -/// ```ignore -/// pub type DrawPbr = ( +/// ``` +/// # use bevy_render::render_phase::SetItemPipeline; +/// # struct SetMeshViewBindGroup; +/// # struct SetMeshBindGroup; +/// # struct SetMaterialBindGroup(core::marker::PhantomData); +/// # struct DrawMesh; +/// pub type DrawMaterial = ( /// SetItemPipeline, /// SetMeshViewBindGroup<0>, -/// SetStandardMaterialBindGroup<1>, -/// SetTransformBindGroup<2>, +/// SetMeshBindGroup<1>, +/// SetMaterialBindGroup, /// DrawMesh, /// ); /// ``` diff --git a/crates/bevy_render/src/render_phase/draw_state.rs b/crates/bevy_render/src/render_phase/draw_state.rs index 144f8327ea..0468754af6 100644 --- a/crates/bevy_render/src/render_phase/draw_state.rs +++ b/crates/bevy_render/src/render_phase/draw_state.rs @@ -269,7 +269,7 @@ impl<'a> TrackedRenderPass<'a> { /// /// The structure expected in `indirect_buffer` is the following: /// - /// ```rust + /// ``` /// #[repr(C)] /// struct DrawIndirect { /// vertex_count: u32, // The number of vertices to draw. @@ -292,7 +292,7 @@ impl<'a> TrackedRenderPass<'a> { /// /// The structure expected in `indirect_buffer` is the following: /// - /// ```rust + /// ``` /// #[repr(C)] /// struct DrawIndexedIndirect { /// vertex_count: u32, // The number of vertices to draw. @@ -320,7 +320,7 @@ impl<'a> TrackedRenderPass<'a> { /// /// `indirect_buffer` should contain `count` tightly packed elements of the following structure: /// - /// ```rust + /// ``` /// #[repr(C)] /// struct DrawIndirect { /// vertex_count: u32, // The number of vertices to draw. @@ -358,7 +358,7 @@ impl<'a> TrackedRenderPass<'a> { /// /// `indirect_buffer` should contain `count` tightly packed elements of the following structure: /// - /// ```rust + /// ``` /// #[repr(C)] /// struct DrawIndirect { /// vertex_count: u32, // The number of vertices to draw. @@ -401,7 +401,7 @@ impl<'a> TrackedRenderPass<'a> { /// /// `indirect_buffer` should contain `count` tightly packed elements of the following structure: /// - /// ```rust + /// ``` /// #[repr(C)] /// struct DrawIndexedIndirect { /// vertex_count: u32, // The number of vertices to draw. @@ -441,7 +441,7 @@ impl<'a> TrackedRenderPass<'a> { /// /// `indirect_buffer` should contain `count` tightly packed elements of the following structure: /// - /// ```rust + /// ``` /// #[repr(C)] /// struct DrawIndexedIndirect { /// vertex_count: u32, // The number of vertices to draw. diff --git a/crates/bevy_render/src/render_resource/bind_group_entries.rs b/crates/bevy_render/src/render_resource/bind_group_entries.rs index 09336eeb0a..33260f9850 100644 --- a/crates/bevy_render/src/render_resource/bind_group_entries.rs +++ b/crates/bevy_render/src/render_resource/bind_group_entries.rs @@ -6,7 +6,7 @@ use super::{Sampler, TextureView}; /// Helper for constructing bindgroups. /// /// Allows constructing the descriptor's entries as: -/// ```ignore +/// ```ignore (render_device cannot be easily accessed) /// render_device.create_bind_group( /// "my_bind_group", /// &my_layout, @@ -19,7 +19,7 @@ use super::{Sampler, TextureView}; /// /// instead of /// -/// ```ignore +/// ```ignore (render_device cannot be easily accessed) /// render_device.create_bind_group( /// "my_bind_group", /// &my_layout, @@ -38,7 +38,7 @@ use super::{Sampler, TextureView}; /// /// or /// -/// ```ignore +/// ```ignore (render_device cannot be easily accessed) /// render_device.create_bind_group( /// "my_bind_group", /// &my_layout, @@ -51,7 +51,7 @@ use super::{Sampler, TextureView}; /// /// instead of /// -/// ```ignore +/// ```ignore (render_device cannot be easily accessed) /// render_device.create_bind_group( /// "my_bind_group", /// &my_layout, @@ -70,7 +70,7 @@ use super::{Sampler, TextureView}; /// /// or /// -/// ```ignore +/// ```ignore (render_device cannot be easily accessed) /// render_device.create_bind_group( /// "my_bind_group", /// &my_layout, @@ -80,7 +80,7 @@ use super::{Sampler, TextureView}; /// /// instead of /// -/// ```ignore +/// ```ignore (render_device cannot be easily accessed) /// render_device.create_bind_group( /// "my_bind_group", /// &my_layout, diff --git a/crates/bevy_render/src/render_resource/bind_group_layout_entries.rs b/crates/bevy_render/src/render_resource/bind_group_layout_entries.rs index 1cd7869f92..f9d897159b 100644 --- a/crates/bevy_render/src/render_resource/bind_group_layout_entries.rs +++ b/crates/bevy_render/src/render_resource/bind_group_layout_entries.rs @@ -5,7 +5,7 @@ use wgpu::{BindGroupLayoutEntry, BindingType, ShaderStages}; /// Helper for constructing bind group layouts. /// /// Allows constructing the layout's entries as: -/// ```ignore +/// ```ignore (render_device cannot be easily accessed) /// let layout = render_device.create_bind_group_layout( /// "my_bind_group_layout", /// &BindGroupLayoutEntries::with_indices( @@ -23,7 +23,7 @@ use wgpu::{BindGroupLayoutEntry, BindingType, ShaderStages}; /// /// instead of /// -/// ```ignore +/// ```ignore (render_device cannot be easily accessed) /// let layout = render_device.create_bind_group_layout( /// "my_bind_group_layout", /// &[ @@ -51,7 +51,7 @@ use wgpu::{BindGroupLayoutEntry, BindingType, ShaderStages}; /// /// or /// -/// ```ignore +/// ```ignore (render_device cannot be easily accessed) /// render_device.create_bind_group_layout( /// "my_bind_group_layout", /// &BindGroupLayoutEntries::sequential( @@ -68,7 +68,7 @@ use wgpu::{BindGroupLayoutEntry, BindingType, ShaderStages}; /// /// instead of /// -/// ```ignore +/// ```ignore (render_device cannot be easily accessed) /// let layout = render_device.create_bind_group_layout( /// "my_bind_group_layout", /// &[ @@ -96,7 +96,7 @@ use wgpu::{BindGroupLayoutEntry, BindingType, ShaderStages}; /// /// or /// -/// ```ignore +/// ```ignore (render_device cannot be easily accessed) /// render_device.create_bind_group_layout( /// "my_bind_group_layout", /// &BindGroupLayoutEntries::single( @@ -108,7 +108,7 @@ use wgpu::{BindGroupLayoutEntry, BindingType, ShaderStages}; /// /// instead of /// -/// ```ignore +/// ```ignore (render_device cannot be easily accessed) /// let layout = render_device.create_bind_group_layout( /// "my_bind_group_layout", /// &[ diff --git a/crates/bevy_tasks/src/single_threaded_task_pool.rs b/crates/bevy_tasks/src/single_threaded_task_pool.rs index 81c26a1bc4..1be0b0da17 100644 --- a/crates/bevy_tasks/src/single_threaded_task_pool.rs +++ b/crates/bevy_tasks/src/single_threaded_task_pool.rs @@ -171,7 +171,7 @@ impl TaskPool { /// the local executor on the main thread as it needs to share time with /// other things. /// - /// ```rust + /// ``` /// use bevy_tasks::TaskPool; /// /// TaskPool::new().with_local_executor(|local_executor| { diff --git a/crates/bevy_tasks/src/slice.rs b/crates/bevy_tasks/src/slice.rs index 4b5d875ea9..8410478322 100644 --- a/crates/bevy_tasks/src/slice.rs +++ b/crates/bevy_tasks/src/slice.rs @@ -10,7 +10,7 @@ pub trait ParallelSlice: AsRef<[T]> { /// /// # Example /// - /// ```rust + /// ``` /// # use bevy_tasks::prelude::*; /// # use bevy_tasks::TaskPool; /// let task_pool = TaskPool::new(); @@ -54,7 +54,7 @@ pub trait ParallelSlice: AsRef<[T]> { /// /// # Example /// - /// ```rust + /// ``` /// # use bevy_tasks::prelude::*; /// # use bevy_tasks::TaskPool; /// let task_pool = TaskPool::new(); @@ -104,7 +104,7 @@ pub trait ParallelSliceMut: AsMut<[T]> { /// /// # Example /// - /// ```rust + /// ``` /// # use bevy_tasks::prelude::*; /// # use bevy_tasks::TaskPool; /// let task_pool = TaskPool::new(); @@ -151,7 +151,7 @@ pub trait ParallelSliceMut: AsMut<[T]> { /// /// # Example /// - /// ```rust + /// ``` /// # use bevy_tasks::prelude::*; /// # use bevy_tasks::TaskPool; /// let task_pool = TaskPool::new(); diff --git a/crates/bevy_tasks/src/task_pool.rs b/crates/bevy_tasks/src/task_pool.rs index 6b8bcdcf7d..d55a9476b0 100644 --- a/crates/bevy_tasks/src/task_pool.rs +++ b/crates/bevy_tasks/src/task_pool.rs @@ -560,7 +560,7 @@ impl TaskPool { /// the local executor on the main thread as it needs to share time with /// other things. /// - /// ```rust + /// ``` /// use bevy_tasks::TaskPool; /// /// TaskPool::new().with_local_executor(|local_executor| { diff --git a/crates/bevy_tasks/src/thread_executor.rs b/crates/bevy_tasks/src/thread_executor.rs index 81f51b689c..dc989f902c 100644 --- a/crates/bevy_tasks/src/thread_executor.rs +++ b/crates/bevy_tasks/src/thread_executor.rs @@ -10,7 +10,7 @@ use futures_lite::Future; /// can spawn `Send` tasks from other threads. /// /// # Example -/// ```rust +/// ``` /// # use std::sync::{Arc, atomic::{AtomicI32, Ordering}}; /// use bevy_tasks::ThreadExecutor; /// diff --git a/crates/bevy_time/src/common_conditions.rs b/crates/bevy_time/src/common_conditions.rs index 1e4fbc8d5a..3954a5b194 100644 --- a/crates/bevy_time/src/common_conditions.rs +++ b/crates/bevy_time/src/common_conditions.rs @@ -5,7 +5,7 @@ use bevy_utils::Duration; /// Run condition that is active on a regular time interval, using [`Time`] to advance /// the timer. The timer ticks at the rate of [`Time::relative_speed`]. /// -/// ```rust,no_run +/// ```no_run /// # use bevy_app::{App, NoopPluginGroup as DefaultPlugins, PluginGroup, Update}; /// # use bevy_ecs::schedule::IntoSystemConfigs; /// # use bevy_utils::Duration; @@ -41,7 +41,7 @@ pub fn on_timer(duration: Duration) -> impl FnMut(Res