bevyengine / bevyengine/bevy

The safety invariant of `SystemParam::validate_param` is not documented.

Open Beginner friendly
#16,651 2 comments 0 reactions 0 assignees View on GitHub
A-ECS C-Bug C-Docs D-Unsafe I-Unsound S-Ready-For-Implementation
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.