Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - bevy_reflect: ReflectFromPtr to create &dyn Reflect from a *const () #4475

Closed
Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix doctest
  • Loading branch information
jakobhellermann committed Apr 18, 2022
commit 07b60d647ef5a70972438b909b06e32f25b58531
2 changes: 1 addition & 1 deletion crates/bevy_reflect/src/type_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ impl<T: for<'a> Deserialize<'a> + Reflect> FromType<T> for ReflectDeserialize {
/// let value = Reflected("Hello world!".to_string());
/// let value: *const () = &value as *const _ as *const ();
///
/// let reflect_from_ptr = type_registry.get(std::any::TypeId::of::<Reflected>())?.data::<ReflectFromPtr>()?;
/// let reflect_from_ptr = type_registry.get(std::any::TypeId::of::<Reflected>()).unwrap().data::<ReflectFromPtr>().unwrap();
jakobhellermann marked this conversation as resolved.
Show resolved Hide resolved
/// // SAFE: `value` is a pointer to an valid value of `Reflected`
/// let value = unsafe { reflect_from_ptr.as_reflect_ptr(value) };
///
Expand Down