File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ use bevy_reflect_derive::impl_type_path;
6868///
6969/// [`dyn PartialReflect`]: PartialReflect
7070/// [derives `Reflect`]: derive@crate::Reflect
71+ #[ diagnostic:: on_unimplemented(
72+ message = "`{Self}` does not implement `CastPartialReflect` so cannot be cast to `dyn PartialReflect`" ,
73+ note = "consider annotating `{Self}` with `#[derive(Reflect)]`"
74+ ) ]
7175pub trait CastPartialReflect : Send + Sync + ' static {
7276 /// Casts this type to a [`dyn PartialReflect`] reference.
7377 ///
@@ -112,6 +116,10 @@ impl<T: ?Sized + CastPartialReflect> CastPartialReflect for Box<T> {
112116///
113117/// [`dyn Reflect`]: Reflect
114118/// [derives `Reflect`]: derive@crate::Reflect
119+ #[ diagnostic:: on_unimplemented(
120+ message = "`{Self}` does not implement `CastReflect` so cannot be cast to `dyn Reflect`" ,
121+ note = "consider annotating `{Self}` with `#[derive(Reflect)]`"
122+ ) ]
115123pub trait CastReflect : CastPartialReflect {
116124 /// Casts this type to a [`dyn Reflect`] reference.
117125 ///
You can’t perform that action at this time.
0 commit comments