Open burakemir opened 7 months ago
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?
@nox any thoughts? Looking at fn new(), all it does is transmute to the uninhabitable type. Perhaps the unsafety can be contained inside the constructor? Is there any time calling it would be wrong?
fn new()
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?