From 72c51cdab913ee001bfa6e00023ec14ea9d1a3a2 Mon Sep 17 00:00:00 2001
From: Ame <104745335+ameknite@users.noreply.github.com>
Date: Fri, 22 Mar 2024 20:22:52 -0600
Subject: [PATCH] Make `feature(doc_auto_cfg)` work (#12642)
# Objective
- In #12366 `![cfg_attr(docsrs, feature(doc_auto_cfg))] `was added. But
to apply it it needs `--cfg=docsrs` in rustdoc-args.
## Solution
- Apply `--cfg=docsrs` to all crates and CI.
I also added `[package.metadata.docs.rs]` to all crates to avoid adding
code behind a feature and forget adding the metadata.
Before:

After:

---
.github/workflows/docs.yml | 3 +++
Cargo.toml | 3 ++-
crates/bevy_a11y/Cargo.toml | 4 ++++
crates/bevy_a11y/src/lib.rs | 5 +++--
crates/bevy_animation/Cargo.toml | 4 ++++
crates/bevy_animation/src/lib.rs | 2 ++
crates/bevy_app/Cargo.toml | 1 +
crates/bevy_app/src/lib.rs | 3 ++-
crates/bevy_asset/Cargo.toml | 1 +
crates/bevy_asset/macros/Cargo.toml | 4 ++++
crates/bevy_asset/macros/src/lib.rs | 1 +
crates/bevy_audio/Cargo.toml | 1 +
crates/bevy_audio/src/lib.rs | 5 +++--
crates/bevy_color/Cargo.toml | 4 ++++
crates/bevy_color/src/lib.rs | 2 ++
crates/bevy_core/Cargo.toml | 1 +
crates/bevy_core/src/lib.rs | 3 ++-
crates/bevy_core_pipeline/Cargo.toml | 1 +
crates/bevy_derive/Cargo.toml | 4 ++++
crates/bevy_derive/src/lib.rs | 1 +
crates/bevy_dev_tools/Cargo.toml | 1 +
crates/bevy_dev_tools/src/lib.rs | 3 ++-
crates/bevy_diagnostic/Cargo.toml | 1 +
crates/bevy_dylib/Cargo.toml | 4 ++++
crates/bevy_dylib/src/lib.rs | 3 ++-
crates/bevy_dynamic_plugin/Cargo.toml | 4 ++++
crates/bevy_dynamic_plugin/src/lib.rs | 2 ++
crates/bevy_ecs/Cargo.toml | 1 +
crates/bevy_ecs/macros/Cargo.toml | 4 ++++
crates/bevy_ecs/macros/src/lib.rs | 1 +
crates/bevy_encase_derive/Cargo.toml | 4 ++++
crates/bevy_encase_derive/src/lib.rs | 1 +
crates/bevy_gilrs/Cargo.toml | 4 ++++
crates/bevy_gilrs/src/lib.rs | 2 ++
crates/bevy_gizmos/Cargo.toml | 1 +
crates/bevy_gizmos/macros/Cargo.toml | 9 +++++++--
crates/bevy_gizmos/macros/src/lib.rs | 2 ++
crates/bevy_gizmos/src/lib.rs | 3 ++-
crates/bevy_gltf/Cargo.toml | 1 +
crates/bevy_gltf/src/lib.rs | 3 ++-
crates/bevy_hierarchy/Cargo.toml | 1 +
crates/bevy_hierarchy/src/lib.rs | 3 ++-
crates/bevy_input/Cargo.toml | 1 +
crates/bevy_input/src/lib.rs | 3 ++-
crates/bevy_internal/Cargo.toml | 4 ++++
crates/bevy_internal/src/lib.rs | 2 ++
crates/bevy_log/Cargo.toml | 1 +
crates/bevy_log/src/lib.rs | 3 ++-
crates/bevy_macro_utils/Cargo.toml | 4 ++++
crates/bevy_macro_utils/src/lib.rs | 2 ++
crates/bevy_math/Cargo.toml | 1 +
crates/bevy_math/src/lib.rs | 3 ++-
crates/bevy_mikktspace/Cargo.toml | 4 ++++
crates/bevy_mikktspace/src/lib.rs | 1 +
crates/bevy_panic_handler/Cargo.toml | 1 +
crates/bevy_panic_handler/src/lib.rs | 3 ++-
crates/bevy_pbr/Cargo.toml | 1 +
crates/bevy_ptr/Cargo.toml | 4 ++++
crates/bevy_ptr/src/lib.rs | 1 +
crates/bevy_reflect/Cargo.toml | 1 +
crates/bevy_reflect/bevy_reflect_derive/Cargo.toml | 4 ++++
crates/bevy_reflect/bevy_reflect_derive/src/lib.rs | 2 ++
crates/bevy_reflect/src/lib.rs | 2 +-
crates/bevy_render/Cargo.toml | 1 +
crates/bevy_render/macros/Cargo.toml | 4 ++++
crates/bevy_render/macros/src/lib.rs | 1 +
crates/bevy_scene/Cargo.toml | 1 +
crates/bevy_scene/src/lib.rs | 3 ++-
crates/bevy_sprite/Cargo.toml | 4 ++++
crates/bevy_sprite/src/lib.rs | 1 +
crates/bevy_tasks/Cargo.toml | 1 +
crates/bevy_text/Cargo.toml | 1 +
crates/bevy_time/Cargo.toml | 1 +
crates/bevy_transform/Cargo.toml | 1 +
crates/bevy_ui/Cargo.toml | 6 ++++--
crates/bevy_ui/src/lib.rs | 2 +-
crates/bevy_utils/Cargo.toml | 4 ++++
crates/bevy_utils/macros/Cargo.toml | 4 ++++
crates/bevy_utils/macros/src/lib.rs | 1 +
crates/bevy_utils/src/lib.rs | 2 ++
crates/bevy_window/Cargo.toml | 1 +
crates/bevy_window/src/lib.rs | 3 ++-
crates/bevy_winit/Cargo.toml | 6 ++++--
crates/bevy_winit/src/lib.rs | 3 ++-
errors/Cargo.toml | 9 +++++++--
examples/mobile/Cargo.toml | 4 ++++
src/lib.rs | 1 +
tools/build-templated-pages/Cargo.toml | 9 +++++++--
tools/build-wasm-example/Cargo.toml | 9 +++++++--
tools/ci/Cargo.toml | 10 +++++++---
tools/example-showcase/Cargo.toml | 9 +++++++--
91 files changed, 223 insertions(+), 38 deletions(-)
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index ee3c6d848c..5f163f757d 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -49,6 +49,9 @@ jobs:
echo "" > header.html
- name: Build docs
+ env:
+ # needs to be in sync with [package.metadata.docs.rs]
+ RUSTDOCFLAGS: -Zunstable-options --cfg=docsrs
run: cargo doc --all-features --no-deps -p bevy -Zunstable-options -Zrustdoc-scrape-examples
# This adds the following:
diff --git a/Cargo.toml b/Cargo.toml
index 476c27e097..46696bd73d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2821,5 +2821,6 @@ lto = "fat"
panic = "abort"
[package.metadata.docs.rs]
-cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
+cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
diff --git a/crates/bevy_a11y/Cargo.toml b/crates/bevy_a11y/Cargo.toml
index 1f13d6e8a5..4ee262fa22 100644
--- a/crates/bevy_a11y/Cargo.toml
+++ b/crates/bevy_a11y/Cargo.toml
@@ -18,3 +18,7 @@ accesskit = "0.12"
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_a11y/src/lib.rs b/crates/bevy_a11y/src/lib.rs
index 53a515c7ee..77f905b2b5 100644
--- a/crates/bevy_a11y/src/lib.rs
+++ b/crates/bevy_a11y/src/lib.rs
@@ -1,6 +1,7 @@
-//! Accessibility for Bevy
-
#![forbid(unsafe_code)]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
+//! Accessibility for Bevy
use std::sync::{
atomic::{AtomicBool, Ordering},
diff --git a/crates/bevy_animation/Cargo.toml b/crates/bevy_animation/Cargo.toml
index 13787f46a1..52c2786b84 100644
--- a/crates/bevy_animation/Cargo.toml
+++ b/crates/bevy_animation/Cargo.toml
@@ -40,3 +40,7 @@ uuid = { version = "1.7", features = ["v4"] }
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_animation/src/lib.rs b/crates/bevy_animation/src/lib.rs
index d3dbed8406..398463fd05 100644
--- a/crates/bevy_animation/src/lib.rs
+++ b/crates/bevy_animation/src/lib.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! Animation for the game engine Bevy
mod animatable;
diff --git a/crates/bevy_app/Cargo.toml b/crates/bevy_app/Cargo.toml
index 28b272571e..984518d1cc 100644
--- a/crates/bevy_app/Cargo.toml
+++ b/crates/bevy_app/Cargo.toml
@@ -36,4 +36,5 @@ web-sys = { version = "0.3", features = ["Window"] }
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_app/src/lib.rs b/crates/bevy_app/src/lib.rs
index d87bcbde13..8cd087c8de 100644
--- a/crates/bevy_app/src/lib.rs
+++ b/crates/bevy_app/src/lib.rs
@@ -1,6 +1,7 @@
-//! This crate is about everything concerning the highest-level, application layer of a Bevy app.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+//! This crate is about everything concerning the highest-level, application layer of a Bevy app.
+
mod app;
mod main_schedule;
mod plugin;
diff --git a/crates/bevy_asset/Cargo.toml b/crates/bevy_asset/Cargo.toml
index 62f499857d..04398df8ec 100644
--- a/crates/bevy_asset/Cargo.toml
+++ b/crates/bevy_asset/Cargo.toml
@@ -61,4 +61,5 @@ bevy_log = { path = "../bevy_log", version = "0.14.0-dev" }
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_asset/macros/Cargo.toml b/crates/bevy_asset/macros/Cargo.toml
index 21d6b1fdcd..f178067cc1 100644
--- a/crates/bevy_asset/macros/Cargo.toml
+++ b/crates/bevy_asset/macros/Cargo.toml
@@ -20,3 +20,7 @@ quote = "1.0"
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_asset/macros/src/lib.rs b/crates/bevy_asset/macros/src/lib.rs
index 8dc8975f23..6c290367e6 100644
--- a/crates/bevy_asset/macros/src/lib.rs
+++ b/crates/bevy_asset/macros/src/lib.rs
@@ -1,5 +1,6 @@
// FIXME(3492): remove once docs are ready
#![allow(missing_docs)]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
use bevy_macro_utils::BevyManifest;
use proc_macro::{Span, TokenStream};
diff --git a/crates/bevy_audio/Cargo.toml b/crates/bevy_audio/Cargo.toml
index 3f831ce3e4..fc0bb3aaec 100644
--- a/crates/bevy_audio/Cargo.toml
+++ b/crates/bevy_audio/Cargo.toml
@@ -52,4 +52,5 @@ android_shared_stdcxx = ["cpal/oboe-shared-stdcxx"]
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_audio/src/lib.rs b/crates/bevy_audio/src/lib.rs
index 3f42acf3b6..aa58420e8a 100644
--- a/crates/bevy_audio/src/lib.rs
+++ b/crates/bevy_audio/src/lib.rs
@@ -1,3 +1,6 @@
+#![forbid(unsafe_code)]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! Audio support for the game engine Bevy
//!
//! ```no_run
@@ -19,8 +22,6 @@
//! });
//! }
//! ```
-#![forbid(unsafe_code)]
-#![cfg_attr(docsrs, feature(doc_auto_cfg))]
mod audio;
mod audio_output;
diff --git a/crates/bevy_color/Cargo.toml b/crates/bevy_color/Cargo.toml
index 29bd0218ad..a3b13b1bc7 100644
--- a/crates/bevy_color/Cargo.toml
+++ b/crates/bevy_color/Cargo.toml
@@ -21,3 +21,7 @@ encase = { version = "0.7", default-features = false }
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_color/src/lib.rs b/crates/bevy_color/src/lib.rs
index 139c381cd2..103bf0f419 100644
--- a/crates/bevy_color/src/lib.rs
+++ b/crates/bevy_color/src/lib.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! Representations of colors in various color spaces.
//!
//! This crate provides a number of color representations, including:
diff --git a/crates/bevy_core/Cargo.toml b/crates/bevy_core/Cargo.toml
index 75ccb157ea..d149581ebb 100644
--- a/crates/bevy_core/Cargo.toml
+++ b/crates/bevy_core/Cargo.toml
@@ -37,4 +37,5 @@ crossbeam-channel = "0.5.0"
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_core/src/lib.rs b/crates/bevy_core/src/lib.rs
index 8ccd3ee4d9..610f9e7a24 100644
--- a/crates/bevy_core/src/lib.rs
+++ b/crates/bevy_core/src/lib.rs
@@ -1,6 +1,7 @@
-//! This crate provides core functionality for Bevy Engine.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+//! This crate provides core functionality for Bevy Engine.
+
mod name;
#[cfg(feature = "serialize")]
mod serde;
diff --git a/crates/bevy_core_pipeline/Cargo.toml b/crates/bevy_core_pipeline/Cargo.toml
index e03b93e9d9..e6846d0ec1 100644
--- a/crates/bevy_core_pipeline/Cargo.toml
+++ b/crates/bevy_core_pipeline/Cargo.toml
@@ -42,4 +42,5 @@ nonmax = "0.5"
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_derive/Cargo.toml b/crates/bevy_derive/Cargo.toml
index abf5e47f4b..a936ac773a 100644
--- a/crates/bevy_derive/Cargo.toml
+++ b/crates/bevy_derive/Cargo.toml
@@ -19,3 +19,7 @@ syn = { version = "2.0", features = ["full"] }
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_derive/src/lib.rs b/crates/bevy_derive/src/lib.rs
index fda825dc16..591bd9f7a8 100644
--- a/crates/bevy_derive/src/lib.rs
+++ b/crates/bevy_derive/src/lib.rs
@@ -1,5 +1,6 @@
// FIXME(3492): remove once docs are ready
#![allow(missing_docs)]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
extern crate proc_macro;
diff --git a/crates/bevy_dev_tools/Cargo.toml b/crates/bevy_dev_tools/Cargo.toml
index 62ab2c8fcc..727ba84f80 100644
--- a/crates/bevy_dev_tools/Cargo.toml
+++ b/crates/bevy_dev_tools/Cargo.toml
@@ -43,4 +43,5 @@ ron = { version = "0.8.0", optional = true }
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_dev_tools/src/lib.rs b/crates/bevy_dev_tools/src/lib.rs
index 8bb9b0b7d2..031f627293 100644
--- a/crates/bevy_dev_tools/src/lib.rs
+++ b/crates/bevy_dev_tools/src/lib.rs
@@ -1,6 +1,7 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! This crate provides additional utilities for the [Bevy game engine](https://bevyengine.org),
//! focused on improving developer experience.
-#![cfg_attr(docsrs, feature(doc_auto_cfg))]
use bevy_app::prelude::*;
diff --git a/crates/bevy_diagnostic/Cargo.toml b/crates/bevy_diagnostic/Cargo.toml
index d82a5f2e52..78f1d0bb00 100644
--- a/crates/bevy_diagnostic/Cargo.toml
+++ b/crates/bevy_diagnostic/Cargo.toml
@@ -38,4 +38,5 @@ sysinfo = { version = "0.30.0", optional = true, default-features = false }
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_dylib/Cargo.toml b/crates/bevy_dylib/Cargo.toml
index cd6c5c7836..28535950c0 100644
--- a/crates/bevy_dylib/Cargo.toml
+++ b/crates/bevy_dylib/Cargo.toml
@@ -16,3 +16,7 @@ bevy_internal = { path = "../bevy_internal", version = "0.14.0-dev", default-fea
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_dylib/src/lib.rs b/crates/bevy_dylib/src/lib.rs
index 9aefb17ace..116ba5067b 100644
--- a/crates/bevy_dylib/src/lib.rs
+++ b/crates/bevy_dylib/src/lib.rs
@@ -1,4 +1,4 @@
-#![allow(clippy::single_component_path_imports)]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
//! Forces dynamic linking of Bevy.
//!
@@ -51,4 +51,5 @@
// Force linking of the main bevy crate
#[allow(unused_imports)]
+#[allow(clippy::single_component_path_imports)]
use bevy_internal;
diff --git a/crates/bevy_dynamic_plugin/Cargo.toml b/crates/bevy_dynamic_plugin/Cargo.toml
index 67f22232c2..5e7d117543 100644
--- a/crates/bevy_dynamic_plugin/Cargo.toml
+++ b/crates/bevy_dynamic_plugin/Cargo.toml
@@ -18,3 +18,7 @@ thiserror = "1.0"
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_dynamic_plugin/src/lib.rs b/crates/bevy_dynamic_plugin/src/lib.rs
index 3a620cee1f..a675738a45 100644
--- a/crates/bevy_dynamic_plugin/src/lib.rs
+++ b/crates/bevy_dynamic_plugin/src/lib.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! Bevy's dynamic plugin loading functionality.
//!
//! This crate allows loading dynamic libraries (`.dylib`, `.so`) that export a single
diff --git a/crates/bevy_ecs/Cargo.toml b/crates/bevy_ecs/Cargo.toml
index 06e099b005..6e54aaf735 100644
--- a/crates/bevy_ecs/Cargo.toml
+++ b/crates/bevy_ecs/Cargo.toml
@@ -51,4 +51,5 @@ path = "examples/change_detection.rs"
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_ecs/macros/Cargo.toml b/crates/bevy_ecs/macros/Cargo.toml
index c9f3a5754c..abc6647a8b 100644
--- a/crates/bevy_ecs/macros/Cargo.toml
+++ b/crates/bevy_ecs/macros/Cargo.toml
@@ -17,3 +17,7 @@ proc-macro2 = "1.0"
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_ecs/macros/src/lib.rs b/crates/bevy_ecs/macros/src/lib.rs
index 732cd3fd37..267969a55e 100644
--- a/crates/bevy_ecs/macros/src/lib.rs
+++ b/crates/bevy_ecs/macros/src/lib.rs
@@ -1,5 +1,6 @@
// FIXME(3492): remove once docs are ready
#![allow(missing_docs)]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
extern crate proc_macro;
diff --git a/crates/bevy_encase_derive/Cargo.toml b/crates/bevy_encase_derive/Cargo.toml
index d4b4b0a6ff..ed50b8da95 100644
--- a/crates/bevy_encase_derive/Cargo.toml
+++ b/crates/bevy_encase_derive/Cargo.toml
@@ -17,3 +17,7 @@ encase_derive_impl = "0.7"
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_encase_derive/src/lib.rs b/crates/bevy_encase_derive/src/lib.rs
index e09bc4b247..1fc888a61c 100644
--- a/crates/bevy_encase_derive/src/lib.rs
+++ b/crates/bevy_encase_derive/src/lib.rs
@@ -1,5 +1,6 @@
// FIXME(3492): remove once docs are ready
#![allow(missing_docs)]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
use bevy_macro_utils::BevyManifest;
use encase_derive_impl::{implement, syn};
diff --git a/crates/bevy_gilrs/Cargo.toml b/crates/bevy_gilrs/Cargo.toml
index bf0bd644ab..ad98c34040 100644
--- a/crates/bevy_gilrs/Cargo.toml
+++ b/crates/bevy_gilrs/Cargo.toml
@@ -22,3 +22,7 @@ thiserror = "1.0"
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_gilrs/src/lib.rs b/crates/bevy_gilrs/src/lib.rs
index dad8efe744..bd1ec09a2a 100644
--- a/crates/bevy_gilrs/src/lib.rs
+++ b/crates/bevy_gilrs/src/lib.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! Systems and type definitions for gamepad handling in Bevy.
//!
//! This crate is built on top of [GilRs](gilrs), a library
diff --git a/crates/bevy_gizmos/Cargo.toml b/crates/bevy_gizmos/Cargo.toml
index 8b5bf14229..039151b161 100644
--- a/crates/bevy_gizmos/Cargo.toml
+++ b/crates/bevy_gizmos/Cargo.toml
@@ -34,4 +34,5 @@ bytemuck = "1.0"
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_gizmos/macros/Cargo.toml b/crates/bevy_gizmos/macros/Cargo.toml
index d4cf3e3ad0..dad07b319c 100644
--- a/crates/bevy_gizmos/macros/Cargo.toml
+++ b/crates/bevy_gizmos/macros/Cargo.toml
@@ -11,8 +11,6 @@ keywords = ["bevy"]
[lib]
proc-macro = true
-[lints]
-workspace = true
[dependencies]
bevy_macro_utils = { path = "../../bevy_macro_utils", version = "0.14.0-dev" }
@@ -20,3 +18,10 @@ bevy_macro_utils = { path = "../../bevy_macro_utils", version = "0.14.0-dev" }
syn = "2.0"
proc-macro2 = "1.0"
quote = "1.0"
+
+[lints]
+workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_gizmos/macros/src/lib.rs b/crates/bevy_gizmos/macros/src/lib.rs
index eb2c598c90..adce45a4d0 100644
--- a/crates/bevy_gizmos/macros/src/lib.rs
+++ b/crates/bevy_gizmos/macros/src/lib.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! Derive implementations for `bevy_gizmos`.
use bevy_macro_utils::BevyManifest;
diff --git a/crates/bevy_gizmos/src/lib.rs b/crates/bevy_gizmos/src/lib.rs
index 9163a12bf6..36d0a5520a 100755
--- a/crates/bevy_gizmos/src/lib.rs
+++ b/crates/bevy_gizmos/src/lib.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! This crate adds an immediate mode drawing api to Bevy for visual debugging.
//!
//! # Example
@@ -13,7 +15,6 @@
//! ```
//!
//! See the documentation on [Gizmos](crate::gizmos::Gizmos) for more examples.
-#![cfg_attr(docsrs, feature(doc_auto_cfg))]
/// System set label for the systems handling the rendering of gizmos.
#[derive(SystemSet, Clone, Debug, Hash, PartialEq, Eq)]
diff --git a/crates/bevy_gltf/Cargo.toml b/crates/bevy_gltf/Cargo.toml
index a7f94ef82d..3fc387902f 100644
--- a/crates/bevy_gltf/Cargo.toml
+++ b/crates/bevy_gltf/Cargo.toml
@@ -60,4 +60,5 @@ smallvec = "1.11"
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_gltf/src/lib.rs b/crates/bevy_gltf/src/lib.rs
index de4751a697..a2fce065df 100644
--- a/crates/bevy_gltf/src/lib.rs
+++ b/crates/bevy_gltf/src/lib.rs
@@ -1,8 +1,9 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! Plugin providing an [`AssetLoader`](bevy_asset::AssetLoader) and type definitions
//! for loading glTF 2.0 (a standard 3D scene definition format) files in Bevy.
//!
//! The [glTF 2.0 specification](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html) defines the format of the glTF files.
-#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#[cfg(feature = "bevy_animation")]
use bevy_animation::AnimationClip;
diff --git a/crates/bevy_hierarchy/Cargo.toml b/crates/bevy_hierarchy/Cargo.toml
index 9262ca8336..74a9b434f3 100644
--- a/crates/bevy_hierarchy/Cargo.toml
+++ b/crates/bevy_hierarchy/Cargo.toml
@@ -31,4 +31,5 @@ smallvec = { version = "1.11", features = ["union", "const_generics"] }
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_hierarchy/src/lib.rs b/crates/bevy_hierarchy/src/lib.rs
index 464acada7d..9ef22a7ab5 100644
--- a/crates/bevy_hierarchy/src/lib.rs
+++ b/crates/bevy_hierarchy/src/lib.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! Parent-child relationships for Bevy entities.
//!
//! You should use the tools in this crate
@@ -44,7 +46,6 @@
//! [plugin]: HierarchyPlugin
//! [query extension methods]: HierarchyQueryExt
//! [world]: BuildWorldChildren
-#![cfg_attr(docsrs, feature(doc_auto_cfg))]
mod components;
pub use components::*;
diff --git a/crates/bevy_input/Cargo.toml b/crates/bevy_input/Cargo.toml
index fbad74b9d5..d696e208f1 100644
--- a/crates/bevy_input/Cargo.toml
+++ b/crates/bevy_input/Cargo.toml
@@ -32,4 +32,5 @@ smol_str = "0.2"
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_input/src/lib.rs b/crates/bevy_input/src/lib.rs
index 489e12b2f4..f2bd0d5f1e 100644
--- a/crates/bevy_input/src/lib.rs
+++ b/crates/bevy_input/src/lib.rs
@@ -1,9 +1,10 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! Input functionality for the [Bevy game engine](https://bevyengine.org/).
//!
//! # Supported input devices
//!
//! `bevy` currently supports keyboard, mouse, gamepad, and touch inputs.
-#![cfg_attr(docsrs, feature(doc_auto_cfg))]
mod axis;
mod button_input;
diff --git a/crates/bevy_internal/Cargo.toml b/crates/bevy_internal/Cargo.toml
index fc7eb39ff1..b6a3db7699 100644
--- a/crates/bevy_internal/Cargo.toml
+++ b/crates/bevy_internal/Cargo.toml
@@ -207,3 +207,7 @@ bevy_dev_tools = { path = "../bevy_dev_tools", optional = true, version = "0.14.
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_internal/src/lib.rs b/crates/bevy_internal/src/lib.rs
index e7a46f246c..434755f9c1 100644
--- a/crates/bevy_internal/src/lib.rs
+++ b/crates/bevy_internal/src/lib.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! This module is separated into its own crate to enable simple dynamic linking for Bevy, and should not be used directly
/// `use bevy::prelude::*;` to import common components, bundles, and plugins.
diff --git a/crates/bevy_log/Cargo.toml b/crates/bevy_log/Cargo.toml
index eaf53d1f6c..33cee7bea4 100644
--- a/crates/bevy_log/Cargo.toml
+++ b/crates/bevy_log/Cargo.toml
@@ -40,4 +40,5 @@ tracing-wasm = "0.2.1"
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_log/src/lib.rs b/crates/bevy_log/src/lib.rs
index b6576acb17..b4c9a34f67 100644
--- a/crates/bevy_log/src/lib.rs
+++ b/crates/bevy_log/src/lib.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! This crate provides logging functions and configuration for [Bevy](https://bevyengine.org)
//! apps, and automatically configures platform specific log handlers (i.e. WASM or Android).
//!
@@ -9,7 +11,6 @@
//!
//! For more fine-tuned control over logging behavior, set up the [`LogPlugin`] or
//! `DefaultPlugins` during app initialization.
-#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#[cfg(feature = "trace")]
use std::panic;
diff --git a/crates/bevy_macro_utils/Cargo.toml b/crates/bevy_macro_utils/Cargo.toml
index 6dc67396bb..408716edd4 100644
--- a/crates/bevy_macro_utils/Cargo.toml
+++ b/crates/bevy_macro_utils/Cargo.toml
@@ -19,3 +19,7 @@ proc-macro2 = "1.0"
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_macro_utils/src/lib.rs b/crates/bevy_macro_utils/src/lib.rs
index 443313f8e8..535d61a09f 100644
--- a/crates/bevy_macro_utils/src/lib.rs
+++ b/crates/bevy_macro_utils/src/lib.rs
@@ -1,4 +1,6 @@
#![deny(unsafe_code)]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! A collection of helper types and functions for working on macros within the Bevy ecosystem.
extern crate proc_macro;
diff --git a/crates/bevy_math/Cargo.toml b/crates/bevy_math/Cargo.toml
index 3423759ebe..28ab5d1cd3 100644
--- a/crates/bevy_math/Cargo.toml
+++ b/crates/bevy_math/Cargo.toml
@@ -45,4 +45,5 @@ rand = ["dep:rand"]
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_math/src/lib.rs b/crates/bevy_math/src/lib.rs
index 0d76500703..4698604c8c 100644
--- a/crates/bevy_math/src/lib.rs
+++ b/crates/bevy_math/src/lib.rs
@@ -1,9 +1,10 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! Provides math types and functionality for the Bevy game engine.
//!
//! The commonly used types are vectors like [`Vec2`] and [`Vec3`],
//! matrices like [`Mat2`], [`Mat3`] and [`Mat4`] and orientation representations
//! like [`Quat`].
-#![cfg_attr(docsrs, feature(doc_auto_cfg))]
mod affine3;
mod aspect_ratio;
diff --git a/crates/bevy_mikktspace/Cargo.toml b/crates/bevy_mikktspace/Cargo.toml
index 78f66e821a..9119e80a83 100644
--- a/crates/bevy_mikktspace/Cargo.toml
+++ b/crates/bevy_mikktspace/Cargo.toml
@@ -22,3 +22,7 @@ name = "generate"
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_mikktspace/src/lib.rs b/crates/bevy_mikktspace/src/lib.rs
index cbf2c0c7ad..5f37ab2eff 100644
--- a/crates/bevy_mikktspace/src/lib.rs
+++ b/crates/bevy_mikktspace/src/lib.rs
@@ -6,6 +6,7 @@
)]
// FIXME(3492): remove once docs are ready
#![allow(missing_docs)]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
use glam::{Vec2, Vec3};
diff --git a/crates/bevy_panic_handler/Cargo.toml b/crates/bevy_panic_handler/Cargo.toml
index 24b96de3c2..5a99d2bd33 100644
--- a/crates/bevy_panic_handler/Cargo.toml
+++ b/crates/bevy_panic_handler/Cargo.toml
@@ -20,4 +20,5 @@ console_error_panic_hook = "0.1.6"
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_panic_handler/src/lib.rs b/crates/bevy_panic_handler/src/lib.rs
index 8e3705980d..dec5c000a7 100644
--- a/crates/bevy_panic_handler/src/lib.rs
+++ b/crates/bevy_panic_handler/src/lib.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! This crate provides panic handlers for [Bevy](https://bevyengine.org)
//! apps, and automatically configures platform specifics (i.e. WASM or Android).
//!
@@ -5,7 +7,6 @@
//!
//! For more fine-tuned control over panic behavior, disable the [`PanicHandlerPlugin`] or
//! `DefaultPlugins` during app initialization.
-#![cfg_attr(docsrs, feature(doc_auto_cfg))]
use bevy_app::{App, Plugin};
diff --git a/crates/bevy_pbr/Cargo.toml b/crates/bevy_pbr/Cargo.toml
index 0b148fc272..3bf23e9123 100644
--- a/crates/bevy_pbr/Cargo.toml
+++ b/crates/bevy_pbr/Cargo.toml
@@ -46,4 +46,5 @@ nonmax = "0.5"
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_ptr/Cargo.toml b/crates/bevy_ptr/Cargo.toml
index ae443652d1..d76b911e78 100644
--- a/crates/bevy_ptr/Cargo.toml
+++ b/crates/bevy_ptr/Cargo.toml
@@ -12,3 +12,7 @@ keywords = ["bevy", "no_std"]
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_ptr/src/lib.rs b/crates/bevy_ptr/src/lib.rs
index d6c0322461..19a34b412d 100644
--- a/crates/bevy_ptr/src/lib.rs
+++ b/crates/bevy_ptr/src/lib.rs
@@ -1,5 +1,6 @@
#![doc = include_str!("../README.md")]
#![no_std]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
use core::fmt::{self, Formatter, Pointer};
use core::{
diff --git a/crates/bevy_reflect/Cargo.toml b/crates/bevy_reflect/Cargo.toml
index 5cb69dc88e..b9fe3e4bb6 100644
--- a/crates/bevy_reflect/Cargo.toml
+++ b/crates/bevy_reflect/Cargo.toml
@@ -59,4 +59,5 @@ required-features = ["documentation"]
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_reflect/bevy_reflect_derive/Cargo.toml b/crates/bevy_reflect/bevy_reflect_derive/Cargo.toml
index e076283ac8..deee32d666 100644
--- a/crates/bevy_reflect/bevy_reflect_derive/Cargo.toml
+++ b/crates/bevy_reflect/bevy_reflect_derive/Cargo.toml
@@ -26,3 +26,7 @@ uuid = { version = "1.1", features = ["v4"] }
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/lib.rs b/crates/bevy_reflect/bevy_reflect_derive/src/lib.rs
index 5be3723b7b..743c558dde 100644
--- a/crates/bevy_reflect/bevy_reflect_derive/src/lib.rs
+++ b/crates/bevy_reflect/bevy_reflect_derive/src/lib.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! This crate contains macros used by Bevy's `Reflect` API.
//!
//! The main export of this crate is the derive macro for [`Reflect`]. This allows
diff --git a/crates/bevy_reflect/src/lib.rs b/crates/bevy_reflect/src/lib.rs
index cf4a181cbf..53ffa6be7a 100644
--- a/crates/bevy_reflect/src/lib.rs
+++ b/crates/bevy_reflect/src/lib.rs
@@ -1,5 +1,6 @@
// FIXME(3492): remove once docs are ready
#![allow(missing_docs)]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
//! Reflection in Rust.
//!
@@ -467,7 +468,6 @@
//! [orphan rule]: https://doc.rust-lang.org/book/ch10-02-traits.html#implementing-a-trait-on-a-type:~:text=But%20we%20can%E2%80%99t,implementation%20to%20use.
//! [`bevy_reflect_derive/documentation`]: bevy_reflect_derive
//! [derive `Reflect`]: derive@crate::Reflect
-#![cfg_attr(docsrs, feature(doc_auto_cfg))]
mod array;
mod fields;
diff --git a/crates/bevy_render/Cargo.toml b/crates/bevy_render/Cargo.toml
index 49079ed558..2b1783e911 100644
--- a/crates/bevy_render/Cargo.toml
+++ b/crates/bevy_render/Cargo.toml
@@ -122,4 +122,5 @@ wasm-bindgen = "0.2"
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_render/macros/Cargo.toml b/crates/bevy_render/macros/Cargo.toml
index 231662720b..f00570e012 100644
--- a/crates/bevy_render/macros/Cargo.toml
+++ b/crates/bevy_render/macros/Cargo.toml
@@ -20,3 +20,7 @@ quote = "1.0"
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_render/macros/src/lib.rs b/crates/bevy_render/macros/src/lib.rs
index 43af3eff89..5398037e5b 100644
--- a/crates/bevy_render/macros/src/lib.rs
+++ b/crates/bevy_render/macros/src/lib.rs
@@ -1,5 +1,6 @@
// FIXME(3492): remove once docs are ready
#![allow(missing_docs)]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
mod as_bind_group;
mod extract_component;
diff --git a/crates/bevy_scene/Cargo.toml b/crates/bevy_scene/Cargo.toml
index 061ec93751..7a3236be8a 100644
--- a/crates/bevy_scene/Cargo.toml
+++ b/crates/bevy_scene/Cargo.toml
@@ -40,4 +40,5 @@ rmp-serde = "1.1"
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_scene/src/lib.rs b/crates/bevy_scene/src/lib.rs
index 507e7cbcf6..bcb554c3f5 100644
--- a/crates/bevy_scene/src/lib.rs
+++ b/crates/bevy_scene/src/lib.rs
@@ -1,9 +1,10 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! Provides scene definition, instantiation and serialization/deserialization.
//!
//! Scenes are collections of entities and their associated components that can be
//! instantiated or removed from a world to allow composition. Scenes can be serialized/deserialized,
//! for example to save part of the world state to a file.
-#![cfg_attr(docsrs, feature(doc_auto_cfg))]
mod bundle;
mod dynamic_scene;
diff --git a/crates/bevy_sprite/Cargo.toml b/crates/bevy_sprite/Cargo.toml
index ba2d5d0ed9..a2ec75bfde 100644
--- a/crates/bevy_sprite/Cargo.toml
+++ b/crates/bevy_sprite/Cargo.toml
@@ -39,3 +39,7 @@ radsort = "0.1"
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_sprite/src/lib.rs b/crates/bevy_sprite/src/lib.rs
index 685ecb0d4b..f7ccd2d8a1 100644
--- a/crates/bevy_sprite/src/lib.rs
+++ b/crates/bevy_sprite/src/lib.rs
@@ -1,5 +1,6 @@
// FIXME(3492): remove once docs are ready
#![allow(missing_docs)]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
//! Provides 2D sprite rendering functionality.
mod bundle;
diff --git a/crates/bevy_tasks/Cargo.toml b/crates/bevy_tasks/Cargo.toml
index ee73b120ac..b3a70bafbd 100644
--- a/crates/bevy_tasks/Cargo.toml
+++ b/crates/bevy_tasks/Cargo.toml
@@ -29,4 +29,5 @@ web-time = { version = "0.2" }
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_text/Cargo.toml b/crates/bevy_text/Cargo.toml
index 6fc3deb8a9..cdd26c618e 100644
--- a/crates/bevy_text/Cargo.toml
+++ b/crates/bevy_text/Cargo.toml
@@ -41,4 +41,5 @@ approx = "0.5.1"
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_time/Cargo.toml b/crates/bevy_time/Cargo.toml
index 5a7ccb9a57..a2ea432d86 100644
--- a/crates/bevy_time/Cargo.toml
+++ b/crates/bevy_time/Cargo.toml
@@ -32,4 +32,5 @@ thiserror = "1.0"
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_transform/Cargo.toml b/crates/bevy_transform/Cargo.toml
index 5662117c68..1317324431 100644
--- a/crates/bevy_transform/Cargo.toml
+++ b/crates/bevy_transform/Cargo.toml
@@ -36,4 +36,5 @@ serialize = ["dep:serde", "bevy_math/serialize"]
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_ui/Cargo.toml b/crates/bevy_ui/Cargo.toml
index 92547a2fe3..d7882c7da4 100644
--- a/crates/bevy_ui/Cargo.toml
+++ b/crates/bevy_ui/Cargo.toml
@@ -41,8 +41,10 @@ smallvec = "1.11"
[features]
serialize = ["serde", "smallvec/serde"]
-[package.metadata.docs.rs]
-all-features = true
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_ui/src/lib.rs b/crates/bevy_ui/src/lib.rs
index 2ec6b13035..b9fffe39e6 100644
--- a/crates/bevy_ui/src/lib.rs
+++ b/crates/bevy_ui/src/lib.rs
@@ -1,11 +1,11 @@
// FIXME(3492): remove once docs are ready
#![allow(missing_docs)]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
//! This crate contains Bevy's UI system, which can be used to create UI for both 2D and 3D games
//! # Basic usage
//! Spawn UI elements with [`node_bundles::ButtonBundle`], [`node_bundles::ImageBundle`], [`node_bundles::TextBundle`] and [`node_bundles::NodeBundle`]
//! This UI is laid out with the Flexbox and CSS Grid layout models (see )
-#![cfg_attr(docsrs, feature(doc_auto_cfg))]
pub mod measurement;
pub mod node_bundles;
diff --git a/crates/bevy_utils/Cargo.toml b/crates/bevy_utils/Cargo.toml
index 88fe6dc0a5..8b6ac50a76 100644
--- a/crates/bevy_utils/Cargo.toml
+++ b/crates/bevy_utils/Cargo.toml
@@ -27,3 +27,7 @@ getrandom = { version = "0.2.0", features = ["js"] }
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_utils/macros/Cargo.toml b/crates/bevy_utils/macros/Cargo.toml
index b30d885a1d..998bf6e2ff 100644
--- a/crates/bevy_utils/macros/Cargo.toml
+++ b/crates/bevy_utils/macros/Cargo.toml
@@ -15,3 +15,7 @@ proc-macro2 = "1.0"
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_utils/macros/src/lib.rs b/crates/bevy_utils/macros/src/lib.rs
index 9b1fb1cfe5..23b11fd7cd 100644
--- a/crates/bevy_utils/macros/src/lib.rs
+++ b/crates/bevy_utils/macros/src/lib.rs
@@ -1,5 +1,6 @@
// FIXME(3492): remove once docs are ready
#![allow(missing_docs)]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
use proc_macro::TokenStream;
use quote::{format_ident, quote};
diff --git a/crates/bevy_utils/src/lib.rs b/crates/bevy_utils/src/lib.rs
index d142f43fbc..0f89cf9682 100644
--- a/crates/bevy_utils/src/lib.rs
+++ b/crates/bevy_utils/src/lib.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! General utilities for first-party [Bevy] engine crates.
//!
//! [Bevy]: https://bevyengine.org/
diff --git a/crates/bevy_window/Cargo.toml b/crates/bevy_window/Cargo.toml
index d455a2ebe8..6555e8acb6 100644
--- a/crates/bevy_window/Cargo.toml
+++ b/crates/bevy_window/Cargo.toml
@@ -34,4 +34,5 @@ smol_str = "0.2"
workspace = true
[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
all-features = true
diff --git a/crates/bevy_window/src/lib.rs b/crates/bevy_window/src/lib.rs
index ff722ef9df..cfee984087 100644
--- a/crates/bevy_window/src/lib.rs
+++ b/crates/bevy_window/src/lib.rs
@@ -1,10 +1,11 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! `bevy_window` provides a platform-agnostic interface for windowing in Bevy.
//!
//! This crate contains types for window management and events,
//! used by windowing implementors such as `bevy_winit`.
//! The [`WindowPlugin`] sets up some global window-related parameters and
//! is part of the [`DefaultPlugins`](https://docs.rs/bevy/latest/bevy/struct.DefaultPlugins.html).
-#![cfg_attr(docsrs, feature(doc_auto_cfg))]
use bevy_a11y::Focus;
diff --git a/crates/bevy_winit/Cargo.toml b/crates/bevy_winit/Cargo.toml
index 063085b6a0..d617ba3297 100644
--- a/crates/bevy_winit/Cargo.toml
+++ b/crates/bevy_winit/Cargo.toml
@@ -50,8 +50,10 @@ wasm-bindgen = { version = "0.2" }
web-sys = "0.3"
crossbeam-channel = "0.5"
-[package.metadata.docs.rs]
-all-features = true
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/crates/bevy_winit/src/lib.rs b/crates/bevy_winit/src/lib.rs
index a50ecdf0c5..e5356826fa 100644
--- a/crates/bevy_winit/src/lib.rs
+++ b/crates/bevy_winit/src/lib.rs
@@ -1,10 +1,11 @@
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+
//! `bevy_winit` provides utilities to handle window creation and the eventloop through [`winit`]
//!
//! Most commonly, the [`WinitPlugin`] is used as part of
//! [`DefaultPlugins`](https://docs.rs/bevy/latest/bevy/struct.DefaultPlugins.html).
//! The app's [runner](bevy_app::App::runner) is set by `WinitPlugin` and handles the `winit` [`EventLoop`].
//! See `winit_runner` for details.
-#![cfg_attr(docsrs, feature(doc_auto_cfg))]
pub mod accessibility;
mod converters;
diff --git a/errors/Cargo.toml b/errors/Cargo.toml
index 01fe856cc7..d59a0b216a 100644
--- a/errors/Cargo.toml
+++ b/errors/Cargo.toml
@@ -6,8 +6,13 @@ description = "Bevy's error codes"
publish = false
license = "MIT OR Apache-2.0"
-[lints]
-workspace = true
[dependencies]
bevy = { path = ".." }
+
+[lints]
+workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/examples/mobile/Cargo.toml b/examples/mobile/Cargo.toml
index e1e768a2fc..b6bc2739b2 100644
--- a/examples/mobile/Cargo.toml
+++ b/examples/mobile/Cargo.toml
@@ -34,3 +34,7 @@ label = "Bevy Example"
[lints]
workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/src/lib.rs b/src/lib.rs
index c8a6964c57..7301dfedf5 100755
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,4 +1,5 @@
#![allow(clippy::single_component_path_imports)]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
//! [](https://bevyengine.org)
//!
diff --git a/tools/build-templated-pages/Cargo.toml b/tools/build-templated-pages/Cargo.toml
index 5b0e5e1eff..4079d49e6d 100644
--- a/tools/build-templated-pages/Cargo.toml
+++ b/tools/build-templated-pages/Cargo.toml
@@ -6,8 +6,6 @@ description = "handle templated pages in Bevy repository"
publish = false
license = "MIT OR Apache-2.0"
-[lints]
-workspace = true
[dependencies]
toml_edit = { version = "0.22.7", default-features = false, features = [
@@ -17,3 +15,10 @@ tera = "1.15"
serde = { version = "1.0", features = ["derive"] }
bitflags = "2.3"
hashbrown = { version = "0.14", features = ["serde"] }
+
+[lints]
+workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/tools/build-wasm-example/Cargo.toml b/tools/build-wasm-example/Cargo.toml
index 511ca208d4..969a4d3077 100644
--- a/tools/build-wasm-example/Cargo.toml
+++ b/tools/build-wasm-example/Cargo.toml
@@ -6,9 +6,14 @@ description = "Build an example for wasm"
publish = false
license = "MIT OR Apache-2.0"
-[lints]
-workspace = true
[dependencies]
xshell = "0.2"
clap = { version = "4.0", features = ["derive"] }
+
+[lints]
+workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/tools/ci/Cargo.toml b/tools/ci/Cargo.toml
index 7e6b3e8187..dd3c0d265d 100644
--- a/tools/ci/Cargo.toml
+++ b/tools/ci/Cargo.toml
@@ -6,9 +6,13 @@ description = "CI script for Bevy"
publish = false
license = "MIT OR Apache-2.0"
-[lints]
-workspace = true
-
[dependencies]
xshell = "0.2"
bitflags = "2.3"
+
+[lints]
+workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true
diff --git a/tools/example-showcase/Cargo.toml b/tools/example-showcase/Cargo.toml
index 184a002c0f..4058cdbed1 100644
--- a/tools/example-showcase/Cargo.toml
+++ b/tools/example-showcase/Cargo.toml
@@ -6,8 +6,6 @@ description = "Run examples"
publish = false
license = "MIT OR Apache-2.0"
-[lints]
-workspace = true
[dependencies]
xshell = "0.2"
@@ -17,3 +15,10 @@ toml_edit = { version = "0.22.7", default-features = false, features = [
"parse",
] }
pbr = "1.1"
+
+[lints]
+workspace = true
+
+[package.metadata.docs.rs]
+rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
+all-features = true