The safety invariant of `SystemParam::validate_param` is not documented.
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
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.)
Contributor guide
Research direction
Start at the Rust SystemParam::validate_param entry point and review its existing documentation alongside UnsafeWorldCell usage. Document the conditions under which accessing the UnsafeWorldCell is safe, distinguishing those invariants from the conditions that make calling validate_param unsafe; done means the safety requirements are explicit in the API documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100