Skip to content

Commit e13d37b

Browse files
committed
Fixed compile fail tests
1 parent 4677292 commit e13d37b

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

crates/bevy_reflect/compile_fail/tests/reflect_derive/generics_fail.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ fn main() {
1414
let mut foo: Box<dyn Struct> = Box::new(Foo::<NoReflect> { a: NoReflect(42.0) });
1515
//~^ ERROR: `NoReflect` does not implement `GetTypeRegistration` so cannot provide type registration information
1616
//~| ERROR: `NoReflect` does not implement `Typed` so cannot provide static type information
17+
//~| ERROR: `NoReflect` does not implement `CastPartialReflect` so cannot be cast to `dyn PartialReflect`
1718

1819
// foo doesn't implement Reflect because NoReflect doesn't implement Reflect
1920
foo.get_field::<NoReflect>("a").unwrap();

crates/bevy_reflect/compile_fail/tests/reflect_remote/nested_fail.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,12 @@ mod missing_attribute {
1919
}
2020

2121
mod incorrect_inner_type {
22-
use bevy_reflect::{FromReflect, GetTypeRegistration, reflect_remote};
22+
use bevy_reflect::{FromReflect, GetTypeRegistration, Reflect, reflect_remote};
2323

2424
#[reflect_remote(super::external_crate::TheirOuter<T>)]
25-
//~^ ERROR: `TheirInner<T>` does not implement `PartialReflect` so cannot be introspected
26-
//~| ERROR: `TheirInner<T>` does not implement `PartialReflect` so cannot be introspected
27-
//~| ERROR: `TheirInner<T>` does not implement `PartialReflect` so cannot be introspected
28-
//~| ERROR: `TheirInner<T>` does not implement `TypePath` so cannot provide dynamic type path information
25+
//~^ ERROR: `TheirInner<T>` does not implement `CastPartialReflect` so cannot be cast to `dyn PartialReflect`
2926
//~| ERROR: `?` operator has incompatible types
30-
struct MyOuter<T: FromReflect + GetTypeRegistration> {
27+
struct MyOuter<T: FromReflect + Reflect + GetTypeRegistration> {
3128
// Reason: Should not use `MyInner<T>` directly
3229
pub inner: MyInner<T>,
3330
//~^ ERROR: mismatched types

crates/bevy_reflect/compile_fail/tests/reflect_remote/nested_pass.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mod external_crate {
99
}
1010

1111
#[reflect_remote(external_crate::TheirOuter<T>)]
12-
struct MyOuter<T: FromReflect + Typed + GetTypeRegistration> {
12+
struct MyOuter<T: FromReflect + Reflect + Typed + GetTypeRegistration> {
1313
#[reflect(remote = MyInner<T>)]
1414
pub inner: external_crate::TheirInner<T>,
1515
}

0 commit comments

Comments
 (0)