Skip to content

Commit

Permalink
Fix CI errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MrGVSV committed Aug 12, 2024
1 parent 0103072 commit d8f7d9b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ mod incorrect_inner_type {
use bevy_reflect::{FromReflect, GetTypeRegistration, reflect_remote};

#[reflect_remote(super::external_crate::TheirOuter<T>)]
//~^ ERROR: `TheirInner<T>` can not be reflected
//~| ERROR: `TheirInner<T>` can not be reflected
//~| ERROR: `TheirInner<T>` can not be reflected
//~^ ERROR: `TheirInner<T>` does not implement `PartialReflect` so cannot be introspected
//~| ERROR: `TheirInner<T>` does not implement `PartialReflect` so cannot be introspected
//~| ERROR: `TheirInner<T>` does not implement `PartialReflect` so cannot be introspected
//~| ERROR: `TheirInner<T>` can not be used as a dynamic type path
//~| ERROR: `?` operator has incompatible types
struct MyOuter<T: FromReflect + GetTypeRegistration> {
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_reflect/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2882,7 +2882,7 @@ bevy_reflect::tests::Test {
value: "Hello".to_string(),
},
output,
)
);
}

#[test]
Expand Down
18 changes: 9 additions & 9 deletions crates/bevy_reflect/src/reflect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ impl dyn PartialReflect {
/// If the underlying value does not implement [`Reflect`]
/// or is not of type `T`, returns `Err(self)`.
///
/// For remote types, `T` should be the type itself rather than the wraper type.
/// For remote types, `T` should be the type itself rather than the wrapper type.
pub fn try_downcast<T: Any>(
self: Box<dyn PartialReflect>,
) -> Result<Box<T>, Box<dyn PartialReflect>> {
Expand All @@ -471,7 +471,7 @@ impl dyn PartialReflect {
/// If the underlying value does not implement [`Reflect`]
/// or is not of type `T`, returns `Err(self)`.
///
/// For remote types, `T` should be the type itself rather than the wraper type.
/// For remote types, `T` should be the type itself rather than the wrapper type.
pub fn try_take<T: Any>(self: Box<dyn PartialReflect>) -> Result<T, Box<dyn PartialReflect>> {
self.try_downcast().map(|value| *value)
}
Expand All @@ -481,7 +481,7 @@ impl dyn PartialReflect {
/// If the underlying value does not implement [`Reflect`]
/// or is not of type `T`, returns [`None`].
///
/// For remote types, `T` should be the type itself rather than the wraper type.
/// For remote types, `T` should be the type itself rather than the wrapper type.
pub fn try_downcast_ref<T: Any>(&self) -> Option<&T> {
self.try_as_reflect()?.downcast_ref()
}
Expand All @@ -491,7 +491,7 @@ impl dyn PartialReflect {
/// If the underlying value does not implement [`Reflect`]
/// or is not of type `T`, returns [`None`].
///
/// For remote types, `T` should be the type itself rather than the wraper type.
/// For remote types, `T` should be the type itself rather than the wrapper type.
pub fn try_downcast_mut<T: Any>(&mut self) -> Option<&mut T> {
self.try_as_reflect_mut()?.downcast_mut()
}
Expand Down Expand Up @@ -521,7 +521,7 @@ impl dyn Reflect {
///
/// If the underlying value is not of type `T`, returns `Err(self)`.
///
/// For remote types, `T` should be the type itself rather than the wraper type.
/// For remote types, `T` should be the type itself rather than the wrapper type.
pub fn downcast<T: Any>(self: Box<dyn Reflect>) -> Result<Box<T>, Box<dyn Reflect>> {
if self.is::<T>() {
Ok(self.into_any().downcast().unwrap())
Expand All @@ -534,7 +534,7 @@ impl dyn Reflect {
///
/// If the underlying value is not of type `T`, returns `Err(self)`.
///
/// For remote types, `T` should be the type itself rather than the wraper type.
/// For remote types, `T` should be the type itself rather than the wrapper type.
pub fn take<T: Any>(self: Box<dyn Reflect>) -> Result<T, Box<dyn Reflect>> {
self.downcast::<T>().map(|value| *value)
}
Expand All @@ -548,7 +548,7 @@ impl dyn Reflect {
/// to determine what type they represent. Represented types cannot be downcasted
/// to, but you can use [`FromReflect`] to create a value of the represented type from them.
///
/// For remote types, `T` should be the type itself rather than the wraper type.
/// For remote types, `T` should be the type itself rather than the wrapper type.
///
/// [`FromReflect`]: crate::FromReflect
#[inline]
Expand All @@ -560,7 +560,7 @@ impl dyn Reflect {
///
/// If the underlying value is not of type `T`, returns `None`.
///
/// For remote types, `T` should be the type itself rather than the wraper type.
/// For remote types, `T` should be the type itself rather than the wrapper type.
#[inline]
pub fn downcast_ref<T: Any>(&self) -> Option<&T> {
self.as_any().downcast_ref::<T>()
Expand All @@ -570,7 +570,7 @@ impl dyn Reflect {
///
/// If the underlying value is not of type `T`, returns `None`.
///
/// For remote types, `T` should be the type itself rather than the wraper type.
/// For remote types, `T` should be the type itself rather than the wrapper type.
#[inline]
pub fn downcast_mut<T: Any>(&mut self) -> Option<&mut T> {
self.as_any_mut().downcast_mut::<T>()
Expand Down

0 comments on commit d8f7d9b

Please sign in to comment.