Skip to content

Move the 'static bound of Any to the methods. #2280

Closed
@crlf0710

Description

@crlf0710

In principle the trait Any works just like a 'top type' trait. However there's the unnecessary bound of 'static involved by the restrictions of downcast method. So i propose that the 'static bound move to the methods, so Any can act as a real 'top type' trait.

Use case: When i want to erase the type of a value and just make sure it is alive until a certain point, currently there's no good way to do so. However, with the changes above, i can just put it into a Box<Any + 'a>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-libs-apiRelevant to the library API team, which will review and decide on the RFC.breaking-changeThe RFC proposes a breaking change.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions