Skip to content

Handle<T>::as_weak() takes a type U which is potentially bad #3522

Closed
@colepoirier

Description

@colepoirier

On discord https://discord.com/channels/691052431525675048/749332104487108618/927078698035855420 while working on documenting bevy_assets @manokara noticed Handle::as_weak() takes a type U and wondered if "the handle would be invalid if U is different from T?"

@mockersf noted that "there's one place where that is used to convert a Handle to a Handle," and upon further investigation concluded that "the FontAtlasSet asset storage is handled manually, to have its handles in sync with fonts."

@mockersf said that this is "potentially bad and would require more thinking to improve," so I have created this issue to see what others think of the degree to which this is potentially bad and be a starting point for discussions of how to improve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AssetsLoad files from disk to use for things like images, models, and soundsC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

    Status

    Concrete and Controversial

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions