Skip to content

Remove dedicated methods for upcasting from bevy_reflect #21634

@alice-i-cecile

Description

@alice-i-cecile

As seen in https://dev-docs.bevy.org/bevy/reflect/index.html#converting-between-partialreflect-and-reflect:

Since T: Reflect implies T: PartialReflect, conversion from a dyn Reflect to a dyn PartialReflect trait object (upcasting) is infallible and can be performed with one of the following methods. Note that these are temporary while the language feature for dyn upcasting coercion is experimental:

PartialReflect::as_partial_reflect for &dyn PartialReflect
PartialReflect::as_partial_reflect_mut for &mut dyn PartialReflect
PartialReflect::into_partial_reflect for Box

However, rust-lang/rust#65991 is closed! This was added in Rust 1.86.

We should remove these methods, and update the docs to explain the simpler language-supported mechanism for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ReflectionRuntime information about typesC-Code-QualityA section of code that is hard to understand or changeC-DocsAn addition or correction to our documentationD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!X-UncontroversialThis work is generally agreed upon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions