-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
The safety invariant of SystemParam::validate_param is not documented. #16651
Copy link
Copy link
Open
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorC-DocsAn addition or correction to our documentationAn addition or correction to our documentationD-UnsafeTouches with unsafe code in some wayTouches with unsafe code in some wayI-UnsoundA bug that results in undefined compiler behaviorA bug that results in undefined compiler behaviorS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
Description
Activity
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorC-DocsAn addition or correction to our documentationAn addition or correction to our documentationD-UnsafeTouches with unsafe code in some wayTouches with unsafe code in some wayI-UnsoundA bug that results in undefined compiler behaviorA bug that results in undefined compiler behaviorS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
Bevy version
0.15
What you did
I want to write my own
SystemParamthat can valid validation and therefore delay system running until validation passes.What went wrong
validate_paramtakes anUnsafeWorldCellas 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
UnsafeWorldCellto be safe.Actual behaviour: There is no documentation on what would make that access safe. (There is only documentation on what makes calling
validate_paramunsafe, which is different. The safety invariants ofvalidate_paramare the caller's responsibility.)