hyperium / hyperium/hyper

Missing safety comment: which variants are upheld?

Open
#3,554 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-http2 C-chore
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.