Skip to content

Commit ee6dfd3

Browse files
alice-i-cecileAlice Cecile
andauthored
Revert "Add on_unimplemented Diagnostics to Most Public Traits" (#13413)
# Objective - Rust 1.78 breaks all Android support, see #13331 - We should not bump the MSRV to 1.78 until that's resolved in #13366. ## Solution - Temporarily revert #13347 Co-authored-by: Alice Cecile <[email protected]>
1 parent 1fcf6a4 commit ee6dfd3

30 files changed

+12
-129
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.78.0"
13+
rust-version = "1.77.0"
1414

1515
[workspace]
1616
exclude = [

crates/bevy_app/src/plugin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ use std::any::Any;
5454
/// }
5555
/// }
5656
/// # fn damp_flickering() {}
57-
/// ```
57+
/// ````
5858
pub trait Plugin: Downcast + Any + Send + Sync {
5959
/// Configures the [`App`] to which this plugin is added.
6060
fn build(&self, app: &mut App);

crates/bevy_asset/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,6 @@ impl Plugin for AssetPlugin {
223223
}
224224
}
225225

226-
#[diagnostic::on_unimplemented(
227-
message = "`{Self}` is not an `Asset`",
228-
label = "invalid `Asset`",
229-
note = "consider annotating `{Self}` with `#[derive(Asset)]`"
230-
)]
231226
pub trait Asset: VisitAssetDependencies + TypePath + Send + Sync + 'static {}
232227

233228
pub trait VisitAssetDependencies {

crates/bevy_ecs/src/bundle.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,6 @@ use std::ptr::NonNull;
141141
// bundle, in the _exact_ order that [`DynamicBundle::get_components`] is called.
142142
// - [`Bundle::from_components`] must call `func` exactly once for each [`ComponentId`] returned by
143143
// [`Bundle::component_ids`].
144-
#[diagnostic::on_unimplemented(
145-
message = "`{Self}` is not a `Bundle`",
146-
label = "invalid `Bundle`",
147-
note = "consider annotating `{Self}` with `#[derive(Component)]` or `#[derive(Bundle)]`"
148-
)]
149144
pub unsafe trait Bundle: DynamicBundle + Send + Sync + 'static {
150145
/// Gets this [`Bundle`]'s component ids, in the order of this bundle's [`Component`]s
151146
#[doc(hidden)]

crates/bevy_ecs/src/component.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,6 @@ use std::{
150150
///
151151
/// [`SyncCell`]: bevy_utils::synccell::SyncCell
152152
/// [`Exclusive`]: https://doc.rust-lang.org/nightly/std/sync/struct.Exclusive.html
153-
#[diagnostic::on_unimplemented(
154-
message = "`{Self}` is not a `Component`",
155-
label = "invalid `Component`",
156-
note = "consider annotating `{Self}` with `#[derive(Component)]`"
157-
)]
158153
pub trait Component: Send + Sync + 'static {
159154
/// A constant indicating the storage type used for this component.
160155
const STORAGE_TYPE: StorageType;

crates/bevy_ecs/src/entity/map_entities.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ use super::EntityHashMap;
3737
/// }
3838
/// }
3939
/// ```
40+
///
4041
pub trait MapEntities {
4142
/// Updates all [`Entity`] references stored inside using `entity_mapper`.
4243
///

crates/bevy_ecs/src/event.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ use std::{
2828
/// You can conveniently access events using the [`EventReader`] and [`EventWriter`] system parameter.
2929
///
3030
/// Events must be thread-safe.
31-
#[diagnostic::on_unimplemented(
32-
message = "`{Self}` is not an `Event`",
33-
label = "invalid `Event`",
34-
note = "consider annotating `{Self}` with `#[derive(Event]`"
35-
)]
3631
pub trait Event: Send + Sync + 'static {}
3732

3833
/// An `EventId` uniquely identifies an event stored in a specific [`World`].

crates/bevy_ecs/src/query/fetch.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,6 @@ use std::{cell::UnsafeCell, marker::PhantomData};
268268
///
269269
/// [`Query`]: crate::system::Query
270270
/// [`ReadOnly`]: Self::ReadOnly
271-
#[diagnostic::on_unimplemented(
272-
message = "`{Self}` is not valid to request as data in a `Query`",
273-
label = "invalid `Query` data"
274-
)]
275271
pub unsafe trait QueryData: WorldQuery {
276272
/// The read-only variant of this [`QueryData`], which satisfies the [`ReadOnlyQueryData`] trait.
277273
type ReadOnly: ReadOnlyQueryData<State = <Self as WorldQuery>::State>;

crates/bevy_ecs/src/query/filter.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,7 @@ use std::{cell::UnsafeCell, marker::PhantomData};
7070
/// [`matches_component_set`]: Self::matches_component_set
7171
/// [`Query`]: crate::system::Query
7272
/// [`State`]: Self::State
73-
#[diagnostic::on_unimplemented(
74-
message = "`{Self}` is not a valid `Query` filter",
75-
label = "invalid `Query` filter",
76-
note = "a `QueryFilter` typically uses a combination of `With<T>` and `Without<T>` statements"
77-
)]
73+
7874
pub trait QueryFilter: WorldQuery {
7975
/// Returns true if (and only if) this Filter relies strictly on archetypes to limit which
8076
/// components are accessed by the Query.
@@ -942,11 +938,6 @@ impl<T: Component> QueryFilter for Changed<T> {
942938
///
943939
/// [`Added`] and [`Changed`] works with entities, and therefore are not archetypal. As such
944940
/// they do not implement [`ArchetypeFilter`].
945-
#[diagnostic::on_unimplemented(
946-
message = "`{Self}` is not a valid `Query` filter based on archetype information",
947-
label = "invalid `Query` filter",
948-
note = "an `ArchetypeFilter` typically uses a combination of `With<T>` and `Without<T>` statements"
949-
)]
950941
pub trait ArchetypeFilter: QueryFilter {}
951942

952943
impl<T: Component> ArchetypeFilter for With<T> {}

crates/bevy_ecs/src/schedule/config.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,6 @@ impl<T> NodeConfigs<T> {
288288
/// )
289289
/// );
290290
/// ```
291-
#[diagnostic::on_unimplemented(
292-
message = "`{Self}` does not describe a valid system configuration",
293-
label = "invalid system configuration"
294-
)]
295291
pub trait IntoSystemConfigs<Marker>
296292
where
297293
Self: Sized,
@@ -566,10 +562,6 @@ impl SystemSetConfig {
566562
pub type SystemSetConfigs = NodeConfigs<InternedSystemSet>;
567563

568564
/// Types that can convert into a [`SystemSetConfigs`].
569-
#[diagnostic::on_unimplemented(
570-
message = "`{Self}` does not describe a valid system set configuration",
571-
label = "invalid system set configuration"
572-
)]
573565
pub trait IntoSystemSetConfigs
574566
where
575567
Self: Sized,

0 commit comments

Comments
 (0)