Skip to content

Commit 145414c

Browse files
yrnsspectria-limina
authored andcommitted
Add "all-features = true" to docs.rs metadata for most crates (#12366)
# Objective Fix missing `TextBundle` (and many others) which are present in the main crate as default features but optional in the sub-crate. See: - https://docs.rs/bevy/0.13.0/bevy/ui/node_bundles/index.html - https://docs.rs/bevy_ui/0.13.0/bevy_ui/node_bundles/index.html ~~There are probably other instances in other crates that I could track down, but maybe "all-features = true" should be used by default in all sub-crates? Not sure.~~ (There were many.) I only noticed this because rust-analyzer's "open docs" features takes me to the sub-crate, not the main one. ## Solution Add "all-features = true" to docs.rs metadata for crates that use features. ## Changelog ### Changed - Unified features documented on docs.rs between main crate and sub-crates
1 parent 729d0a8 commit 145414c

File tree

52 files changed

+100
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+100
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2787,3 +2787,4 @@ panic = "abort"
27872787

27882788
[package.metadata.docs.rs]
27892789
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
2790+
all-features = true

crates/bevy_app/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ web-sys = { version = "0.3", features = ["Window"] }
3434

3535
[lints]
3636
workspace = true
37+
38+
[package.metadata.docs.rs]
39+
all-features = true

crates/bevy_app/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! This crate is about everything concerning the highest-level, application layer of a Bevy app.
2+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
23

34
mod app;
45
mod main_schedule;

crates/bevy_asset/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,6 @@ bevy_log = { path = "../bevy_log", version = "0.14.0-dev" }
5959

6060
[lints]
6161
workspace = true
62+
63+
[package.metadata.docs.rs]
64+
all-features = true

crates/bevy_asset/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// FIXME(3492): remove once docs are ready
22
#![allow(missing_docs)]
3+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
34

45
pub mod io;
56
pub mod meta;

crates/bevy_audio/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ android_shared_stdcxx = ["cpal/oboe-shared-stdcxx"]
4949

5050
[lints]
5151
workspace = true
52+
53+
[package.metadata.docs.rs]
54+
all-features = true

crates/bevy_audio/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
//! }
2121
//! ```
2222
#![forbid(unsafe_code)]
23+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
2324

2425
mod audio;
2526
mod audio_output;

crates/bevy_core/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ crossbeam-channel = "0.5.0"
3535

3636
[lints]
3737
workspace = true
38+
39+
[package.metadata.docs.rs]
40+
all-features = true

crates/bevy_core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! This crate provides core functionality for Bevy Engine.
2+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
23

34
mod name;
45
#[cfg(feature = "serialize")]

crates/bevy_core_pipeline/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ nonmax = "0.5"
4040

4141
[lints]
4242
workspace = true
43+
44+
[package.metadata.docs.rs]
45+
all-features = true

crates/bevy_core_pipeline/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// FIXME(3492): remove once docs are ready
22
#![allow(missing_docs)]
3+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
34

45
pub mod blit;
56
pub mod bloom;

crates/bevy_dev_tools/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ ron = { version = "0.8.0", optional = true }
2626

2727
[lints]
2828
workspace = true
29+
30+
[package.metadata.docs.rs]
31+
all-features = true

crates/bevy_dev_tools/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! This crate provides additional utilities for the [Bevy game engine](https://bevyengine.org),
22
//! focused on improving developer experience.
3+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
34

45
use bevy_app::prelude::*;
56
#[cfg(feature = "bevy_ci_testing")]

crates/bevy_diagnostic/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ sysinfo = { version = "0.30.0", optional = true, default-features = false }
3636

3737
[lints]
3838
workspace = true
39+
40+
[package.metadata.docs.rs]
41+
all-features = true

crates/bevy_diagnostic/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// FIXME(3492): remove once docs are ready
22
#![allow(missing_docs)]
3+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
34

45
//! This crate provides a straightforward solution for integrating diagnostics in the [Bevy game engine](https://bevyengine.org/).
56
//! It allows users to easily add diagnostic functionality to their Bevy applications, enhancing

crates/bevy_ecs/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ path = "examples/change_detection.rs"
4949

5050
[lints]
5151
workspace = true
52+
53+
[package.metadata.docs.rs]
54+
all-features = true

crates/bevy_ecs/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// FIXME(11590): remove this once the lint is fixed
22
#![allow(unsafe_op_in_unsafe_fn)]
33
#![doc = include_str!("../README.md")]
4+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
45

56
#[cfg(target_pointer_width = "16")]
67
compile_error!("bevy_ecs cannot safely compile for a 16-bit platform.");

crates/bevy_gizmos/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ bytemuck = "1.0"
3232

3333
[lints]
3434
workspace = true
35+
36+
[package.metadata.docs.rs]
37+
all-features = true

crates/bevy_gizmos/src/lib.rs

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
//! ```
1414
//!
1515
//! See the documentation on [Gizmos](crate::gizmos::Gizmos) for more examples.
16+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
1617

1718
/// System set label for the systems handling the rendering of gizmos.
1819
#[derive(SystemSet, Clone, Debug, Hash, PartialEq, Eq)]

crates/bevy_gltf/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ smallvec = "1.11"
5858

5959
[lints]
6060
workspace = true
61+
62+
[package.metadata.docs.rs]
63+
all-features = true

crates/bevy_gltf/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//! for loading glTF 2.0 (a standard 3D scene definition format) files in Bevy.
33
//!
44
//! The [glTF 2.0 specification](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html) defines the format of the glTF files.
5+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
56

67
#[cfg(feature = "bevy_animation")]
78
use bevy_animation::AnimationClip;

crates/bevy_hierarchy/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ smallvec = { version = "1.11", features = ["union", "const_generics"] }
2929

3030
[lints]
3131
workspace = true
32+
33+
[package.metadata.docs.rs]
34+
all-features = true

crates/bevy_hierarchy/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
//! [plugin]: HierarchyPlugin
4545
//! [query extension methods]: HierarchyQueryExt
4646
//! [world]: BuildWorldChildren
47+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
4748

4849
mod components;
4950
pub use components::*;

crates/bevy_input/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ smol_str = "0.2"
3030

3131
[lints]
3232
workspace = true
33+
34+
[package.metadata.docs.rs]
35+
all-features = true

crates/bevy_input/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//! # Supported input devices
44
//!
55
//! `bevy` currently supports keyboard, mouse, gamepad, and touch inputs.
6+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
67

78
mod axis;
89
mod button_input;

crates/bevy_log/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ tracing-wasm = "0.2.1"
3939

4040
[lints]
4141
workspace = true
42+
43+
[package.metadata.docs.rs]
44+
all-features = true

crates/bevy_log/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
//!
1010
//! For more fine-tuned control over logging behavior, set up the [`LogPlugin`] or
1111
//! `DefaultPlugins` during app initialization.
12+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
1213

1314
#[cfg(feature = "trace")]
1415
use std::panic;

crates/bevy_math/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ debug_glam_assert = ["glam/debug-glam-assert"]
3535

3636
[lints]
3737
workspace = true
38+
39+
[package.metadata.docs.rs]
40+
all-features = true

crates/bevy_math/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//! The commonly used types are vectors like [`Vec2`] and [`Vec3`],
44
//! matrices like [`Mat2`], [`Mat3`] and [`Mat4`] and orientation representations
55
//! like [`Quat`].
6+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
67

78
mod affine3;
89
mod aspect_ratio;

crates/bevy_pbr/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ nonmax = "0.5"
4444

4545
[lints]
4646
workspace = true
47+
48+
[package.metadata.docs.rs]
49+
all-features = true

crates/bevy_pbr/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// FIXME(3492): remove once docs are ready
22
#![allow(missing_docs)]
3+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
34

45
pub mod wireframe;
56

crates/bevy_reflect/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,6 @@ required-features = ["documentation"]
5757

5858
[lints]
5959
workspace = true
60+
61+
[package.metadata.docs.rs]
62+
all-features = true

crates/bevy_reflect/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@
467467
//! [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.
468468
//! [`bevy_reflect_derive/documentation`]: bevy_reflect_derive
469469
//! [derive `Reflect`]: derive@crate::Reflect
470+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
470471

471472
mod array;
472473
mod fields;

crates/bevy_render/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,6 @@ wasm-bindgen = "0.2"
119119

120120
[lints]
121121
workspace = true
122+
123+
[package.metadata.docs.rs]
124+
all-features = true

crates/bevy_render/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// FIXME(3492): remove once docs are ready
22
#![allow(missing_docs)]
3+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
34

45
#[cfg(target_pointer_width = "16")]
56
compile_error!("bevy_render cannot compile for a 16-bit platform.");

crates/bevy_scene/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ rmp-serde = "1.1"
3838

3939
[lints]
4040
workspace = true
41+
42+
[package.metadata.docs.rs]
43+
all-features = true

crates/bevy_scene/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//! Scenes are collections of entities and their associated components that can be
44
//! instantiated or removed from a world to allow composition. Scenes can be serialized/deserialized,
55
//! for example to save part of the world state to a file.
6+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
67

78
mod bundle;
89
mod dynamic_scene;

crates/bevy_tasks/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ web-time = { version = "0.2" }
2727

2828
[lints]
2929
workspace = true
30+
31+
[package.metadata.docs.rs]
32+
all-features = true

crates/bevy_tasks/src/lib.rs

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![doc = include_str!("../README.md")]
2+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
23

34
mod slice;
45
pub use slice::{ParallelSlice, ParallelSliceMut};

crates/bevy_text/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ approx = "0.5.1"
3939

4040
[lints]
4141
workspace = true
42+
43+
[package.metadata.docs.rs]
44+
all-features = true

crates/bevy_text/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// FIXME(3492): remove once docs are ready
22
#![allow(missing_docs)]
3+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
34

45
mod error;
56
mod font;

crates/bevy_time/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ thiserror = "1.0"
3030

3131
[lints]
3232
workspace = true
33+
34+
[package.metadata.docs.rs]
35+
all-features = true

crates/bevy_time/src/lib.rs

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![doc = include_str!("../README.md")]
2+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
23

34
/// Common run conditions
45
pub mod common_conditions;

crates/bevy_transform/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ serialize = ["dep:serde", "bevy_math/serialize"]
3434

3535
[lints]
3636
workspace = true
37+
38+
[package.metadata.docs.rs]
39+
all-features = true

crates/bevy_transform/src/lib.rs

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![doc = include_str!("../README.md")]
2+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
23

34
pub mod commands;
45
/// The basic components of the transform crate

crates/bevy_ui/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@ smallvec = "1.11"
4141
[features]
4242
serialize = ["serde", "smallvec/serde"]
4343

44+
[package.metadata.docs.rs]
45+
all-features = true
46+
4447
[lints]
4548
workspace = true

crates/bevy_ui/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//! # Basic usage
66
//! Spawn UI elements with [`node_bundles::ButtonBundle`], [`node_bundles::ImageBundle`], [`node_bundles::TextBundle`] and [`node_bundles::NodeBundle`]
77
//! This UI is laid out with the Flexbox and CSS Grid layout models (see <https://cssreference.io/flexbox/>)
8+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
89

910
pub mod measurement;
1011
pub mod node_bundles;

crates/bevy_window/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ smol_str = "0.2"
3232

3333
[lints]
3434
workspace = true
35+
36+
[package.metadata.docs.rs]
37+
all-features = true

crates/bevy_window/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//! used by windowing implementors such as `bevy_winit`.
55
//! The [`WindowPlugin`] sets up some global window-related parameters and
66
//! is part of the [`DefaultPlugins`](https://docs.rs/bevy/latest/bevy/struct.DefaultPlugins.html).
7+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
78

89
use bevy_a11y::Focus;
910

crates/bevy_winit/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ web-sys = "0.3"
5151
crossbeam-channel = "0.5"
5252

5353
[package.metadata.docs.rs]
54-
features = ["x11"]
54+
all-features = true
5555

5656
[lints]
5757
workspace = true

crates/bevy_winit/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//! [`DefaultPlugins`](https://docs.rs/bevy/latest/bevy/struct.DefaultPlugins.html).
55
//! The app's [runner](bevy_app::App::runner) is set by `WinitPlugin` and handles the `winit` [`EventLoop`].
66
//! See `winit_runner` for details.
7+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
78

89
pub mod accessibility;
910
mod converters;

src/lib.rs

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
html_logo_url = "https://bevyengine.org/assets/icon.png",
4545
html_favicon_url = "https://bevyengine.org/assets/icon.png"
4646
)]
47+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
4748

4849
pub use bevy_internal::*;
4950

0 commit comments

Comments
 (0)