diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs index cf1fafc699cfa..721bfe03eb26f 100644 --- a/crates/bevy_app/src/app.rs +++ b/crates/bevy_app/src/app.rs @@ -318,7 +318,7 @@ impl App { } /// Initializes `T` event handling by inserting an event queue resource ([`Events::`]) - /// and scheduling an [`event_update_system`] in [`First`](crate::First). + /// and scheduling an [`event_update_system`] in [`First`]. /// /// See [`Events`] for information on how to define events. /// diff --git a/crates/bevy_app/src/main_schedule.rs b/crates/bevy_app/src/main_schedule.rs index eedca809e2973..cf1a3c9624aca 100644 --- a/crates/bevy_app/src/main_schedule.rs +++ b/crates/bevy_app/src/main_schedule.rs @@ -17,7 +17,7 @@ use bevy_ecs::{ /// Then it will run: /// * [`First`] /// * [`PreUpdate`] -/// * [`StateTransition`](bevy_state::transition::StateTransition) +/// * [`StateTransition`] /// * [`RunFixedMainLoop`] /// * This will run [`FixedMain`] zero to many times, based on how much time has elapsed. /// * [`Update`] @@ -32,6 +32,7 @@ use bevy_ecs::{ /// /// See [`RenderPlugin`] and [`PipelinedRenderingPlugin`] for more details. /// +/// [`StateTransition`]: https://docs.rs/bevy/latest/bevy/prelude/struct.StateTransition.html /// [`RenderPlugin`]: https://docs.rs/bevy/latest/bevy/render/struct.RenderPlugin.html /// [`PipelinedRenderingPlugin`]: https://docs.rs/bevy/latest/bevy/render/pipelined_rendering/struct.PipelinedRenderingPlugin.html /// [`SubApp`]: crate::SubApp diff --git a/crates/bevy_asset/src/loader.rs b/crates/bevy_asset/src/loader.rs index 3103115e535b0..bd7dda474ebad 100644 --- a/crates/bevy_asset/src/loader.rs +++ b/crates/bevy_asset/src/loader.rs @@ -287,7 +287,7 @@ impl AssetContainer for A { } } -/// An error that occurs when attempting to call [`LoadContext::load_direct`] +/// An error that occurs when attempting to call [`DirectNestedLoader::load`](crate::DirectNestedLoader::load) #[derive(Error, Debug)] #[error("Failed to load dependency {dependency:?} {error}")] pub struct LoadDirectError { diff --git a/crates/bevy_asset/src/loader_builders.rs b/crates/bevy_asset/src/loader_builders.rs index 4cdce4a734e24..27609a411e4cb 100644 --- a/crates/bevy_asset/src/loader_builders.rs +++ b/crates/bevy_asset/src/loader_builders.rs @@ -28,7 +28,7 @@ impl ReaderRef<'_> { /// A builder for loading nested assets inside a `LoadContext`. /// /// # Lifetimes -/// - `ctx`: the lifetime of the associated [`AssetServer`] reference +/// - `ctx`: the lifetime of the associated [`AssetServer`](crate::AssetServer) reference /// - `builder`: the lifetime of the temporary builder structs pub struct NestedLoader<'ctx, 'builder> { load_context: &'builder mut LoadContext<'ctx>, @@ -107,11 +107,14 @@ impl<'ctx, 'builder> NestedLoader<'ctx, 'builder> { } /// Retrieves a handle for the asset at the given path and adds that path as a dependency of the asset. - /// If the current context is a normal [`AssetServer::load`], an actual asset load will be kicked off immediately, which ensures the load happens - /// as soon as possible. - /// "Normal loads" kicked from within a normal Bevy App will generally configure the context to kick off loads immediately. - /// If the current context is configured to not load dependencies automatically (ex: [`AssetProcessor`](crate::processor::AssetProcessor)), - /// a load will not be kicked off automatically. It is then the calling context's responsibility to begin a load if necessary. + /// If the current context is a normal [`AssetServer::load`](crate::AssetServer::load), an actual asset + /// load will be kicked off immediately, which ensures the load happens as soon as possible. + /// "Normal loads" kicked from within a normal Bevy App will generally configure the context to kick off + /// loads immediately. + /// If the current context is configured to not load dependencies automatically + /// (ex: [`AssetProcessor`](crate::processor::AssetProcessor)), + /// a load will not be kicked off automatically. It is then the calling context's responsibility to begin + /// a load if necessary. pub fn load<'c, A: Asset>(self, path: impl Into>) -> Handle { let path = path.into().to_owned(); let handle = if self.load_context.should_load_dependencies { @@ -131,7 +134,7 @@ impl<'ctx, 'builder> NestedLoader<'ctx, 'builder> { /// A builder for loading untyped nested assets inside a [`LoadContext`]. /// /// # Lifetimes -/// - `ctx`: the lifetime of the associated [`AssetServer`] reference +/// - `ctx`: the lifetime of the associated [`AssetServer`](crate::AssetServer) reference /// - `builder`: the lifetime of the temporary builder structs pub struct UntypedNestedLoader<'ctx, 'builder> { base: NestedLoader<'ctx, 'builder>, @@ -163,7 +166,7 @@ impl<'ctx, 'builder> UntypedNestedLoader<'ctx, 'builder> { /// A builder for directly loading nested assets inside a `LoadContext`. /// /// # Lifetimes -/// - `ctx`: the lifetime of the associated [`AssetServer`] reference +/// - `ctx`: the lifetime of the associated [`AssetServer`][crate::AssetServer] reference /// - `builder`: the lifetime of the temporary builder structs /// - `reader`: the lifetime of the [`Reader`] reference used to read the asset data pub struct DirectNestedLoader<'ctx, 'builder, 'reader> { @@ -277,7 +280,7 @@ impl<'ctx: 'reader, 'builder, 'reader> DirectNestedLoader<'ctx, 'builder, 'reade /// A builder for directly loading untyped nested assets inside a `LoadContext`. /// /// # Lifetimes -/// - `ctx`: the lifetime of the associated [`AssetServer`] reference +/// - `ctx`: the lifetime of the associated [`AssetServer`](crate::AssetServer) reference /// - `builder`: the lifetime of the temporary builder structs /// - `reader`: the lifetime of the [`Reader`] reference used to read the asset data pub struct UntypedDirectNestedLoader<'ctx, 'builder, 'reader> { diff --git a/crates/bevy_asset/src/path.rs b/crates/bevy_asset/src/path.rs index 97c84a91b2261..3c23fff5ad712 100644 --- a/crates/bevy_asset/src/path.rs +++ b/crates/bevy_asset/src/path.rs @@ -74,7 +74,7 @@ impl<'a> Display for AssetPath<'a> { } } -/// An error that occurs when parsing a string type to create an [`AssetPath`] fails, such as during [`AssetPath::parse`] or [`AssetPath::from<'static str>`]. +/// An error that occurs when parsing a string type to create an [`AssetPath`] fails, such as during [`AssetPath::parse`]. #[derive(Error, Debug, PartialEq, Eq)] pub enum ParseAssetPathError { /// Error that occurs when the [`AssetPath::source`] section of a path string contains the [`AssetPath::label`] delimiter `#`. E.g. `bad#source://file.test`. diff --git a/crates/bevy_color/src/color.rs b/crates/bevy_color/src/color.rs index 0700f59cc25f0..92fa2b98fd559 100644 --- a/crates/bevy_color/src/color.rs +++ b/crates/bevy_color/src/color.rs @@ -17,7 +17,7 @@ use bevy_reflect::prelude::*; /// # Operations /// /// [`Color`] supports all the standard color operations, such as [mixing](Mix), -/// [luminance](Luminance) and [hue](Hue) adjustment, [clamping](ClampColor), +/// [luminance](Luminance) and [hue](Hue) adjustment, /// and [diffing](EuclideanDistance). These operations delegate to the concrete color space contained /// by [`Color`], but will convert to [`Oklch`](Oklcha) for operations which aren't supported in the /// current space. After performing the operation, if a conversion was required, the result will be diff --git a/crates/bevy_core_pipeline/src/core_3d/main_opaque_pass_3d_node.rs b/crates/bevy_core_pipeline/src/core_3d/main_opaque_pass_3d_node.rs index 29fcc7d8464e3..dfd6fcc06feab 100644 --- a/crates/bevy_core_pipeline/src/core_3d/main_opaque_pass_3d_node.rs +++ b/crates/bevy_core_pipeline/src/core_3d/main_opaque_pass_3d_node.rs @@ -17,9 +17,8 @@ use bevy_utils::tracing::info_span; use super::AlphaMask3d; -/// A [`bevy_render::render_graph::Node`] that runs the [`Opaque3d`] -/// [`BinnedRenderPhase`] and [`AlphaMask3d`] -/// [`bevy_render::render_phase::SortedRenderPhase`]s. +/// A [`bevy_render::render_graph::Node`] that runs the [`Opaque3d`] and [`AlphaMask3d`] +/// [`ViewBinnedRenderPhases`]s. #[derive(Default)] pub struct MainOpaquePass3dNode; impl ViewNode for MainOpaquePass3dNode { diff --git a/crates/bevy_core_pipeline/src/core_3d/main_transmissive_pass_3d_node.rs b/crates/bevy_core_pipeline/src/core_3d/main_transmissive_pass_3d_node.rs index 32aef340a8e06..dadc4e0744793 100644 --- a/crates/bevy_core_pipeline/src/core_3d/main_transmissive_pass_3d_node.rs +++ b/crates/bevy_core_pipeline/src/core_3d/main_transmissive_pass_3d_node.rs @@ -14,7 +14,7 @@ use bevy_utils::tracing::info_span; use std::ops::Range; /// A [`bevy_render::render_graph::Node`] that runs the [`Transmissive3d`] -/// [`SortedRenderPhase`]. +/// [`ViewSortedRenderPhases`]. #[derive(Default)] pub struct MainTransmissivePass3dNode; diff --git a/crates/bevy_core_pipeline/src/core_3d/main_transparent_pass_3d_node.rs b/crates/bevy_core_pipeline/src/core_3d/main_transparent_pass_3d_node.rs index a95a0519c2dc6..4ab8a697e393d 100644 --- a/crates/bevy_core_pipeline/src/core_3d/main_transparent_pass_3d_node.rs +++ b/crates/bevy_core_pipeline/src/core_3d/main_transparent_pass_3d_node.rs @@ -13,7 +13,7 @@ use bevy_render::{ use bevy_utils::tracing::info_span; /// A [`bevy_render::render_graph::Node`] that runs the [`Transparent3d`] -/// [`SortedRenderPhase`]. +/// [`ViewSortedRenderPhases`]. #[derive(Default)] pub struct MainTransparentPass3dNode; diff --git a/crates/bevy_core_pipeline/src/smaa/mod.rs b/crates/bevy_core_pipeline/src/smaa/mod.rs index 1da7f36c186f8..464f5fd52d402 100644 --- a/crates/bevy_core_pipeline/src/smaa/mod.rs +++ b/crates/bevy_core_pipeline/src/smaa/mod.rs @@ -15,7 +15,7 @@ //! pinch, you can simply use the default settings (via the [`Default`] trait) //! for a high-quality, high-performance appearance. When using SMAA, you will //! likely want to turn the default MSAA off by inserting the -//! [`bevy_render::Msaa::Off`] resource into the [`App`]. +//! [`bevy_render::view::Msaa::Off`] resource into the [`App`]. //! //! Those who have used SMAA in other engines should be aware that Bevy doesn't //! yet support the following more advanced features of SMAA: diff --git a/crates/bevy_ecs/macros/src/world_query.rs b/crates/bevy_ecs/macros/src/world_query.rs index 8675458cdf06b..42fd8ccb59643 100644 --- a/crates/bevy_ecs/macros/src/world_query.rs +++ b/crates/bevy_ecs/macros/src/world_query.rs @@ -20,7 +20,7 @@ pub(crate) fn item_struct( user_where_clauses_with_world: Option<&WhereClause>, ) -> proc_macro2::TokenStream { let item_attrs = quote!( - #[doc = "Automatically generated [`WorldQuery`] item type for [`"] + #[doc = "Automatically generated [`WorldQuery`](#path::query::WorldQuery) item type for [`"] #[doc = stringify!(#struct_name)] #[doc = "`], returned when iterating over query results."] #[automatically_derived] diff --git a/crates/bevy_ecs/src/entity/map_entities.rs b/crates/bevy_ecs/src/entity/map_entities.rs index 65f94fc452571..8283e55e95204 100644 --- a/crates/bevy_ecs/src/entity/map_entities.rs +++ b/crates/bevy_ecs/src/entity/map_entities.rs @@ -192,9 +192,8 @@ impl<'m> SceneEntityMapper<'m> { } /// Reserves the allocated references to dead entities within the world. This frees the temporary base - /// [`Entity`] while reserving extra generations via [`crate::entity::Entities::reserve_generations`]. Because this - /// renders the [`SceneEntityMapper`] unable to safely allocate any more references, this method takes ownership of - /// `self` in order to render it unusable. + /// [`Entity`] while reserving extra generations. Because this makes the [`SceneEntityMapper`] unable to + /// safely allocate any more references, this method takes ownership of `self` in order to render it unusable. pub fn finish(self, world: &mut World) { // SAFETY: Entities data is kept in a valid state via `EntityMap::world_scope` let entities = unsafe { world.entities_mut() }; diff --git a/crates/bevy_ecs/src/event/base.rs b/crates/bevy_ecs/src/event/base.rs index acc830da447bd..f31f9b7c0cb30 100644 --- a/crates/bevy_ecs/src/event/base.rs +++ b/crates/bevy_ecs/src/event/base.rs @@ -26,6 +26,9 @@ use std::{ /// [`World`]: crate::world::World /// [`ComponentId`]: crate::component::ComponentId /// [`Observer`]: crate::observer::Observer +/// [`Events`]: super::Events +/// [`EventReader`]: super::EventReader +/// [`EventWriter`]: super::EventWriter #[diagnostic::on_unimplemented( message = "`{Self}` is not an `Event`", label = "invalid `Event`", diff --git a/crates/bevy_ecs/src/event/collections.rs b/crates/bevy_ecs/src/event/collections.rs index 6a5f88b6e0a99..3f5417d50027e 100644 --- a/crates/bevy_ecs/src/event/collections.rs +++ b/crates/bevy_ecs/src/event/collections.rs @@ -81,6 +81,9 @@ use std::ops::{Deref, DerefMut}; /// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/ecs/event.rs) /// [Example usage standalone.](https://github.com/bevyengine/bevy/blob/latest/crates/bevy_ecs/examples/events.rs) /// +/// [`EventReader`]: super::EventReader +/// [`EventWriter`]: super::EventWriter +/// [`event_update_system`]: super::event_update_system #[derive(Debug, Resource)] #[cfg_attr(feature = "bevy_reflect", derive(Reflect))] pub struct Events { @@ -111,8 +114,8 @@ impl Events { .min(self.events_b.start_event_count) } - /// "Sends" an `event` by writing it to the current event buffer. [`EventReader`]s can then read - /// the event. + /// "Sends" an `event` by writing it to the current event buffer. + /// [`EventReader`](super::EventReader)s can then read the event. /// This method returns the [ID](`EventId`) of the sent `event`. pub fn send(&mut self, event: E) -> EventId { let event_id = EventId { @@ -129,7 +132,7 @@ impl Events { event_id } - /// Sends a list of `events` all at once, which can later be read by [`EventReader`]s. + /// Sends a list of `events` all at once, which can later be read by [`EventReader`](super::EventReader)s. /// This is more efficient than sending each event individually. /// This method returns the [IDs](`EventId`) of the sent `events`. pub fn send_batch(&mut self, events: impl IntoIterator) -> SendBatchIds { @@ -263,6 +266,8 @@ impl Events { /// between the last `update()` call and your call to `iter_current_update_events`. /// If events happen outside that window, they will not be handled. For example, any events that /// happen after this call and before the next `update()` call will be dropped. + /// + /// [`EventReader`]: super::EventReader pub fn iter_current_update_events(&self) -> impl ExactSizeIterator { self.events_b.iter().map(|i| &i.event) } diff --git a/crates/bevy_ecs/src/event/event_cursor.rs b/crates/bevy_ecs/src/event/event_cursor.rs index 1081298cf4e25..4868197712a6e 100644 --- a/crates/bevy_ecs/src/event/event_cursor.rs +++ b/crates/bevy_ecs/src/event/event_cursor.rs @@ -58,6 +58,9 @@ pub type ManualEventReader = EventCursor; /// /// # bevy_ecs::system::assert_is_system(send_and_receive_events); /// ``` +/// +/// [`EventReader`]: super::EventReader +/// [`EventMutator`]: super::EventMutator #[derive(Debug)] pub struct EventCursor { pub(super) last_event_count: usize, @@ -84,22 +87,22 @@ impl Clone for EventCursor { #[allow(clippy::len_without_is_empty)] // Check fails since the is_empty implementation has a signature other than `(&self) -> bool` impl EventCursor { - /// See [`EventReader::read`] + /// See [`EventReader::read`](super::EventReader::read) pub fn read<'a>(&'a mut self, events: &'a Events) -> EventIterator<'a, E> { self.read_with_id(events).without_id() } - /// See [`EventMutator::read`] + /// See [`EventMutator::read`](super::EventMutator::read) pub fn read_mut<'a>(&'a mut self, events: &'a mut Events) -> EventMutIterator<'a, E> { self.read_mut_with_id(events).without_id() } - /// See [`EventReader::read_with_id`] + /// See [`EventReader::read_with_id`](super::EventReader::read_with_id) pub fn read_with_id<'a>(&'a mut self, events: &'a Events) -> EventIteratorWithId<'a, E> { EventIteratorWithId::new(self, events) } - /// See [`EventMutator::read_with_id`] + /// See [`EventMutator::read_with_id`](super::EventMutator::read_with_id) pub fn read_mut_with_id<'a>( &'a mut self, events: &'a mut Events, @@ -107,19 +110,19 @@ impl EventCursor { EventMutIteratorWithId::new(self, events) } - /// See [`EventReader::par_read`] + /// See [`EventReader::par_read`](super::EventReader::par_read) #[cfg(feature = "multi_threaded")] pub fn par_read<'a>(&'a mut self, events: &'a Events) -> EventParIter<'a, E> { EventParIter::new(self, events) } - /// See [`EventMutator::par_read`] + /// See [`EventMutator::par_read`](super::EventMutator::par_read) #[cfg(feature = "multi_threaded")] pub fn par_read_mut<'a>(&'a mut self, events: &'a mut Events) -> EventMutParIter<'a, E> { EventMutParIter::new(self, events) } - /// See [`EventReader::len`] + /// See [`EventReader::len`](super::EventReader::len) pub fn len(&self, events: &Events) -> usize { // The number of events in this reader is the difference between the most recent event // and the last event seen by it. This will be at most the number of events contained @@ -138,12 +141,12 @@ impl EventCursor { .saturating_sub(self.last_event_count) } - /// See [`EventReader::is_empty()`] + /// See [`EventReader::is_empty()`](super::EventReader::is_empty) pub fn is_empty(&self, events: &Events) -> bool { self.len(events) == 0 } - /// See [`EventReader::clear()`] + /// See [`EventReader::clear()`](super::EventReader::clear) pub fn clear(&mut self, events: &Events) { self.last_event_count = events.event_count; } diff --git a/crates/bevy_ecs/src/event/iterators.rs b/crates/bevy_ecs/src/event/iterators.rs index 843a01509ecba..df1f9aae621d9 100644 --- a/crates/bevy_ecs/src/event/iterators.rs +++ b/crates/bevy_ecs/src/event/iterators.rs @@ -5,7 +5,7 @@ use bevy_ecs::event::{Event, EventCursor, EventId, EventInstance, Events}; use bevy_utils::detailed_trace; use std::{iter::Chain, slice::Iter}; -/// An iterator that yields any unread events from an [`EventReader`] or [`EventCursor`]. +/// An iterator that yields any unread events from an [`EventReader`](super::EventReader) or [`EventCursor`]. #[derive(Debug)] pub struct EventIterator<'a, E: Event> { iter: EventIteratorWithId<'a, E>, @@ -43,7 +43,7 @@ impl<'a, E: Event> ExactSizeIterator for EventIterator<'a, E> { } } -/// An iterator that yields any unread events (and their IDs) from an [`EventReader`] or [`EventCursor`]. +/// An iterator that yields any unread events (and their IDs) from an [`EventReader`](super::EventReader) or [`EventCursor`]. #[derive(Debug)] pub struct EventIteratorWithId<'a, E: Event> { reader: &'a mut EventCursor, diff --git a/crates/bevy_ecs/src/event/mut_iterators.rs b/crates/bevy_ecs/src/event/mut_iterators.rs index 677ae2e1067aa..490503af7eb53 100644 --- a/crates/bevy_ecs/src/event/mut_iterators.rs +++ b/crates/bevy_ecs/src/event/mut_iterators.rs @@ -6,6 +6,8 @@ use bevy_utils::detailed_trace; use std::{iter::Chain, slice::IterMut}; /// An iterator that yields any unread events from an [`EventMutator`] or [`EventCursor`]. +/// +/// [`EventMutator`]: super::EventMutator #[derive(Debug)] pub struct EventMutIterator<'a, E: Event> { iter: EventMutIteratorWithId<'a, E>, @@ -44,6 +46,8 @@ impl<'a, E: Event> ExactSizeIterator for EventMutIterator<'a, E> { } /// An iterator that yields any unread events (and their IDs) from an [`EventMutator`] or [`EventCursor`]. +/// +/// [`EventMutator`]: super::EventMutator #[derive(Debug)] pub struct EventMutIteratorWithId<'a, E: Event> { mutator: &'a mut EventCursor, diff --git a/crates/bevy_ecs/src/event/mutator.rs b/crates/bevy_ecs/src/event/mutator.rs index bf518a2768eb8..faa350138f5eb 100644 --- a/crates/bevy_ecs/src/event/mutator.rs +++ b/crates/bevy_ecs/src/event/mutator.rs @@ -40,6 +40,8 @@ use bevy_ecs::{ /// Most of the time systems will want to use [`EventMutator::read()`]. This function creates an iterator over /// all events that haven't been read yet by this system, marking the event as read in the process. /// +/// [`EventReader`]: super::EventReader +/// [`EventWriter`]: super::EventWriter #[derive(SystemParam, Debug)] pub struct EventMutator<'w, 's, E: Event> { pub(super) reader: Local<'s, EventCursor>, @@ -54,13 +56,13 @@ impl<'w, 's, E: Event> EventMutator<'w, 's, E> { self.reader.read_mut(&mut self.events) } - /// Like [`read`](Self::read), except also returning the [`EventId`] of the events. + /// Like [`read`](Self::read), except also returning the [`EventId`](super::EventId) of the events. pub fn read_with_id(&mut self) -> EventMutIteratorWithId<'_, E> { self.reader.read_mut_with_id(&mut self.events) } /// Returns a parallel iterator over the events this [`EventMutator`] has not seen yet. - /// See also [`for_each`](EventParIter::for_each). + /// See also [`for_each`](super::EventParIter::for_each). /// /// # Example /// ``` diff --git a/crates/bevy_ecs/src/event/reader.rs b/crates/bevy_ecs/src/event/reader.rs index 08b08796591e6..f816978a64696 100644 --- a/crates/bevy_ecs/src/event/reader.rs +++ b/crates/bevy_ecs/src/event/reader.rs @@ -12,6 +12,8 @@ use bevy_ecs::{ /// /// Unlike [`EventWriter`], systems with `EventReader` param can be executed concurrently /// (but not concurrently with `EventWriter` or `EventMutator` systems for the same event type). +/// +/// [`EventWriter`]: super::EventWriter #[derive(SystemParam, Debug)] pub struct EventReader<'w, 's, E: Event> { pub(super) reader: Local<'s, EventCursor>, @@ -26,7 +28,7 @@ impl<'w, 's, E: Event> EventReader<'w, 's, E> { self.reader.read(&self.events) } - /// Like [`read`](Self::read), except also returning the [`EventId`] of the events. + /// Like [`read`](Self::read), except also returning the [`EventId`](super::EventId) of the events. pub fn read_with_id(&mut self) -> EventIteratorWithId<'_, E> { self.reader.read_with_id(&self.events) } diff --git a/crates/bevy_ecs/src/event/update.rs b/crates/bevy_ecs/src/event/update.rs index 535c3092445a7..09bdc49ae1237 100644 --- a/crates/bevy_ecs/src/event/update.rs +++ b/crates/bevy_ecs/src/event/update.rs @@ -26,7 +26,7 @@ pub fn signal_event_update_system(signal: Option>) { } } -/// A system that calls [`Events::update`] on all registered [`Events`] in the world. +/// A system that calls [`Events::update`](super::Events::update) on all registered [`Events`][super::Events] in the world. pub fn event_update_system(world: &mut World, mut last_change_tick: Local) { if world.contains_resource::() { world.resource_scope(|world, mut registry: Mut| { diff --git a/crates/bevy_ecs/src/event/writer.rs b/crates/bevy_ecs/src/event/writer.rs index 0ba8d80778452..99f31881b293c 100644 --- a/crates/bevy_ecs/src/event/writer.rs +++ b/crates/bevy_ecs/src/event/writer.rs @@ -65,7 +65,7 @@ pub struct EventWriter<'w, E: Event> { } impl<'w, E: Event> EventWriter<'w, E> { - /// Sends an `event`, which can later be read by [`EventReader`]s. + /// Sends an `event`, which can later be read by [`EventReader`](super::EventReader)s. /// This method returns the [ID](`EventId`) of the sent `event`. /// /// See [`Events`] for details. @@ -73,7 +73,7 @@ impl<'w, E: Event> EventWriter<'w, E> { self.events.send(event) } - /// Sends a list of `events` all at once, which can later be read by [`EventReader`]s. + /// Sends a list of `events` all at once, which can later be read by [`EventReader`](super::EventReader)s. /// This is more efficient than sending each event individually. /// This method returns the [IDs](`EventId`) of the sent `events`. /// diff --git a/crates/bevy_ecs/src/observer/runner.rs b/crates/bevy_ecs/src/observer/runner.rs index 40092be5539c7..f68441f270fcf 100644 --- a/crates/bevy_ecs/src/observer/runner.rs +++ b/crates/bevy_ecs/src/observer/runner.rs @@ -84,7 +84,7 @@ impl Component for ObserverState { } /// Type for function that is run when an observer is triggered. -/// Typically refers to the default runner that runs the system stored in the associated [`ObserverSystemComponent`], +/// Typically refers to the default runner that runs the system stored in the associated [`Observer`] component, /// but can be overridden for custom behaviour. pub type ObserverRunner = fn(DeferredWorld, ObserverTrigger, PtrMut); @@ -390,7 +390,7 @@ fn observer_system_runner( // This transmute is obviously not ideal, but it is safe. Ideally we can remove the // static constraint from ObserverSystem, but so far we have not found a way. let trigger: Trigger<'static, E, B> = unsafe { std::mem::transmute(trigger) }; - // SAFETY: Observer was triggered so must have an `ObserverSystemComponent` + // SAFETY: Observer was triggered so must have an `Observer` component. let system = unsafe { &mut observer_cell .get_mut::>() diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs index 246cdf6da42d2..39284356ed632 100644 --- a/crates/bevy_ecs/src/system/commands/mod.rs +++ b/crates/bevy_ecs/src/system/commands/mod.rs @@ -750,12 +750,16 @@ impl<'w, 's> Commands<'w, 's> { /// Sends a "global" [`Trigger`] without any targets. This will run any [`Observer`] of the `event` that /// isn't scoped to specific targets. + /// + /// [`Trigger`]: crate::observer::Trigger pub fn trigger(&mut self, event: impl Event) { self.add(TriggerEvent { event, targets: () }); } /// Sends a [`Trigger`] for the given targets. This will run any [`Observer`] of the `event` that /// watches those targets. + /// + /// [`Trigger`]: crate::observer::Trigger pub fn trigger_targets(&mut self, event: impl Event, targets: impl TriggerTargets) { self.add(TriggerEvent { event, targets }); } @@ -1144,7 +1148,7 @@ impl EntityCommands<'_> { self.commands.reborrow() } - /// Creates an [`Observer`](crate::observer::Observer) listening for a trigger of type `T` that targets this entity. + /// Creates an [`Observer`] listening for a trigger of type `T` that targets this entity. pub fn observe( &mut self, system: impl IntoObserverSystem, diff --git a/crates/bevy_ecs/src/system/observer_system.rs b/crates/bevy_ecs/src/system/observer_system.rs index 0e13100f68d9b..fdd3f36dd5058 100644 --- a/crates/bevy_ecs/src/system/observer_system.rs +++ b/crates/bevy_ecs/src/system/observer_system.rs @@ -8,6 +8,8 @@ use crate::{ use super::IntoSystem; /// Implemented for systems that have an [`Observer`] as the first argument. +/// +/// [`Observer`]: crate::observer::Observer pub trait ObserverSystem: System, Out = ()> + Send + 'static { diff --git a/crates/bevy_ecs/src/world/deferred_world.rs b/crates/bevy_ecs/src/world/deferred_world.rs index 4147d3644f3ae..9d0350abf268b 100644 --- a/crates/bevy_ecs/src/world/deferred_world.rs +++ b/crates/bevy_ecs/src/world/deferred_world.rs @@ -368,12 +368,12 @@ impl<'w> DeferredWorld<'w> { Observers::invoke(self.reborrow(), event, entity, components, data); } - /// Sends a "global" [`Trigger`] without any targets. + /// Sends a "global" [`Trigger`](crate::observer::Trigger) without any targets. pub fn trigger(&mut self, trigger: impl Event) { self.commands().trigger(trigger); } - /// Sends a [`Trigger`] with the given `targets`. + /// Sends a [`Trigger`](crate::observer::Trigger) with the given `targets`. pub fn trigger_targets(&mut self, trigger: impl Event, targets: impl TriggerTargets) { self.commands().trigger_targets(trigger, targets); } diff --git a/crates/bevy_ecs/src/world/entity_ref.rs b/crates/bevy_ecs/src/world/entity_ref.rs index 2d1073e0fd09f..0158b05f4b1b6 100644 --- a/crates/bevy_ecs/src/world/entity_ref.rs +++ b/crates/bevy_ecs/src/world/entity_ref.rs @@ -1410,7 +1410,7 @@ impl<'w> EntityWorldMut<'w> { } } - /// Creates an [`Observer`](crate::observer::Observer) listening for events of type `E` targeting this entity. + /// Creates an [`Observer`] listening for events of type `E` targeting this entity. /// In order to trigger the callback the entity must also match the query when the event is fired. pub fn observe( &mut self, diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs index 336ed2e85bf93..bf4cf166727a3 100644 --- a/crates/bevy_ecs/src/world/mod.rs +++ b/crates/bevy_ecs/src/world/mod.rs @@ -812,8 +812,8 @@ impl World { unsafe { self.get_entities_dynamic_mut_unchecked(entities.iter().copied()) } } - /// Gets mutable access to multiple entities, contained in a [`HashSet`]. - /// The uniqueness of items in a [`HashSet`] allows us to avoid checking for duplicates. + /// Gets mutable access to multiple entities, contained in a [`EntityHashSet`]. + /// The uniqueness of items in a [`EntityHashSet`] allows us to avoid checking for duplicates. /// /// # Errors /// @@ -2037,7 +2037,7 @@ impl World { } } - /// Calls both [`World::flush_entities`] and [`World::flush_commands`]. + /// Flushes queued entities and calls [`World::flush_commands`]. #[inline] pub fn flush(&mut self) { self.flush_entities(); diff --git a/crates/bevy_gizmos/src/circles.rs b/crates/bevy_gizmos/src/circles.rs index 9f3c485753d7c..216105240da3b 100644 --- a/crates/bevy_gizmos/src/circles.rs +++ b/crates/bevy_gizmos/src/circles.rs @@ -306,7 +306,7 @@ where } } -/// Builder for configuring the drawing options of [`Sphere`]. +/// A builder returned by [`Gizmos::sphere`]. pub struct SphereBuilder<'a, 'w, 's, Config, Clear> where Config: GizmoConfigGroup, diff --git a/crates/bevy_internal/src/default_plugins.rs b/crates/bevy_internal/src/default_plugins.rs index 5412084381508..88f92f38e7456 100644 --- a/crates/bevy_internal/src/default_plugins.rs +++ b/crates/bevy_internal/src/default_plugins.rs @@ -29,7 +29,7 @@ use bevy_app::{Plugin, PluginGroup, PluginGroupBuilder}; /// * [`GilrsPlugin`](crate::gilrs::GilrsPlugin) - with feature `bevy_gilrs` /// * [`AnimationPlugin`](crate::animation::AnimationPlugin) - with feature `bevy_animation` /// * [`GizmoPlugin`](crate::gizmos::GizmoPlugin) - with feature `bevy_gizmos` -/// * [`StatesPlugin`](crate::app::StatesPlugin) - with feature `bevy_state` +/// * [`StatesPlugin`](crate::state::app::StatesPlugin) - with feature `bevy_state` /// * [`DevToolsPlugin`](crate::dev_tools::DevToolsPlugin) - with feature `bevy_dev_tools` /// * [`CiTestingPlugin`](crate::dev_tools::ci_testing::CiTestingPlugin) - with feature `bevy_ci_testing` /// diff --git a/crates/bevy_log/src/lib.rs b/crates/bevy_log/src/lib.rs index 4c576a4e6f376..f1febadba6d7d 100644 --- a/crates/bevy_log/src/lib.rs +++ b/crates/bevy_log/src/lib.rs @@ -147,8 +147,8 @@ pub struct LogPlugin { /// /// Because [`BoxedLayer`] takes a `dyn Layer`, `Vec` is also an acceptable return value. /// - /// Access to [`App`] is also provided to allow for communication between the [`Subscriber`] - /// and the [`App`]. + /// Access to [`App`] is also provided to allow for communication between the + /// [`Subscriber`](bevy_utils::tracing::Subscriber) and the [`App`]. /// /// Please see the `examples/log_layers.rs` for a complete example. pub custom_layer: fn(app: &mut App) -> Option, diff --git a/crates/bevy_math/src/bounding/raycast3d.rs b/crates/bevy_math/src/bounding/raycast3d.rs index 24b28e2774ebd..c69b790a79bf9 100644 --- a/crates/bevy_math/src/bounding/raycast3d.rs +++ b/crates/bevy_math/src/bounding/raycast3d.rs @@ -19,7 +19,7 @@ pub struct RayCast3d { } impl RayCast3d { - /// Construct a [`RayCast3d`] from an origin, [`Dir3`], and max distance. + /// Construct a [`RayCast3d`] from an origin, [`Dir3A`], and max distance. pub fn new(origin: impl Into, direction: impl Into, max: f32) -> Self { let direction = direction.into(); Self { @@ -108,7 +108,7 @@ pub struct AabbCast3d { } impl AabbCast3d { - /// Construct an [`AabbCast3d`] from an [`Aabb3d`], origin, [`Dir3`], and max distance. + /// Construct an [`AabbCast3d`] from an [`Aabb3d`], origin, [`Dir3A`], and max distance. pub fn new( aabb: Aabb3d, origin: impl Into, @@ -151,7 +151,7 @@ pub struct BoundingSphereCast { } impl BoundingSphereCast { - /// Construct a [`BoundingSphereCast`] from a [`BoundingSphere`], origin, [`Dir3`], and max distance. + /// Construct a [`BoundingSphereCast`] from a [`BoundingSphere`], origin, [`Dir3A`], and max distance. pub fn new( sphere: BoundingSphere, origin: impl Into, diff --git a/crates/bevy_math/src/compass.rs b/crates/bevy_math/src/compass.rs index ed1d4b947f248..244c37962eb4d 100644 --- a/crates/bevy_math/src/compass.rs +++ b/crates/bevy_math/src/compass.rs @@ -5,7 +5,7 @@ use bevy_reflect::Reflect; use bevy_reflect::{ReflectDeserialize, ReflectSerialize}; /// A compass enum with 4 directions. -/// ``` ignore +/// ```text /// N (North) /// ▲ /// │ @@ -35,7 +35,7 @@ pub enum CompassQuadrant { } /// A compass enum with 8 directions. -/// ``` ignore +/// ```text /// N (North) /// ▲ /// NW │ NE diff --git a/crates/bevy_pbr/src/lib.rs b/crates/bevy_pbr/src/lib.rs index 27b47dccc7e4d..dfe65a0ffe446 100644 --- a/crates/bevy_pbr/src/lib.rs +++ b/crates/bevy_pbr/src/lib.rs @@ -16,7 +16,8 @@ pub mod wireframe; /// Expect bugs, missing features, compatibility issues, low performance, and/or future breaking changes. #[cfg(feature = "meshlet")] pub mod experimental { - /// Render high-poly 3d meshes using an efficient GPU-driven method. See [`MeshletPlugin`] and [`MeshletMesh`] for details. + /// Render high-poly 3d meshes using an efficient GPU-driven method. + /// See [`MeshletPlugin`](meshlet::MeshletPlugin) and [`MeshletMesh`](meshlet::MeshletMesh) for details. pub mod meshlet { pub use crate::meshlet::*; } diff --git a/crates/bevy_pbr/src/pbr_material.rs b/crates/bevy_pbr/src/pbr_material.rs index d6277ae00139b..916a1f098ccd2 100644 --- a/crates/bevy_pbr/src/pbr_material.rs +++ b/crates/bevy_pbr/src/pbr_material.rs @@ -12,7 +12,8 @@ use crate::*; /// An enum to define which UV attribute to use for a texture. /// It is used for every texture in the [`StandardMaterial`]. -/// It only supports two UV attributes, [`Mesh::ATTRIBUTE_UV_0`] and [`Mesh::ATTRIBUTE_UV_1`]. +/// It only supports two UV attributes, [`bevy_render::mesh::Mesh::ATTRIBUTE_UV_0`] and +/// [`bevy_render::mesh::Mesh::ATTRIBUTE_UV_1`]. /// The default is [`UvChannel::Uv0`]. #[derive(Reflect, Default, Debug, Clone, PartialEq, Eq)] #[reflect(Default, Debug)] diff --git a/crates/bevy_pbr/src/render/mesh.rs b/crates/bevy_pbr/src/render/mesh.rs index 949e747e1b2f3..8432cbd97d749 100644 --- a/crates/bevy_pbr/src/render/mesh.rs +++ b/crates/bevy_pbr/src/render/mesh.rs @@ -505,11 +505,11 @@ pub enum RenderMeshInstanceGpuQueue { #[default] None, /// The version of [`RenderMeshInstanceGpuQueue`] that omits the - /// [`MeshCullingDataGpuBuilder`], so that we don't waste space when GPU + /// [`MeshCullingData`], so that we don't waste space when GPU /// culling is disabled. CpuCulling(Vec<(Entity, RenderMeshInstanceGpuBuilder)>), /// The version of [`RenderMeshInstanceGpuQueue`] that contains the - /// [`MeshCullingDataGpuBuilder`], used when any view has GPU culling + /// [`MeshCullingData`], used when any view has GPU culling /// enabled. GpuCulling(Vec<(Entity, RenderMeshInstanceGpuBuilder, MeshCullingData)>), } diff --git a/crates/bevy_pbr/src/render/skin.rs b/crates/bevy_pbr/src/render/skin.rs index 0f7cc7a9f3cb4..86f702ea491d3 100644 --- a/crates/bevy_pbr/src/render/skin.rs +++ b/crates/bevy_pbr/src/render/skin.rs @@ -23,7 +23,7 @@ pub struct SkinIndex { } impl SkinIndex { - /// Index to be in address space based on [`SkinUniform`] size. + /// Index to be in address space based on the size of a skin uniform. const fn new(start: usize) -> Self { SkinIndex { index: (start * std::mem::size_of::()) as u32, diff --git a/crates/bevy_pbr/src/volumetric_fog/mod.rs b/crates/bevy_pbr/src/volumetric_fog/mod.rs index 170d38cb21f23..d4dbbd3afeee1 100644 --- a/crates/bevy_pbr/src/volumetric_fog/mod.rs +++ b/crates/bevy_pbr/src/volumetric_fog/mod.rs @@ -84,7 +84,7 @@ pub const VOLUMETRIC_FOG_HANDLE: Handle = Handle::weak_from_u128(1740005 /// A plugin that implements volumetric fog. pub struct VolumetricFogPlugin; -/// Add this component to a [`DirectionalLight`] with a shadow map +/// Add this component to a [`DirectionalLight`](crate::DirectionalLight) with a shadow map /// (`shadows_enabled: true`) to make volumetric fog interact with it. /// /// This allows the light to generate light shafts/god rays. diff --git a/crates/bevy_picking/src/lib.rs b/crates/bevy_picking/src/lib.rs index e19b9ce415dca..4063b34d7121b 100644 --- a/crates/bevy_picking/src/lib.rs +++ b/crates/bevy_picking/src/lib.rs @@ -26,6 +26,8 @@ impl PickingPluginsSettings { pub fn input_should_run(state: Res) -> bool { state.is_input_enabled && state.is_enabled } + // TODO: remove this allow after focus/hover is implemented in bevy_picking + #[allow(rustdoc::broken_intra_doc_links)] /// Whether or not systems updating entities' [`PickingInteraction`](focus::PickingInteraction) /// component should be running. pub fn focus_should_run(state: Res) -> bool { @@ -70,6 +72,8 @@ pub struct Pickable { /// /// Entities without the [`Pickable`] component will block by default. pub should_block_lower: bool, + // TODO: remove this allow after focus/hover is implemented in bevy_picking + #[allow(rustdoc::broken_intra_doc_links)] /// Should this entity be added to the [`HoverMap`](focus::HoverMap) and thus emit events when /// targeted? /// diff --git a/crates/bevy_reflect/src/attributes.rs b/crates/bevy_reflect/src/attributes.rs index 9fb2e694e4a31..a567b71716487 100644 --- a/crates/bevy_reflect/src/attributes.rs +++ b/crates/bevy_reflect/src/attributes.rs @@ -7,7 +7,7 @@ use std::any::TypeId; /// /// These attributes can be created with the [`Reflect` derive macro]. /// -/// Attributes are stored by their [`TypeId`](std::any::TypeId). +/// Attributes are stored by their [`TypeId`]. /// Because of this, there can only be one attribute per type. /// /// # Example @@ -150,6 +150,7 @@ macro_rules! impl_custom_attribute_methods { $self.custom_attributes().get::() } + #[allow(rustdoc::redundant_explicit_links)] /// Gets a custom attribute by its [`TypeId`](std::any::TypeId). /// /// This is the dynamic equivalent of [`get_attribute`](Self::get_attribute). diff --git a/crates/bevy_reflect/src/func/args/info.rs b/crates/bevy_reflect/src/func/args/info.rs index b7330dedb2f9b..baf85e0207918 100644 --- a/crates/bevy_reflect/src/func/args/info.rs +++ b/crates/bevy_reflect/src/func/args/info.rs @@ -5,8 +5,8 @@ use crate::TypePath; /// Type information for an [`Arg`] used in a [`DynamicFunction`]. /// -/// [`Arg`]: crate::func::args::Arg -/// [`DynamicFunction`]: super::function::DynamicFunction +/// [`Arg`]: crate::func::Arg +/// [`DynamicFunction`]: crate::func::DynamicFunction #[derive(Debug, Clone)] pub struct ArgInfo { /// The index of the argument within its function. @@ -57,6 +57,7 @@ impl ArgInfo { /// For [`DynamicFunctions`] created using [`IntoFunction`], the name will always be `None`. /// /// [`DynamicFunctions`]: crate::func::DynamicFunction + /// [`IntoFunction`]: crate::func::IntoFunction pub fn name(&self) -> Option<&str> { self.name.as_deref() } diff --git a/crates/bevy_reflect/src/func/info.rs b/crates/bevy_reflect/src/func/info.rs index 2e4c985cf2f73..49c0789c58551 100644 --- a/crates/bevy_reflect/src/func/info.rs +++ b/crates/bevy_reflect/src/func/info.rs @@ -56,6 +56,7 @@ impl FunctionInfo { /// the name will always be the full path to the function as returned by [`std::any::type_name`]. /// /// [`DynamicFunctions`]: crate::func::DynamicFunction + /// [`IntoFunction`]: crate::func::IntoFunction pub fn name(&self) -> Option<&str> { self.name.as_deref() } diff --git a/crates/bevy_render/src/mesh/primitives/mod.rs b/crates/bevy_render/src/mesh/primitives/mod.rs index c33ead4c1a2a7..bd6338c691bcf 100644 --- a/crates/bevy_render/src/mesh/primitives/mod.rs +++ b/crates/bevy_render/src/mesh/primitives/mod.rs @@ -1,8 +1,8 @@ //! Mesh generation for [primitive shapes](bevy_math::primitives). //! //! Primitives that support meshing implement the [`Meshable`] trait. -//! Calling [`mesh`](Meshable::mesh) will return either a [`Mesh`](super::Mesh) or a builder -//! that can be used to specify shape-specific configuration for creating the [`Mesh`](super::Mesh). +//! Calling [`mesh`](Meshable::mesh) will return either a [`Mesh`] or a builder +//! that can be used to specify shape-specific configuration for creating the [`Mesh`]. //! //! ``` //! # use bevy_asset::Assets; @@ -30,12 +30,12 @@ pub use extrusion::*; use super::Mesh; -/// A trait for shapes that can be turned into a [`Mesh`](super::Mesh). +/// A trait for shapes that can be turned into a [`Mesh`]. pub trait Meshable { - /// The output of [`Self::mesh`]. This will be a [`MeshBuilder`] used for creating a [`Mesh`](super::Mesh). + /// The output of [`Self::mesh`]. This will be a [`MeshBuilder`] used for creating a [`Mesh`]. type Output: MeshBuilder; - /// Creates a [`Mesh`](super::Mesh) for a shape. + /// Creates a [`Mesh`] for a shape. fn mesh(&self) -> Self::Output; } diff --git a/crates/bevy_render/src/render_graph/context.rs b/crates/bevy_render/src/render_graph/context.rs index 1ba2009244ae4..1cf2dc89570fa 100644 --- a/crates/bevy_render/src/render_graph/context.rs +++ b/crates/bevy_render/src/render_graph/context.rs @@ -17,7 +17,7 @@ pub struct RunSubGraph { } /// The context with all graph information required to run a [`Node`](super::Node). -/// This context is created for each node by the [`RenderGraphRunner`](crate::renderer::graph_runner::RenderGraphRunner). +/// This context is created for each node by the render graph runner. /// /// The slot input can be read from here and the outputs must be written back to the context for /// passing them onto the next node. diff --git a/crates/bevy_render/src/render_graph/graph.rs b/crates/bevy_render/src/render_graph/graph.rs index 178c5a4cbb839..9779e4a75ccee 100644 --- a/crates/bevy_render/src/render_graph/graph.rs +++ b/crates/bevy_render/src/render_graph/graph.rs @@ -26,7 +26,7 @@ pub type InternedRenderSubGraph = Interned; /// It is a retained and stateless (nodes themselves may have their own internal state) structure, /// which can not be modified while it is executed by the graph runner. /// -/// The [`RenderGraphRunner`](crate::renderer::graph_runner::RenderGraphRunner) is responsible for executing the entire graph each frame. +/// The render graph runner is responsible for executing the entire graph each frame. /// It will execute each node in the graph in the correct order, based on the edges between the nodes. /// /// It consists of three main components: [`Nodes`](Node), [`Edges`](Edge) diff --git a/crates/bevy_render/src/render_resource/buffer_vec.rs b/crates/bevy_render/src/render_resource/buffer_vec.rs index fdf641136188a..49be061aa9848 100644 --- a/crates/bevy_render/src/render_resource/buffer_vec.rs +++ b/crates/bevy_render/src/render_resource/buffer_vec.rs @@ -105,7 +105,7 @@ impl RawBufferVec { /// Changes the debugging label of the buffer. /// - /// The next time the buffer is updated (via [`reserve`]), Bevy will inform + /// The next time the buffer is updated (via [`reserve`](Self::reserve)), Bevy will inform /// the driver of the new label. pub fn set_label(&mut self, label: Option<&str>) { let label = label.map(str::to_string); @@ -201,7 +201,7 @@ impl Extend for RawBufferVec { /// For performance reasons, unlike [`RawBufferVec`], this type doesn't allow /// CPU access to the data after it's been added via [`BufferVec::push`]. If you /// need CPU access to the data, consider another type, such as -/// [`StorageBuffer`]. +/// [`StorageBuffer`][super::StorageBuffer]. pub struct BufferVec where T: ShaderType + WriteInto, @@ -284,7 +284,7 @@ where /// Changes the debugging label of the buffer. /// - /// The next time the buffer is updated (via [`reserve`]), Bevy will inform + /// The next time the buffer is updated (via [`Self::reserve`]), Bevy will inform /// the driver of the new label. pub fn set_label(&mut self, label: Option<&str>) { let label = label.map(str::to_string); diff --git a/crates/bevy_render/src/render_resource/gpu_array_buffer.rs b/crates/bevy_render/src/render_resource/gpu_array_buffer.rs index 85d44699c707f..f1980062bd2b5 100644 --- a/crates/bevy_render/src/render_resource/gpu_array_buffer.rs +++ b/crates/bevy_render/src/render_resource/gpu_array_buffer.rs @@ -24,12 +24,12 @@ impl GpuArrayBufferable for T {} /// binding (within reasonable limits). /// /// Other options for storing GPU-accessible data are: -/// * [`StorageBuffer`] +/// * [`StorageBuffer`](crate::render_resource::StorageBuffer) /// * [`DynamicStorageBuffer`](crate::render_resource::DynamicStorageBuffer) /// * [`UniformBuffer`](crate::render_resource::UniformBuffer) /// * [`DynamicUniformBuffer`](crate::render_resource::DynamicUniformBuffer) /// * [`RawBufferVec`](crate::render_resource::RawBufferVec) -/// * [`BufferVec`](crate::render_resource::BufferVec) +/// * [`BufferVec`] /// * [`Texture`](crate::render_resource::Texture) #[derive(Resource)] pub enum GpuArrayBuffer { diff --git a/crates/bevy_render/src/renderer/graph_runner.rs b/crates/bevy_render/src/renderer/graph_runner.rs index 1a50f705720e3..835144976e47d 100644 --- a/crates/bevy_render/src/renderer/graph_runner.rs +++ b/crates/bevy_render/src/renderer/graph_runner.rs @@ -19,7 +19,7 @@ use crate::{ /// The [`RenderGraphRunner`] is responsible for executing a [`RenderGraph`]. /// /// It will run all nodes in the graph sequentially in the correct order (defined by the edges). -/// Each [`Node`](crate::render_graph::node::Node) can run any arbitrary code, but will generally +/// Each [`Node`](crate::render_graph::Node) can run any arbitrary code, but will generally /// either send directly a [`CommandBuffer`] or a task that will asynchronously generate a [`CommandBuffer`] /// /// After running the graph, the [`RenderGraphRunner`] will execute in parallel all the tasks to get diff --git a/crates/bevy_state/src/app.rs b/crates/bevy_state/src/app.rs index 1044e0203dbae..710185f2a240d 100644 --- a/crates/bevy_state/src/app.rs +++ b/crates/bevy_state/src/app.rs @@ -12,7 +12,7 @@ use crate::state::{ }; use crate::state_scoped::clear_state_scoped_entities; -/// State installation methods for [`App`](bevy_app::App) and [`SubApp`](bevy_app::SubApp). +/// State installation methods for [`App`] and [`SubApp`]. pub trait AppExtStates { /// Initializes a [`State`] with standard starting values. /// @@ -20,7 +20,7 @@ pub trait AppExtStates { /// /// Adds [`State`] and [`NextState`] resources, and enables use of the [`OnEnter`](crate::state::OnEnter), /// [`OnTransition`](crate::state::OnTransition) and [`OnExit`](crate::state::OnExit) schedules. - /// These schedules are triggered before [`Update`](bevy_app::main_schedule::Update) and at startup. + /// These schedules are triggered before [`Update`](bevy_app::Update) and at startup. /// /// If you would like to control how other systems run based on the current state, you can /// emulate this behavior using the [`in_state`](crate::condition::in_state) [`Condition`](bevy_ecs::prelude::Condition). @@ -34,7 +34,7 @@ pub trait AppExtStates { /// /// Adds [`State`] and [`NextState`] resources, and enables use of the [`OnEnter`](crate::state::OnEnter), /// [`OnTransition`](crate::state::OnTransition) and [`OnExit`](crate::state::OnExit) schedules. - /// These schedules are triggered before [`Update`](bevy_app::main_schedule::Update) and at startup. + /// These schedules are triggered before [`Update`](bevy_app::Update) and at startup. /// /// If you would like to control how other systems run based on the current state, you can /// emulate this behavior using the [`in_state`](crate::condition::in_state) [`Condition`](bevy_ecs::prelude::Condition). diff --git a/crates/bevy_state/src/lib.rs b/crates/bevy_state/src/lib.rs index 363a97e64e853..a8f578e8c7a02 100644 --- a/crates/bevy_state/src/lib.rs +++ b/crates/bevy_state/src/lib.rs @@ -35,7 +35,8 @@ pub mod condition; /// Provides definitions for the basic traits required by the state system pub mod state; -/// Provides [`StateScoped`] and [`clear_state_scoped_entities`] for managing lifetime of entities. +/// Provides [`StateScoped`](crate::state_scoped::StateScoped) and +/// [`clear_state_scoped_entities`](crate::state_scoped::clear_state_scoped_entities) for managing lifetime of entities. pub mod state_scoped; /// Most commonly used re-exported types. diff --git a/crates/bevy_state/src/state/resources.rs b/crates/bevy_state/src/state/resources.rs index d59b17c5ddde1..abc95ab5a4128 100644 --- a/crates/bevy_state/src/state/resources.rs +++ b/crates/bevy_state/src/state/resources.rs @@ -16,9 +16,9 @@ use bevy_ecs::prelude::ReflectResource; /// /// The current state value can be accessed through this resource. To *change* the state, /// queue a transition in the [`NextState`] resource, and it will be applied during the -/// [`StateTransition`](crate::transition::StateTransition) schedule - which by default runs after `PreUpdate`. +/// [`StateTransition`](crate::state::StateTransition) schedule - which by default runs after `PreUpdate`. /// -/// You can also manually trigger the [`StateTransition`](crate::transition::StateTransition) schedule to apply the changes +/// You can also manually trigger the [`StateTransition`](crate::state::StateTransition) schedule to apply the changes /// at an arbitrary time. /// /// The starting state is defined via the [`Default`] implementation for `S`. @@ -93,7 +93,7 @@ impl Deref for State { /// To queue a transition, call [`NextState::set`] or mutate the value to [`NextState::Pending`] directly. /// /// Note that these transitions can be overridden by other systems: -/// only the actual value of this resource during the [`StateTransition`](crate::transition::StateTransition) schedule matters. +/// only the actual value of this resource during the [`StateTransition`](crate::state::StateTransition) schedule matters. /// /// ``` /// use bevy_state::prelude::*; diff --git a/crates/bevy_state/src/state/transitions.rs b/crates/bevy_state/src/state/transitions.rs index dc2764df42e19..0b510e0a2fed9 100644 --- a/crates/bevy_state/src/state/transitions.rs +++ b/crates/bevy_state/src/state/transitions.rs @@ -71,7 +71,8 @@ pub struct StateTransitionEvent { /// These system sets are run sequentially, in the order of the enum variants. #[derive(SystemSet, Clone, Debug, PartialEq, Eq, Hash)] pub(crate) enum StateTransitionSteps { - /// States apply their transitions from [`NextState`] and compute functions based on their parent states. + /// States apply their transitions from [`NextState`](super::NextState) + /// and compute functions based on their parent states. DependentTransitions, /// Exit schedules are executed in leaf to root order ExitSchedules, diff --git a/crates/bevy_text/src/font_atlas.rs b/crates/bevy_text/src/font_atlas.rs index aa426c67e5550..b5e0dfb575f7e 100644 --- a/crates/bevy_text/src/font_atlas.rs +++ b/crates/bevy_text/src/font_atlas.rs @@ -21,7 +21,7 @@ use crate::{GlyphAtlasLocation, TextError}; /// providing a trade-off between visual quality and performance. /// /// A [`CacheKey`](cosmic_text::CacheKey) encodes all of the information of a subpixel-offset glyph and is used to -/// find that glyphs raster in a [`TextureAtlas`] through its corresponding [`GlyphAtlasLocation`]. +/// find that glyphs raster in a [`TextureAtlas`](bevy_sprite::TextureAtlas) through its corresponding [`GlyphAtlasLocation`]. pub struct FontAtlas { /// Used to update the [`TextureAtlasLayout`]. pub dynamic_texture_atlas_builder: DynamicTextureAtlasBuilder, diff --git a/crates/bevy_text/src/font_loader.rs b/crates/bevy_text/src/font_loader.rs index adc5cc69c0763..999e7fa75a23a 100644 --- a/crates/bevy_text/src/font_loader.rs +++ b/crates/bevy_text/src/font_loader.rs @@ -3,7 +3,7 @@ use bevy_asset::{io::Reader, AssetLoader, LoadContext}; use thiserror::Error; #[derive(Default)] -/// An [`AssetLoader`] for [`Font`]s, for use by the [`AssetServer`] +/// An [`AssetLoader`] for [`Font`]s, for use by the [`AssetServer`](bevy_asset::AssetServer) pub struct FontLoader; /// Possible errors that can be produced by [`FontLoader`] diff --git a/crates/bevy_text/src/glyph.rs b/crates/bevy_text/src/glyph.rs index ba949efbfd000..3efd1ac8afe90 100644 --- a/crates/bevy_text/src/glyph.rs +++ b/crates/bevy_text/src/glyph.rs @@ -56,11 +56,11 @@ impl PositionedGlyph { pub struct GlyphAtlasInfo { /// A handle to the [`Image`] data for the texture atlas this glyph was placed in. /// - /// A (weak) clone of the handle held by the [`FontAtlas`]. + /// A (weak) clone of the handle held by the [`FontAtlas`](crate::FontAtlas). pub texture: Handle, /// A handle to the [`TextureAtlasLayout`] map for the texture atlas this glyph was placed in. /// - /// A (weak) clone of the handle held by the [`FontAtlas`]. + /// A (weak) clone of the handle held by the [`FontAtlas`](crate::FontAtlas). pub texture_atlas: Handle, /// Location and offset of a glyph within the texture atlas. pub location: GlyphAtlasLocation, diff --git a/crates/bevy_text/src/lib.rs b/crates/bevy_text/src/lib.rs index 0550883f13830..d5c4527e0b11d 100644 --- a/crates/bevy_text/src/lib.rs +++ b/crates/bevy_text/src/lib.rs @@ -20,7 +20,7 @@ //! Note that text measurement is only relevant in a UI context. //! //! With the actual text bounds defined, the `bevy_ui::widget::text::text_system` system (in a UI context) -//! or [`bevy_text::text2d::update_text2d_layout`] system (in a 2d world space context) +//! or [`text2d::update_text2d_layout`] system (in a 2d world space context) //! passes it into [`TextPipeline::queue_text`], which: //! //! 1. creates a [`Buffer`](cosmic_text::Buffer) from the [`TextSection`]s, generating new [`FontAtlasSet`]s if necessary. diff --git a/crates/bevy_text/src/pipeline.rs b/crates/bevy_text/src/pipeline.rs index 7f7004e71ee04..325460b8b1ab5 100644 --- a/crates/bevy_text/src/pipeline.rs +++ b/crates/bevy_text/src/pipeline.rs @@ -358,7 +358,7 @@ fn load_font_to_fontdb( }); } -/// Translates [`TextSection`] to [`Attrs`](cosmic_text::attrs::Attrs), +/// Translates [`TextSection`] to [`Attrs`], /// loading fonts into the [`Database`](cosmic_text::fontdb::Database) if required. fn get_attrs<'a>( section: &TextSection, diff --git a/crates/bevy_transform/src/bundles.rs b/crates/bevy_transform/src/bundles.rs index 480aa6c236cb7..dc8931824a7fd 100644 --- a/crates/bevy_transform/src/bundles.rs +++ b/crates/bevy_transform/src/bundles.rs @@ -3,7 +3,7 @@ use bevy_ecs::bundle::Bundle; use crate::prelude::{GlobalTransform, Transform}; /// A [`Bundle`] of the [`Transform`] and [`GlobalTransform`] -/// [`Component`]s, which describe the position of an entity. +/// [`Component`](bevy_ecs::component::Component)s, which describe the position of an entity. /// /// * To place or move an entity, you should set its [`Transform`]. /// * To get the global transform of an entity, you should get its [`GlobalTransform`]. @@ -18,9 +18,9 @@ use crate::prelude::{GlobalTransform, Transform}; /// [`GlobalTransform`] is the position of an entity relative to the reference frame. /// /// [`GlobalTransform`] is updated from [`Transform`] by systems in the system set -/// [`TransformPropagate`](TransformSystem::TransformPropagate). +/// [`TransformPropagate`](crate::TransformSystem::TransformPropagate). /// -/// This system runs during [`PostUpdate`]. If you +/// This system runs during [`PostUpdate`](bevy_app::PostUpdate). If you /// update the [`Transform`] of an entity in this schedule or after, you will notice a 1 frame lag /// before the [`GlobalTransform`] is updated. #[derive(Clone, Copy, Debug, Default, Bundle)] @@ -41,7 +41,7 @@ impl TransformBundle { /// Creates a new [`TransformBundle`] from a [`Transform`]. /// /// This initializes [`GlobalTransform`] as identity, to be updated later by the - /// [`PostUpdate`] schedule. + /// [`bevy_app::PostUpdate`] schedule. #[inline] pub const fn from_transform(transform: Transform) -> Self { TransformBundle { diff --git a/crates/bevy_transform/src/components/global_transform.rs b/crates/bevy_transform/src/components/global_transform.rs index fa5384c1d0253..a0d2f3ab83f1f 100644 --- a/crates/bevy_transform/src/components/global_transform.rs +++ b/crates/bevy_transform/src/components/global_transform.rs @@ -14,7 +14,7 @@ use bevy_reflect::{std_traits::ReflectDefault, Reflect}; /// [`Transform`] instead. /// * To get the global transform of an entity, you should get its [`GlobalTransform`]. /// * For transform hierarchies to work correctly, you must have both a [`Transform`] and a [`GlobalTransform`]. -/// * You may use the [`TransformBundle`](crate::TransformBundle) to guarantee this. +/// * You may use the [`TransformBundle`](crate::bundles::TransformBundle) to guarantee this. /// /// ## [`Transform`] and [`GlobalTransform`] /// diff --git a/crates/bevy_transform/src/components/transform.rs b/crates/bevy_transform/src/components/transform.rs index 554d5f66177f5..980782d14be49 100644 --- a/crates/bevy_transform/src/components/transform.rs +++ b/crates/bevy_transform/src/components/transform.rs @@ -12,7 +12,7 @@ use std::ops::Mul; /// * To place or move an entity, you should set its [`Transform`]. /// * To get the global transform of an entity, you should get its [`GlobalTransform`]. /// * To be displayed, an entity must have both a [`Transform`] and a [`GlobalTransform`]. -/// * You may use the [`TransformBundle`](crate::TransformBundle) to guarantee this. +/// * You may use the [`TransformBundle`](crate::bundles::TransformBundle) to guarantee this. /// /// ## [`Transform`] and [`GlobalTransform`] /// diff --git a/crates/bevy_transform/src/lib.rs b/crates/bevy_transform/src/lib.rs index 9d06635b099e2..0e170f111a29a 100644 --- a/crates/bevy_transform/src/lib.rs +++ b/crates/bevy_transform/src/lib.rs @@ -21,6 +21,7 @@ pub mod traits; #[cfg(feature = "bevy-support")] pub mod plugins; +/// [`GlobalTransform`]: components::GlobalTransform /// Helpers related to computing global transforms #[cfg(feature = "bevy-support")] pub mod helper; diff --git a/crates/bevy_window/src/window.rs b/crates/bevy_window/src/window.rs index 8bc0cf902904e..0e1a441b83264 100644 --- a/crates/bevy_window/src/window.rs +++ b/crates/bevy_window/src/window.rs @@ -281,28 +281,29 @@ pub struct Window { /// [`wgpu::SurfaceConfiguration::desired_maximum_frame_latency`]: /// https://docs.rs/wgpu/latest/wgpu/type.SurfaceConfiguration.html#structfield.desired_maximum_frame_latency pub desired_maximum_frame_latency: Option, - /// Sets whether this window recognizes [`PinchGesture`] + /// Sets whether this window recognizes [`PinchGesture`](https://docs.rs/bevy/latest/bevy/input/gestures/struct.PinchGesture.html) /// /// ## Platform-specific /// /// - Only used on iOS. /// - On macOS, they are recognized by default and can't be disabled. pub recognize_pinch_gesture: bool, - /// Sets whether this window recognizes [`RotationGesture`] + /// Sets whether this window recognizes [`RotationGesture`](https://docs.rs/bevy/latest/bevy/input/gestures/struct.RotationGesture.html) /// /// ## Platform-specific /// /// - Only used on iOS. /// - On macOS, they are recognized by default and can't be disabled. pub recognize_rotation_gesture: bool, - /// Sets whether this window recognizes [`DoubleTapGesture`] + /// Sets whether this window recognizes [`DoubleTapGesture`](https://docs.rs/bevy/latest/bevy/input/gestures/struct.DoubleTapGesture.html) /// /// ## Platform-specific /// /// - Only used on iOS. /// - On macOS, they are recognized by default and can't be disabled. pub recognize_doubletap_gesture: bool, - /// Sets whether this window recognizes [`PanGesture`], with a number of fingers between the first value and the last. + /// Sets whether this window recognizes [`PanGesture`](https://docs.rs/bevy/latest/bevy/input/gestures/struct.PanGesture.html), + /// with a number of fingers between the first value and the last. /// /// ## Platform-specific /// diff --git a/crates/bevy_winit/src/accessibility.rs b/crates/bevy_winit/src/accessibility.rs index e72c6c8cfe79c..05fc96c992568 100644 --- a/crates/bevy_winit/src/accessibility.rs +++ b/crates/bevy_winit/src/accessibility.rs @@ -28,7 +28,7 @@ use bevy_window::{PrimaryWindow, Window, WindowClosed}; #[derive(Default, Deref, DerefMut)] pub struct AccessKitAdapters(pub EntityHashMap); -/// Maps window entities to their respective [`WinitActionRequests`]s. +/// Maps window entities to their respective [`ActionRequest`]s. #[derive(Resource, Default, Deref, DerefMut)] pub struct WinitActionRequestHandlers(pub EntityHashMap>>); diff --git a/crates/bevy_winit/src/lib.rs b/crates/bevy_winit/src/lib.rs index 8be97fc8082cc..82219b134cadf 100644 --- a/crates/bevy_winit/src/lib.rs +++ b/crates/bevy_winit/src/lib.rs @@ -60,7 +60,7 @@ pub struct WinitPlugin { /// Allows the window (and the event loop) to be created on any thread /// instead of only the main thread. /// - /// See [`EventLoopBuilder::build`] for more information on this. + /// See [`EventLoopBuilder::build`](winit::event_loop::EventLoopBuilder::build) for more information on this. /// /// # Supported platforms /// @@ -142,7 +142,7 @@ impl Plugin for WinitPlugin { #[derive(Debug, Default, Clone, Copy, Event)] pub struct WakeUp; -/// The [`winit::event_loop::EventLoopProxy`] with the specific [`winit::event::Event::UserEvent`] used in the [`winit_runner`]. +/// A re-export of [`winit::event_loop::EventLoopProxy`]. /// /// The `EventLoopProxy` can be used to request a redraw from outside bevy. /// diff --git a/crates/bevy_winit/src/state.rs b/crates/bevy_winit/src/state.rs index 8b866d59799c1..c7c8bcc572ad5 100644 --- a/crates/bevy_winit/src/state.rs +++ b/crates/bevy_winit/src/state.rs @@ -54,7 +54,7 @@ struct WinitAppRunnerState { window_event_received: bool, /// Is `true` if a new [`DeviceEvent`] event has been received since the last update. device_event_received: bool, - /// Is `true` if a new [`T`] event has been received since the last update. + /// Is `true` if a new `T` event has been received since the last update. user_event_received: bool, /// Is `true` if the app has requested a redraw since the last update. redraw_requested: bool, @@ -739,7 +739,7 @@ impl WinitAppRunnerState { } } -/// The default [`App::runner`] for the [`WinitPlugin`] plugin. +/// The default [`App::runner`] for the [`WinitPlugin`](crate::WinitPlugin) plugin. /// /// Overriding the app's [runner](bevy_app::App::runner) while using `WinitPlugin` will bypass the /// `EventLoop`. diff --git a/crates/bevy_winit/src/winit_config.rs b/crates/bevy_winit/src/winit_config.rs index 54efb4ee17754..e97831bb3867a 100644 --- a/crates/bevy_winit/src/winit_config.rs +++ b/crates/bevy_winit/src/winit_config.rs @@ -14,7 +14,7 @@ impl WinitSettings { /// Default settings for games. /// /// [`Continuous`](UpdateMode::Continuous) if windows have focus, - /// [`ReactiveLowPower`](UpdateMode::ReactiveLowPower) otherwise. + /// [`reactive_low_power`](UpdateMode::reactive_low_power) otherwise. pub fn game() -> Self { WinitSettings { focused_mode: UpdateMode::Continuous, @@ -25,7 +25,7 @@ impl WinitSettings { /// Default settings for desktop applications. /// /// [`Reactive`](UpdateMode::Reactive) if windows have focus, - /// [`ReactiveLowPower`](UpdateMode::ReactiveLowPower) otherwise. + /// [`reactive_low_power`](UpdateMode::reactive_low_power) otherwise. /// /// Use the [`EventLoopProxy`](crate::EventLoopProxy) to request a redraw from outside bevy. pub fn desktop_app() -> Self { diff --git a/tools/ci/src/commands/doc_check.rs b/tools/ci/src/commands/doc_check.rs index cf346c7544470..ef5fc502df579 100644 --- a/tools/ci/src/commands/doc_check.rs +++ b/tools/ci/src/commands/doc_check.rs @@ -12,9 +12,10 @@ impl Prepare for DocCheckCommand { vec![PreparedCommand::new::( cmd!( sh, - "cargo doc --workspace --all-features --no-deps --document-private-items" + "cargo doc --workspace --all-features --no-deps --document-private-items --keep-going" ), "Please fix doc warnings in output above.", - )] + ) + .with_env_var("RUSTDOCFLAGS", "-D warnings")] } }