From 1867f1848a9c5a9fa43d093178aa815764f08238 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Mon, 5 Jun 2023 16:22:38 -0700 Subject: [PATCH 1/2] Reflect now requires DynamicTypePath. Remove Reflect::get_type_path() --- .../bevy_reflect_derive/src/impls/enums.rs | 5 --- .../bevy_reflect_derive/src/impls/structs.rs | 5 --- .../src/impls/tuple_structs.rs | 5 --- .../bevy_reflect_derive/src/impls/values.rs | 5 --- crates/bevy_reflect/src/array.rs | 12 ++---- crates/bevy_reflect/src/enums/dynamic_enum.rs | 9 +---- crates/bevy_reflect/src/impls/smallvec.rs | 11 ++---- crates/bevy_reflect/src/impls/std.rs | 38 +------------------ crates/bevy_reflect/src/list.rs | 8 +--- crates/bevy_reflect/src/map.rs | 9 +---- crates/bevy_reflect/src/reflect.rs | 10 +---- crates/bevy_reflect/src/struct_trait.rs | 8 +--- crates/bevy_reflect/src/tuple.rs | 16 ++------ crates/bevy_reflect/src/tuple_struct.rs | 8 +--- crates/bevy_reflect/src/type_info.rs | 1 - crates/bevy_reflect/src/type_path.rs | 4 -- crates/bevy_reflect/src/utility.rs | 3 -- 17 files changed, 18 insertions(+), 139 deletions(-) diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/impls/enums.rs b/crates/bevy_reflect/bevy_reflect_derive/src/impls/enums.rs index 365061df4f2ff..1a41f8e11530a 100644 --- a/crates/bevy_reflect/bevy_reflect_derive/src/impls/enums.rs +++ b/crates/bevy_reflect/bevy_reflect_derive/src/impls/enums.rs @@ -199,11 +199,6 @@ pub(crate) fn impl_enum(reflect_enum: &ReflectEnum) -> TokenStream { #FQOption::Some(::type_info()) } - #[inline] - fn get_type_path(&self) -> &dyn #bevy_reflect_path::DynamicTypePath { - self - } - #[inline] fn into_any(self: #FQBox) -> #FQBox { self diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/impls/structs.rs b/crates/bevy_reflect/bevy_reflect_derive/src/impls/structs.rs index 9c5d30ebad8d3..17180c16b15f8 100644 --- a/crates/bevy_reflect/bevy_reflect_derive/src/impls/structs.rs +++ b/crates/bevy_reflect/bevy_reflect_derive/src/impls/structs.rs @@ -174,11 +174,6 @@ pub(crate) fn impl_struct(reflect_struct: &ReflectStruct) -> TokenStream { #FQOption::Some(::type_info()) } - #[inline] - fn get_type_path(&self) -> &dyn #bevy_reflect_path::DynamicTypePath { - self - } - #[inline] fn into_any(self: #FQBox) -> #FQBox { self diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/impls/tuple_structs.rs b/crates/bevy_reflect/bevy_reflect_derive/src/impls/tuple_structs.rs index db4b839baa49e..0a5cbd8343d13 100644 --- a/crates/bevy_reflect/bevy_reflect_derive/src/impls/tuple_structs.rs +++ b/crates/bevy_reflect/bevy_reflect_derive/src/impls/tuple_structs.rs @@ -144,11 +144,6 @@ pub(crate) fn impl_tuple_struct(reflect_struct: &ReflectStruct) -> TokenStream { #FQOption::Some(::type_info()) } - #[inline] - fn get_type_path(&self) -> &dyn #bevy_reflect_path::DynamicTypePath { - self - } - #[inline] fn into_any(self: #FQBox) -> #FQBox { self diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/impls/values.rs b/crates/bevy_reflect/bevy_reflect_derive/src/impls/values.rs index b61b1ca9baf0b..5fc4fa8deedc9 100644 --- a/crates/bevy_reflect/bevy_reflect_derive/src/impls/values.rs +++ b/crates/bevy_reflect/bevy_reflect_derive/src/impls/values.rs @@ -56,11 +56,6 @@ pub(crate) fn impl_value(meta: &ReflectMeta) -> TokenStream { #FQOption::Some(::type_info()) } - #[inline] - fn get_type_path(&self) -> &dyn #bevy_reflect_path::DynamicTypePath { - self - } - #[inline] fn into_any(self: #FQBox) -> #FQBox { self diff --git a/crates/bevy_reflect/src/array.rs b/crates/bevy_reflect/src/array.rs index 7a4375f83a6a0..c1acb9835678b 100644 --- a/crates/bevy_reflect/src/array.rs +++ b/crates/bevy_reflect/src/array.rs @@ -1,9 +1,8 @@ -use bevy_reflect_derive::impl_type_path; - use crate::{ - self as bevy_reflect, utility::reflect_hasher, DynamicTypePath, Reflect, ReflectMut, - ReflectOwned, ReflectRef, TypeInfo, + self as bevy_reflect, utility::reflect_hasher, Reflect, ReflectMut, ReflectOwned, ReflectRef, + TypeInfo, }; +use bevy_reflect_derive::impl_type_path; use std::{ any::{Any, TypeId}, fmt::Debug, @@ -226,11 +225,6 @@ impl Reflect for DynamicArray { self.represented_type } - #[inline] - fn get_type_path(&self) -> &dyn DynamicTypePath { - self - } - #[inline] fn into_any(self: Box) -> Box { self diff --git a/crates/bevy_reflect/src/enums/dynamic_enum.rs b/crates/bevy_reflect/src/enums/dynamic_enum.rs index 6edc256c68439..32b752836da56 100644 --- a/crates/bevy_reflect/src/enums/dynamic_enum.rs +++ b/crates/bevy_reflect/src/enums/dynamic_enum.rs @@ -2,8 +2,8 @@ use bevy_reflect_derive::impl_type_path; use crate::{ self as bevy_reflect, enum_debug, enum_hash, enum_partial_eq, DynamicStruct, DynamicTuple, - DynamicTypePath, Enum, Reflect, ReflectMut, ReflectOwned, ReflectRef, Struct, Tuple, TypeInfo, - VariantFieldIter, VariantType, + Enum, Reflect, ReflectMut, ReflectOwned, ReflectRef, Struct, Tuple, TypeInfo, VariantFieldIter, + VariantType, }; use std::any::Any; use std::fmt::Formatter; @@ -300,11 +300,6 @@ impl Reflect for DynamicEnum { self.represented_type } - #[inline] - fn get_type_path(&self) -> &dyn DynamicTypePath { - self - } - #[inline] fn into_any(self: Box) -> Box { self diff --git a/crates/bevy_reflect/src/impls/smallvec.rs b/crates/bevy_reflect/src/impls/smallvec.rs index eb6a4b1c025ad..1f7bce2b8bcb4 100644 --- a/crates/bevy_reflect/src/impls/smallvec.rs +++ b/crates/bevy_reflect/src/impls/smallvec.rs @@ -4,9 +4,9 @@ use std::any::Any; use crate::utility::GenericTypeInfoCell; use crate::{ - self as bevy_reflect, DynamicTypePath, FromReflect, FromType, GetTypeRegistration, List, - ListInfo, ListIter, Reflect, ReflectFromPtr, ReflectMut, ReflectOwned, ReflectRef, TypeInfo, - TypePath, TypeRegistration, Typed, + self as bevy_reflect, FromReflect, FromType, GetTypeRegistration, List, ListInfo, ListIter, + Reflect, ReflectFromPtr, ReflectMut, ReflectOwned, ReflectRef, TypeInfo, TypePath, + TypeRegistration, Typed, }; impl List for SmallVec @@ -88,11 +88,6 @@ where Some(::type_info()) } - #[inline] - fn get_type_path(&self) -> &dyn DynamicTypePath { - self - } - fn into_any(self: Box) -> Box { self } diff --git a/crates/bevy_reflect/src/impls/std.rs b/crates/bevy_reflect/src/impls/std.rs index 806aff9fa8af0..9f21e2e3f07ee 100644 --- a/crates/bevy_reflect/src/impls/std.rs +++ b/crates/bevy_reflect/src/impls/std.rs @@ -2,8 +2,8 @@ use crate::std_traits::ReflectDefault; use crate::{self as bevy_reflect, ReflectFromPtr, ReflectFromReflect, ReflectOwned}; use crate::{ impl_type_path, map_apply, map_partial_eq, Array, ArrayInfo, ArrayIter, DynamicEnum, - DynamicMap, DynamicTypePath, Enum, EnumInfo, FromReflect, FromType, GetTypeRegistration, List, - ListInfo, ListIter, Map, MapInfo, MapIter, Reflect, ReflectDeserialize, ReflectMut, ReflectRef, + DynamicMap, Enum, EnumInfo, FromReflect, FromType, GetTypeRegistration, List, ListInfo, + ListIter, Map, MapInfo, MapIter, Reflect, ReflectDeserialize, ReflectMut, ReflectRef, ReflectSerialize, TupleVariantInfo, TypeInfo, TypePath, TypeRegistration, Typed, UnitVariantInfo, UnnamedField, ValueInfo, VariantFieldIter, VariantInfo, VariantType, }; @@ -332,11 +332,6 @@ macro_rules! impl_reflect_for_veclike { Some(::type_info()) } - #[inline] - fn get_type_path(&self) -> &dyn DynamicTypePath { - self - } - fn into_any(self: Box) -> Box { self } @@ -555,10 +550,6 @@ macro_rules! impl_reflect_for_hashmap { Some(::type_info()) } - fn get_type_path(&self) -> &dyn DynamicTypePath { - self - } - fn into_any(self: Box) -> Box { self } @@ -721,11 +712,6 @@ impl Reflect for [T; N] { Some(::type_info()) } - #[inline] - fn get_type_path(&self) -> &dyn DynamicTypePath { - self - } - #[inline] fn into_any(self: Box) -> Box { self @@ -943,11 +929,6 @@ impl Reflect for Option { Some(::type_info()) } - #[inline] - fn get_type_path(&self) -> &dyn DynamicTypePath { - self - } - #[inline] fn into_any(self: Box) -> Box { self @@ -1115,11 +1096,6 @@ impl Reflect for Cow<'static, str> { Some(::type_info()) } - #[inline] - fn get_type_path(&self) -> &dyn DynamicTypePath { - self - } - fn into_any(self: Box) -> Box { self } @@ -1252,11 +1228,6 @@ impl Reflect for &'static Path { Some(::type_info()) } - #[inline] - fn get_type_path(&self) -> &dyn DynamicTypePath { - self - } - fn into_any(self: Box) -> Box { self } @@ -1366,11 +1337,6 @@ impl Reflect for Cow<'static, Path> { std::any::type_name::() } - #[inline] - fn get_type_path(&self) -> &dyn DynamicTypePath { - self - } - fn get_represented_type_info(&self) -> Option<&'static TypeInfo> { Some(::type_info()) } diff --git a/crates/bevy_reflect/src/list.rs b/crates/bevy_reflect/src/list.rs index b040464ec33fa..94c269c5203c4 100644 --- a/crates/bevy_reflect/src/list.rs +++ b/crates/bevy_reflect/src/list.rs @@ -6,8 +6,7 @@ use bevy_reflect_derive::impl_type_path; use crate::utility::reflect_hasher; use crate::{ - self as bevy_reflect, DynamicTypePath, FromReflect, Reflect, ReflectMut, ReflectOwned, - ReflectRef, TypeInfo, + self as bevy_reflect, FromReflect, Reflect, ReflectMut, ReflectOwned, ReflectRef, TypeInfo, }; /// A trait used to power [list-like] operations via [reflection]. @@ -276,11 +275,6 @@ impl Reflect for DynamicList { self.represented_type } - #[inline] - fn get_type_path(&self) -> &dyn DynamicTypePath { - self - } - #[inline] fn into_any(self: Box) -> Box { self diff --git a/crates/bevy_reflect/src/map.rs b/crates/bevy_reflect/src/map.rs index 3b9c0c751bc27..e31f4280c2aa6 100644 --- a/crates/bevy_reflect/src/map.rs +++ b/crates/bevy_reflect/src/map.rs @@ -5,9 +5,7 @@ use std::hash::Hash; use bevy_reflect_derive::impl_type_path; use bevy_utils::{Entry, HashMap}; -use crate::{ - self as bevy_reflect, DynamicTypePath, Reflect, ReflectMut, ReflectOwned, ReflectRef, TypeInfo, -}; +use crate::{self as bevy_reflect, Reflect, ReflectMut, ReflectOwned, ReflectRef, TypeInfo}; /// A trait used to power [map-like] operations via [reflection]. /// @@ -310,11 +308,6 @@ impl Reflect for DynamicMap { self.represented_type } - #[inline] - fn get_type_path(&self) -> &dyn DynamicTypePath { - self - } - fn into_any(self: Box) -> Box { self } diff --git a/crates/bevy_reflect/src/reflect.rs b/crates/bevy_reflect/src/reflect.rs index 53bf3aca1a0e5..9c33ff6753bb5 100644 --- a/crates/bevy_reflect/src/reflect.rs +++ b/crates/bevy_reflect/src/reflect.rs @@ -72,7 +72,7 @@ pub enum ReflectOwned { /// [`bevy_reflect`]: crate /// [derive macro]: bevy_reflect_derive::Reflect /// [crate-level documentation]: crate -pub trait Reflect: Any + Send + Sync { +pub trait Reflect: DynamicTypePath + Any + Send + Sync { /// Returns the [type name][std::any::type_name] of the underlying type. fn type_name(&self) -> &str; @@ -93,14 +93,6 @@ pub trait Reflect: Any + Send + Sync { /// [`TypeRegistry::get_type_info`]: crate::TypeRegistry::get_type_info fn get_represented_type_info(&self) -> Option<&'static TypeInfo>; - /// Returns the [`TypePath`] implementation for the underlying type. - /// - /// Methods on [`DynamicTypePath`] suffer the same performance concerns as [`get_represented_type_info`]. - /// - /// [`TypePath`]: crate::TypePath - /// [`get_represented_type_info`]: Reflect::get_represented_type_info - fn get_type_path(&self) -> &dyn DynamicTypePath; - /// Returns the value as a [`Box`][std::any::Any]. fn into_any(self: Box) -> Box; diff --git a/crates/bevy_reflect/src/struct_trait.rs b/crates/bevy_reflect/src/struct_trait.rs index fce88b78dd47c..36e3aaa56a830 100644 --- a/crates/bevy_reflect/src/struct_trait.rs +++ b/crates/bevy_reflect/src/struct_trait.rs @@ -1,6 +1,5 @@ use crate::{ - self as bevy_reflect, DynamicTypePath, NamedField, Reflect, ReflectMut, ReflectOwned, - ReflectRef, TypeInfo, + self as bevy_reflect, NamedField, Reflect, ReflectMut, ReflectOwned, ReflectRef, TypeInfo, }; use bevy_reflect_derive::impl_type_path; use bevy_utils::{Entry, HashMap}; @@ -405,11 +404,6 @@ impl Reflect for DynamicStruct { self.represented_type } - #[inline] - fn get_type_path(&self) -> &dyn DynamicTypePath { - self - } - #[inline] fn into_any(self: Box) -> Box { self diff --git a/crates/bevy_reflect/src/tuple.rs b/crates/bevy_reflect/src/tuple.rs index 2c7c6afaaa685..0480d3b3094a3 100644 --- a/crates/bevy_reflect/src/tuple.rs +++ b/crates/bevy_reflect/src/tuple.rs @@ -1,9 +1,9 @@ use bevy_reflect_derive::impl_type_path; use crate::{ - self as bevy_reflect, utility::GenericTypePathCell, DynamicTypePath, FromReflect, - GetTypeRegistration, Reflect, ReflectMut, ReflectOwned, ReflectRef, TypeInfo, TypePath, - TypeRegistration, Typed, UnnamedField, + self as bevy_reflect, utility::GenericTypePathCell, FromReflect, GetTypeRegistration, Reflect, + ReflectMut, ReflectOwned, ReflectRef, TypeInfo, TypePath, TypeRegistration, Typed, + UnnamedField, }; use std::any::{Any, TypeId}; use std::borrow::Cow; @@ -321,11 +321,6 @@ impl Reflect for DynamicTuple { self.represented_type } - #[inline] - fn get_type_path(&self) -> &dyn DynamicTypePath { - self - } - #[inline] fn into_any(self: Box) -> Box { self @@ -538,11 +533,6 @@ macro_rules! impl_reflect_tuple { Some(::type_info()) } - #[inline] - fn get_type_path(&self) -> &dyn DynamicTypePath { - self - } - fn into_any(self: Box) -> Box { self } diff --git a/crates/bevy_reflect/src/tuple_struct.rs b/crates/bevy_reflect/src/tuple_struct.rs index b2703b65aa7b5..ae455be39108c 100644 --- a/crates/bevy_reflect/src/tuple_struct.rs +++ b/crates/bevy_reflect/src/tuple_struct.rs @@ -1,8 +1,7 @@ use bevy_reflect_derive::impl_type_path; use crate::{ - self as bevy_reflect, DynamicTypePath, Reflect, ReflectMut, ReflectOwned, ReflectRef, TypeInfo, - UnnamedField, + self as bevy_reflect, Reflect, ReflectMut, ReflectOwned, ReflectRef, TypeInfo, UnnamedField, }; use std::any::{Any, TypeId}; use std::fmt::{Debug, Formatter}; @@ -308,11 +307,6 @@ impl Reflect for DynamicTupleStruct { self.represented_type } - #[inline] - fn get_type_path(&self) -> &dyn DynamicTypePath { - self - } - #[inline] fn into_any(self: Box) -> Box { self diff --git a/crates/bevy_reflect/src/type_info.rs b/crates/bevy_reflect/src/type_info.rs index 7a4099815ab5f..c24d42abe3d37 100644 --- a/crates/bevy_reflect/src/type_info.rs +++ b/crates/bevy_reflect/src/type_info.rs @@ -51,7 +51,6 @@ use std::fmt::Debug; /// # impl Reflect for MyStruct { /// # fn type_name(&self) -> &str { todo!() } /// # fn get_represented_type_info(&self) -> Option<&'static TypeInfo> { todo!() } -/// # fn get_type_path(&self) -> &dyn DynamicTypePath { todo!() } /// # fn into_any(self: Box) -> Box { todo!() } /// # fn as_any(&self) -> &dyn Any { todo!() } /// # fn as_any_mut(&mut self) -> &mut dyn Any { todo!() } diff --git a/crates/bevy_reflect/src/type_path.rs b/crates/bevy_reflect/src/type_path.rs index 387fb11930d9c..8238c998cbb5f 100644 --- a/crates/bevy_reflect/src/type_path.rs +++ b/crates/bevy_reflect/src/type_path.rs @@ -123,10 +123,6 @@ pub trait TypePath: 'static { } /// Dynamic dispatch for [`TypePath`]. -/// -/// Retrieved using [`Reflect::get_type_path`]. -/// -/// [`Reflect::get_type_path`]: crate::Reflect::get_type_path pub trait DynamicTypePath { /// See [`TypePath::type_path`]. fn reflect_type_path(&self) -> &str; diff --git a/crates/bevy_reflect/src/utility.rs b/crates/bevy_reflect/src/utility.rs index 6344072b08215..ae910fc0dae4e 100644 --- a/crates/bevy_reflect/src/utility.rs +++ b/crates/bevy_reflect/src/utility.rs @@ -70,7 +70,6 @@ mod sealed { /// # /// # impl Reflect for Foo { /// # fn type_name(&self) -> &str { todo!() } -/// # fn get_type_path(&self) -> &dyn DynamicTypePath { todo!() } /// # fn get_represented_type_info(&self) -> Option<&'static TypeInfo> { todo!() } /// # fn into_any(self: Box) -> Box { todo!() } /// # fn as_any(&self) -> &dyn Any { todo!() } @@ -142,7 +141,6 @@ impl NonGenericTypeCell { /// # /// # impl Reflect for Foo { /// # fn type_name(&self) -> &str { todo!() } -/// # fn get_type_path(&self) -> &dyn DynamicTypePath { todo!() } /// # fn get_represented_type_info(&self) -> Option<&'static TypeInfo> { todo!() } /// # fn into_any(self: Box) -> Box { todo!() } /// # fn as_any(&self) -> &dyn Any { todo!() } @@ -182,7 +180,6 @@ impl NonGenericTypeCell { /// # /// # impl Reflect for Foo { /// # fn type_name(&self) -> &str { todo!() } -/// # fn get_type_path(&self) -> &dyn DynamicTypePath { todo!() } /// # fn get_represented_type_info(&self) -> Option<&'static TypeInfo> { todo!() } /// # fn into_any(self: Box) -> Box { todo!() } /// # fn as_any(&self) -> &dyn Any { todo!() } From d78d7f9eb54d0c695624a2b887dad3f9814fff0c Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Mon, 5 Jun 2023 18:12:15 -0700 Subject: [PATCH 2/2] Fix doc tests --- crates/bevy_reflect/src/type_info.rs | 7 ++++++- crates/bevy_reflect/src/utility.rs | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/crates/bevy_reflect/src/type_info.rs b/crates/bevy_reflect/src/type_info.rs index c24d42abe3d37..6db1f26b49992 100644 --- a/crates/bevy_reflect/src/type_info.rs +++ b/crates/bevy_reflect/src/type_info.rs @@ -24,7 +24,7 @@ use std::fmt::Debug; /// /// ``` /// # use std::any::Any; -/// # use bevy_reflect::{DynamicTypePath, NamedField, Reflect, ReflectMut, ReflectOwned, ReflectRef, StructInfo, TypeInfo, ValueInfo}; +/// # use bevy_reflect::{DynamicTypePath, NamedField, Reflect, ReflectMut, ReflectOwned, ReflectRef, StructInfo, TypeInfo, TypePath, ValueInfo}; /// # use bevy_reflect::utility::NonGenericTypeInfoCell; /// use bevy_reflect::Typed; /// @@ -64,6 +64,11 @@ use std::fmt::Debug; /// # fn reflect_owned(self: Box) -> ReflectOwned { todo!() } /// # fn clone_value(&self) -> Box { todo!() } /// # } +/// # +/// # impl TypePath for MyStruct { +/// # fn type_path() -> &'static str { todo!() } +/// # fn short_type_path() -> &'static str { todo!() } +/// # } /// ``` /// /// [utility]: crate::utility diff --git a/crates/bevy_reflect/src/utility.rs b/crates/bevy_reflect/src/utility.rs index ae910fc0dae4e..0ffc09bb8ccde 100644 --- a/crates/bevy_reflect/src/utility.rs +++ b/crates/bevy_reflect/src/utility.rs @@ -50,7 +50,7 @@ mod sealed { /// /// ``` /// # use std::any::Any; -/// # use bevy_reflect::{DynamicTypePath, NamedField, Reflect, ReflectMut, ReflectOwned, ReflectRef, StructInfo, Typed, TypeInfo}; +/// # use bevy_reflect::{DynamicTypePath, NamedField, Reflect, ReflectMut, ReflectOwned, ReflectRef, StructInfo, Typed, TypeInfo, TypePath}; /// use bevy_reflect::utility::NonGenericTypeInfoCell; /// /// struct Foo { @@ -84,6 +84,11 @@ mod sealed { /// # fn reflect_owned(self: Box) -> ReflectOwned { todo!() } /// # fn clone_value(&self) -> Box { todo!() } /// # } + +/// # impl TypePath for Foo { +/// # fn type_path() -> &'static str { todo!() } +/// # fn short_type_path() -> &'static str { todo!() } +/// # } /// ``` /// /// [`TypePath`]: crate::TypePath @@ -123,7 +128,7 @@ impl NonGenericTypeCell { /// /// ``` /// # use std::any::Any; -/// # use bevy_reflect::{DynamicTypePath, Reflect, ReflectMut, ReflectOwned, ReflectRef, TupleStructInfo, Typed, TypeInfo, UnnamedField}; +/// # use bevy_reflect::{DynamicTypePath, Reflect, ReflectMut, ReflectOwned, ReflectRef, TupleStructInfo, Typed, TypeInfo, TypePath, UnnamedField}; /// use bevy_reflect::utility::GenericTypeInfoCell; /// /// struct Foo(T); @@ -155,6 +160,10 @@ impl NonGenericTypeCell { /// # fn reflect_owned(self: Box) -> ReflectOwned { todo!() } /// # fn clone_value(&self) -> Box { todo!() } /// # } +/// # impl TypePath for Foo { +/// # fn type_path() -> &'static str { todo!() } +/// # fn short_type_path() -> &'static str { todo!() } +/// # } /// ``` /// /// Implementing [`TypePath`] with generics. @@ -178,7 +187,7 @@ impl NonGenericTypeCell { /// } /// } /// # -/// # impl Reflect for Foo { +/// # impl Reflect for Foo { /// # fn type_name(&self) -> &str { todo!() } /// # fn get_represented_type_info(&self) -> Option<&'static TypeInfo> { todo!() } /// # fn into_any(self: Box) -> Box { todo!() }