Missing safety comment: which variants are upheld?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.3k
- Forks
- 1.8k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 14
Description
Per Rust API Guidelines, unsafe functions should be documented with invariants:
https://rust-lang.github.io/api-guidelines/documentation.html
During review of the source, it was pointed out there is no safety comment here that describes what invariants are upheld:
https://github.com/hyperium/hyper/blob/90eb95f62a32981cb662b0f750027231d8a2586b/src/proto/h2/server.rs#L478
Also UpgradedSendStream::new does not state which invariants need to be upheld.
Would it be possible to add this?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/proto/h2/server.rs around line 478 and inspect UpgradedSendStream::new. Read the Rust API Guidelines documentation link first, then determine which invariants the safety comment should describe and which invariants the constructor requires. Done means both locations clearly document those invariants.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- networking
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100