File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ use crate::{FromType, Reflect};
2121/// [derive macro]: bevy_reflect_derive::FromReflect
2222/// [`DynamicStruct`]: crate::DynamicStruct
2323/// [crate-level documentation]: crate
24- #[ diagnostic:: on_unimplemented( message = "`{Self}` can not be created from a reflection" ) ]
24+ #[ diagnostic:: on_unimplemented(
25+ message = "`{Self}` can not be created from a reflection" ,
26+ note = "consider annotating `{Self}` with `#[derive(FromReflect)]`"
27+ ) ]
2528pub trait FromReflect : Reflect + Sized {
2629 /// Constructs a concrete instance of `Self` from a reflected value.
2730 fn from_reflect ( reflect : & dyn Reflect ) -> Option < Self > ;
Original file line number Diff line number Diff line change @@ -44,10 +44,6 @@ impl<'a> From<AccessError<'a>> for ReflectPathError<'a> {
4444}
4545
4646/// Something that can be interpreted as a reflection path in [`GetPath`].
47- #[ diagnostic:: on_unimplemented(
48- message = "`{Self}` is not a reflection path" ,
49- label = "invalid path"
50- ) ]
5147pub trait ReflectPath < ' a > : Sized {
5248 /// Gets a reference to the specified element on the given [`Reflect`] object.
5349 ///
Original file line number Diff line number Diff line change @@ -70,7 +70,10 @@ use std::fmt::Debug;
7070/// ```
7171///
7272/// [utility]: crate::utility
73- #[ diagnostic:: on_unimplemented( message = "`{Self}` can not be typed through reflection" ) ]
73+ #[ diagnostic:: on_unimplemented(
74+ message = "`{Self}` can not be typed through reflection" ,
75+ note = "consider annotating `{Self}` with `#[derive(Reflect)]`"
76+ ) ]
7477pub trait Typed : Reflect + TypePath {
7578 /// Returns the compile-time [info] for the underlying type.
7679 ///
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ use std::fmt;
8282#[ diagnostic:: on_unimplemented(
8383 message = "`{Self}` does not have a type path" ,
8484 label = "invalid type" ,
85- note = "consider annotating `{Self}` with `#[derive(TypePath)]`"
85+ note = "consider annotating `{Self}` with `#[derive(Reflect)]` or `#[derive( TypePath)]`"
8686) ]
8787pub trait TypePath : ' static {
8888 /// Returns the fully qualified path of the underlying type.
@@ -136,7 +136,8 @@ pub trait TypePath: 'static {
136136/// [`Reflect`]: crate::Reflect
137137#[ diagnostic:: on_unimplemented(
138138 message = "`{Self}` can not be used as a dynamic type path" ,
139- label = "invalid type"
139+ label = "invalid type" ,
140+ note = "consider annotating `{Self}` with `#[derive(Reflect)]` or `#[derive(TypePath)]`"
140141) ]
141142pub trait DynamicTypePath {
142143 /// See [`TypePath::type_path`].
You can’t perform that action at this time.
0 commit comments