Skip to content
5 changes: 4 additions & 1 deletion crates/bevy_reflect/src/from_reflect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ use crate::{FromType, Reflect};
/// [derive macro]: bevy_reflect_derive::FromReflect
/// [`DynamicStruct`]: crate::DynamicStruct
/// [crate-level documentation]: crate
#[diagnostic::on_unimplemented(message = "`{Self}` can not be created from a reflection")]
#[diagnostic::on_unimplemented(
message = "`{Self}` can not be created from a reflection",
note = "consider annotating `{Self}` with `#[derive(FromReflect)]`"
)]
pub trait FromReflect: Reflect + Sized {
/// Constructs a concrete instance of `Self` from a reflected value.
fn from_reflect(reflect: &dyn Reflect) -> Option<Self>;
Expand Down
4 changes: 0 additions & 4 deletions crates/bevy_reflect/src/path/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ impl<'a> From<AccessError<'a>> for ReflectPathError<'a> {
}

/// Something that can be interpreted as a reflection path in [`GetPath`].
#[diagnostic::on_unimplemented(
message = "`{Self}` is not a reflection path",
label = "invalid path"
)]
pub trait ReflectPath<'a>: Sized {
/// Gets a reference to the specified element on the given [`Reflect`] object.
///
Expand Down
5 changes: 4 additions & 1 deletion crates/bevy_reflect/src/type_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ use std::fmt::Debug;
/// ```
///
/// [utility]: crate::utility
#[diagnostic::on_unimplemented(message = "`{Self}` can not be typed through reflection")]
#[diagnostic::on_unimplemented(
message = "`{Self}` can not be typed through reflection",
note = "consider annotating `{Self}` with `#[derive(Reflect)]`"
)]
pub trait Typed: Reflect + TypePath {
/// Returns the compile-time [info] for the underlying type.
///
Expand Down
5 changes: 3 additions & 2 deletions crates/bevy_reflect/src/type_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ use std::fmt;
#[diagnostic::on_unimplemented(
message = "`{Self}` does not have a type path",
label = "invalid type",
note = "consider annotating `{Self}` with `#[derive(TypePath)]`"
note = "consider annotating `{Self}` with `#[derive(Reflect)]` or `#[derive(TypePath)]`"
)]
pub trait TypePath: 'static {
/// Returns the fully qualified path of the underlying type.
Expand Down Expand Up @@ -136,7 +136,8 @@ pub trait TypePath: 'static {
/// [`Reflect`]: crate::Reflect
#[diagnostic::on_unimplemented(
message = "`{Self}` can not be used as a dynamic type path",
label = "invalid type"
label = "invalid type",
note = "consider annotating `{Self}` with `#[derive(Reflect)]` or `#[derive(TypePath)]`"
)]
pub trait DynamicTypePath {
/// See [`TypePath::type_path`].
Expand Down