Deploy Docs - Build Docs step: Resolve most Warnings (#23343)

# Objective

- Resolve most of the warnings in the Build Docs step of Deploy Docs,
you can see them here:
https://github.com/bevyengine/bevy/actions/runs/23021953246/job/66860356132

## Solution

- Resolve most of the warnings
- The `doc_cfg` feature should only be enabled with `docsrs`, not
`docsrs_dep` (I just followed this pattern from other crates tbh like
`bevy_math` and `bevy_material`)
- I unlinked example docs that references non public items within the
example itself
  - I corrected some links

Note: I didn’t fix the warnings concerning the macros in bevy-reflect
for `tuple.rs` because I’m not macro savvy. If someone knows what to do
in those cases (should I just remove the `$(#[$meta])*` lines cause
they’re not in use?), just let me know and I can do it (or you can open
a pull!)

---------

Co-authored-by: François Mockers <francois.mockers@vleue.com>
This commit is contained in:
Kevin Chen
2026-03-13 22:35:44 -04:00
committed by GitHub
parent f6d2e7531f
commit 846b196cda
10 changed files with 23 additions and 19 deletions
+2 -1
View File
@@ -5,7 +5,8 @@
reason = "rustdoc_internals is needed for fake_variadic"
)
)]
#![cfg_attr(any(docsrs, docsrs_dep), feature(doc_cfg, rustdoc_internals))]
#![cfg_attr(any(docsrs, docsrs_dep), feature(rustdoc_internals))]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![forbid(unsafe_code)]
#![doc(
html_logo_url = "https://bevy.org/assets/icon.png",
+2 -1
View File
@@ -6,7 +6,8 @@
reason = "rustdoc_internals is needed for fake_variadic"
)
)]
#![cfg_attr(any(docsrs, docsrs_dep), feature(doc_cfg, rustdoc_internals))]
#![cfg_attr(any(docsrs, docsrs_dep), feature(rustdoc_internals))]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![expect(unsafe_code, reason = "Unsafe code is used to improve performance.")]
#![doc(
html_logo_url = "https://bevy.org/assets/icon.png",
+2 -1
View File
@@ -5,7 +5,8 @@
reason = "rustdoc_internals is needed for fake_variadic"
)
)]
#![cfg_attr(any(docsrs, docsrs_dep), feature(doc_cfg, rustdoc_internals))]
#![cfg_attr(any(docsrs, docsrs_dep), feature(rustdoc_internals))]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(
html_logo_url = "https://bevy.org/assets/icon.png",
html_favicon_url = "https://bevy.org/assets/icon.png"
+2 -1
View File
@@ -20,7 +20,8 @@
reason = "rustdoc_internals is needed for fake_variadic"
)
)]
#![cfg_attr(any(docsrs, docsrs_dep), feature(doc_cfg, rustdoc_internals))]
#![cfg_attr(any(docsrs, docsrs_dep), feature(rustdoc_internals))]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(
html_logo_url = "https://bevy.org/assets/icon.png",
html_favicon_url = "https://bevy.org/assets/icon.png"
+1 -1
View File
@@ -3,7 +3,7 @@
//! It doesn't use the [`Material2d`] abstraction, but changes the vertex buffer to include vertex color.
//! Check out the "mesh2d" example for simpler / higher level 2d meshes.
//!
//! [`Material2d`]: bevy::sprite::Material2d
//! [`Material2d`]: bevy::sprite_render::Material2d
use bevy::{
asset::RenderAssetUsages,
+2 -2
View File
@@ -6,9 +6,9 @@
//! Inside the `custom_layer` function we will create a [`mpsc::Sender`] and a [`mpsc::Receiver`] from a
//! [`mpsc::channel`]. The [`Sender`](mpsc::Sender) will go into the `AdvancedLayer` and the [`Receiver`](mpsc::Receiver) will
//! go into a non-send resource called `LogEvents` (It has to be non-send because [`Receiver`](mpsc::Receiver) is [`!Sync`](Sync)).
//! From there we will use [`transfer_log_messages`] to transfer log messages from [`CapturedLogMessages`] to an ECS message called [`LogMessage`].
//! From there we will use `transfer_log_messages` to transfer log messages from `CapturedLogMessages` to an ECS message called `LogMessage`.
//!
//! Finally, after all that we can access the [`LogMessage`] message from our systems and use it.
//! Finally, after all that we can access the `LogMessage` message from our systems and use it.
//! In this example we build a simple log viewer.
use std::sync::mpsc;
+2 -2
View File
@@ -5,10 +5,10 @@
//!
//! We can define a custom relationship by creating two components:
//! one to store the relationship itself, and another to keep track of the reverse relationship.
//! Bevy's [`ChildOf`] component implements the [`Relationship`] trait, serving as the source of truth,
//! Bevy's [`ChildOf`] component implements the [`Relationship`](bevy::ecs::relationship::Relationship) trait, serving as the source of truth,
//! while the [`Children`] component implements the [`RelationshipTarget`] trait and is used to accelerate traversals down the hierarchy.
//!
//! In this example we're creating a [`Targeting`]/[`TargetedBy`] relationship,
//! In this example we're creating a `Targeting`/`TargetedBy` relationship,
//! demonstrating how you might model units which target a single unit in combat.
use bevy::ecs::entity::EntityHashSet;
@@ -1,8 +1,8 @@
//! Demonstrates how to define and use specialized mesh pipeline
//!
//! This example shows how to use the built-in [`SpecializedMeshPipeline`]
//! functionality with a custom [`RenderCommand`] to allow custom mesh rendering with
//! more flexibility than the material api.
//! functionality with a custom [`RenderCommand`](bevy::render::render_phase::RenderCommand)
//! to allow custom mesh rendering with more flexibility than the material api.
//!
//! [`SpecializedMeshPipeline`] let's you customize the entire pipeline used when rendering a mesh.
+4 -4
View File
@@ -10,10 +10,10 @@
//! In addition, we want to enable a "tutorial" mode, which will involve its own state that is toggled in the main menu.
//! This will display instructions about movement and turbo mode when in game and unpaused, and instructions on how to unpause when paused.
//!
//! To implement this, we will create 2 root-level states: [`AppState`] and [`TutorialState`].
//! We will then create some computed states that derive from [`AppState`]: [`InGame`] and [`TurboMode`] are marker states implemented
//! as Zero-Sized Structs (ZSTs), while [`IsPaused`] is an enum with 2 distinct states.
//! And lastly, we'll add [`Tutorial`], a computed state deriving from [`TutorialState`], [`InGame`] and [`IsPaused`], with 2 distinct
//! To implement this, we will create 2 root-level states: `AppState` and `TutorialState`.
//! We will then create some computed states that derive from `AppState`: `InGame` and `TurboMode` are marker states implemented
//! as Zero-Sized Structs (ZSTs), while `IsPaused` is an enum with 2 distinct states.
//! And lastly, we'll add `Tutorial`, a computed state deriving from `TutorialState`, `InGame` and `IsPaused`, with 2 distinct
//! states to display the 2 tutorial texts.
use bevy::{dev_tools::states::*, input::keyboard::Key, prelude::*};
+4 -4
View File
@@ -15,17 +15,17 @@
//! from a given camera's view, which entities are visible, and when
//! that change happens during an entity's Aabb interaction with a camera's Frustum.
//!
//! This example contains a scene with a camera [`MyCamera`] that has its
//! This example contains a scene with a camera `MyCamera` that has its
//! [`Frustum`](bevy::camera::primitives::Frustum) gizmo visible.
//! A collection of [`MyShape`]s, with their individual
//! A collection of `MyShape`s, with their individual
//! [`Aabb`](bevy::camera::primitives::Aabb) gizmos visible, periodically move in and
//! out of the camera's frustum. The [`Aabb`](bevy::camera::primitives::Aabb)
//! gizmos are colored red when they have been culled from [`MyCamera`]'s view.
//! gizmos are colored red when they have been culled from `MyCamera`'s view.
//! The gizmos change color to green when the shape is considered visible by the
//! camera and would be extracted for rendering.
//!
//! A second active camera, controllable via the [`FreeCameraPlugin`], is used to observe the scene.
//! This second camera's view occupies most of the window. [`MyCamera`]'s view is visible in the
//! This second camera's view occupies most of the window. `MyCamera`'s view is visible in the
//! bottom right ninth of the screen.
use bevy::{