Skip to content

The safety invariant of SystemParam::validate_param is not documented. #16651

Open
@spectria-limina

Description

Bevy version

0.15

What you did

I want to write my own SystemParam that can valid validation and therefore delay system running until validation passes.

What went wrong

validate_param takes an UnsafeWorldCell as a parameter, so I can't access the world unless my access is proven safe.

Expected behaviour: The documentation clearly states the conditions required for access to the UnsafeWorldCell to be safe.

Actual behaviour: There is no documentation on what would make that access safe. (There is only documentation on what makes calling validate_param unsafe, which is different. The safety invariants of validate_param are the caller's responsibility.)

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorC-DocsAn addition or correction to our documentationD-UnsafeTouches with unsafe code in some wayP-UnsoundA bug that results in undefined compiler behaviorS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions