Skip to content

Commit fb7fc88

Browse files
bas-iemrchantey
authored andcommitted
Rust 1.83, allow -> expect (missing_docs) (bevyengine#16561)
# Objective We were waiting for 1.83 to address most of these, due to a bug with `missing_docs` and `expect`. Relates to, but does not entirely complete, bevyengine#15059. ## Solution - Upgrade to 1.83 - Switch `allow(missing_docs)` to `expect(missing_docs)` - Remove a few now-unused `allow`s along the way, or convert to `expect`
1 parent 1b90f87 commit fb7fc88

File tree

25 files changed

+67
-61
lines changed

25 files changed

+67
-61
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ keywords = ["game", "engine", "gamedev", "graphics", "bevy"]
1010
license = "MIT OR Apache-2.0"
1111
repository = "https://github.com/bevyengine/bevy"
1212
documentation = "https://docs.rs/bevy"
13-
rust-version = "1.82.0"
13+
rust-version = "1.83.0"
1414

1515
[workspace]
1616
exclude = [

crates/bevy_app/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
// `rustdoc_internals` is needed for `#[doc(fake_variadics)]`
2-
#![allow(internal_features)]
1+
#![cfg_attr(
2+
any(docsrs, docsrs_dep),
3+
expect(
4+
internal_features,
5+
reason = "rustdoc_internals is needed for fake_variadic"
6+
)
7+
)]
38
#![cfg_attr(any(docsrs, docsrs_dep), feature(doc_auto_cfg, rustdoc_internals))]
49
#![forbid(unsafe_code)]
510
#![doc(

crates/bevy_asset/macros/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
2-
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
32
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
43

54
use bevy_macro_utils::BevyManifest;

crates/bevy_asset/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,7 @@
138138
//! If you want to save your assets back to disk, you should implement [`AssetSaver`](saver::AssetSaver) as well.
139139
//! This trait mirrors [`AssetLoader`] in structure, and works in tandem with [`AssetWriter`](io::AssetWriter), which mirrors [`AssetReader`](io::AssetReader).
140140
141-
// FIXME(3492): remove once docs are ready
142-
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
143-
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
141+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
144142
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
145143
#![doc(
146144
html_logo_url = "https://bevyengine.org/assets/icon.png",

crates/bevy_core_pipeline/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
2-
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
32
#![forbid(unsafe_code)]
43
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
54
#![doc(

crates/bevy_derive/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
2-
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
32
#![forbid(unsafe_code)]
43
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
54
#![doc(

crates/bevy_diagnostic/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
2-
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
32
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
43
#![forbid(unsafe_code)]
54
#![doc(

crates/bevy_ecs/macros/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
2-
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
32
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
43

54
extern crate proc_macro;

crates/bevy_ecs/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
// TODO: remove once Edition 2024 is released
44
#![allow(dependency_on_unit_never_type_fallback)]
55
#![doc = include_str!("../README.md")]
6-
// `rustdoc_internals` is needed for `#[doc(fake_variadics)]`
7-
#![allow(internal_features)]
6+
#![cfg_attr(
7+
any(docsrs, docsrs_dep),
8+
expect(
9+
internal_features,
10+
reason = "rustdoc_internals is needed for fake_variadic"
11+
)
12+
)]
813
#![cfg_attr(any(docsrs, docsrs_dep), feature(doc_auto_cfg, rustdoc_internals))]
914
#![allow(unsafe_code)]
1015
#![doc(

crates/bevy_encase_derive/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
2-
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
32
#![forbid(unsafe_code)]
43
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
54
#![doc(

crates/bevy_image/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
2-
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
32
#![allow(unsafe_code)]
43

54
pub mod prelude {

crates/bevy_math/src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#![forbid(unsafe_code)]
2-
#![allow(internal_features)]
2+
#![cfg_attr(
3+
any(docsrs, docsrs_dep),
4+
expect(
5+
internal_features,
6+
reason = "rustdoc_internals is needed for fake_variadic"
7+
)
8+
)]
39
#![cfg_attr(any(docsrs, docsrs_dep), feature(rustdoc_internals))]
410
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
511
#![doc(

crates/bevy_mesh/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
2-
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
3-
#![allow(unsafe_code)]
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
42

53
extern crate alloc;
64
extern crate core;

crates/bevy_mikktspace/tests/regression_test.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
#![allow(
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
2+
#![expect(
23
clippy::bool_assert_comparison,
3-
clippy::explicit_iter_loop,
4-
clippy::map_flatten,
5-
clippy::match_same_arms,
6-
clippy::redundant_else,
74
clippy::semicolon_if_nothing_returned,
8-
clippy::useless_conversion,
9-
missing_docs
5+
clippy::useless_conversion
106
)]
117

128
use bevy_mikktspace::{generate_tangents, Geometry};

crates/bevy_pbr/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
2-
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
32
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
43
#![deny(unsafe_code)]
54
#![doc(

crates/bevy_picking/src/backend.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ pub struct PointerHits {
8484
}
8585

8686
impl PointerHits {
87-
// FIXME(15321): solve CI failures, then replace with `#[expect()]`.
88-
#[allow(missing_docs, reason = "Not all docs are written yet (#3492).")]
87+
#[expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
8988
pub fn new(pointer: prelude::PointerId, picks: Vec<(Entity, HitData)>, order: f32) -> Self {
9089
Self {
9190
pointer,
@@ -113,8 +112,7 @@ pub struct HitData {
113112
}
114113

115114
impl HitData {
116-
// FIXME(15321): solve CI failures, then replace with `#[expect()]`.
117-
#[allow(missing_docs, reason = "Not all docs are written yet (#3492).")]
115+
#[expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
118116
pub fn new(camera: Entity, depth: f32, position: Option<Vec3>, normal: Option<Vec3>) -> Self {
119117
Self {
120118
camera,

crates/bevy_reflect/src/lib.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
2-
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
3-
// `rustdoc_internals` is needed for `#[doc(fake_variadics)]`
4-
#![allow(internal_features)]
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
2+
#![cfg_attr(
3+
any(docsrs, docsrs_dep),
4+
expect(
5+
internal_features,
6+
reason = "rustdoc_internals is needed for fake_variadic"
7+
)
8+
)]
59
#![cfg_attr(any(docsrs, docsrs_dep), feature(doc_auto_cfg, rustdoc_internals))]
610
#![doc(
711
html_logo_url = "https://bevyengine.org/assets/icon.png",

crates/bevy_render/macros/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
2-
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
32
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
43

54
mod as_bind_group;

crates/bevy_render/src/lib.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
2-
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
3-
#![allow(unsafe_code)]
4-
// `rustdoc_internals` is needed for `#[doc(fake_variadics)]`
5-
#![allow(internal_features)]
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
2+
#![expect(unsafe_code)]
3+
#![cfg_attr(
4+
any(docsrs, docsrs_dep),
5+
expect(
6+
internal_features,
7+
reason = "rustdoc_internals is needed for fake_variadic"
8+
)
9+
)]
610
#![cfg_attr(any(docsrs, docsrs_dep), feature(doc_auto_cfg, rustdoc_internals))]
711
#![doc(
812
html_logo_url = "https://bevyengine.org/assets/icon.png",

crates/bevy_sprite/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
2-
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
32
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
43
#![forbid(unsafe_code)]
54
#![doc(

crates/bevy_state/macros/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
2-
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
32
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
43

54
extern crate proc_macro;

crates/bevy_state/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@
2727
//! - The [`in_state<S>`](crate::condition::in_state) and [`state_changed<S>`](crate::condition::state_changed) run conditions - which are used
2828
//! to determine whether a system should run based on the current state.
2929
30-
// `rustdoc_internals` is needed for `#[doc(fake_variadics)]`
31-
#![allow(internal_features)]
30+
#![cfg_attr(
31+
any(docsrs, docsrs_dep),
32+
expect(
33+
internal_features,
34+
reason = "rustdoc_internals is needed for fake_variadic"
35+
)
36+
)]
3237
#![cfg_attr(any(docsrs, docsrs_dep), feature(rustdoc_internals))]
3338

3439
#[cfg(feature = "bevy_app")]

crates/bevy_ui/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
2-
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
32
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
43
#![doc(
54
html_logo_url = "https://bevyengine.org/assets/icon.png",

crates/bevy_window/src/event.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,7 @@ impl AppLifecycle {
412412
derive(serde::Serialize, serde::Deserialize),
413413
reflect(Serialize, Deserialize)
414414
)]
415-
// FIXME(15321): solve CI failures, then replace with `#[expect()]`.
416-
#[allow(missing_docs, reason = "Not all docs are written yet (#3492).")]
415+
#[expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
417416
pub enum WindowEvent {
418417
AppLifecycle(AppLifecycle),
419418
CursorEntered(CursorEntered),

tests/how_to_test_systems.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(missing_docs)]
1+
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
22
use bevy::prelude::*;
33

44
#[derive(Component, Default)]

0 commit comments

Comments
 (0)