rustls / rustls-ffi

Use Rustls from any language
Other
124 stars 31 forks source link

Review documented lifetime requirements for `&mut` vs `*mut` rules #309

Open jsha opened 1 year ago

jsha commented 1 year ago

(Copied from https://github.com/rustls/rustls-ffi/pull/291#issuecomment-1481711750)

We arrange for (non-Rust) callers of our function to uphold the safety guarantees by asking them to uphold a few properties:

https://doc.rust-lang.org/nomicon/aliasing.html

I believe it's okay for a *mut pointer to coexist with an &mut reference. It's just that an &mut reference can't coexist with an &mut reference. So it's possible our documented lifetime requirements are already fine.