google / zerocopy

https://discord.gg/MAvWH2R6zk
Apache License 2.0
1.13k stars 86 forks source link

Implement `NoCell`, `IntoBytes` and possibly other traits for `std::convert::Infallible` #1528

Open mseravalli opened 2 months ago

mseravalli commented 2 months ago

What is the name of your project? Fuchsia netstack3

Please provide a link to your project (GitHub repository, crates.io page, etc). https://cs.opensource.google/fuchsia/fuchsia/+/main:src/connectivity/

What features would you like from zerocopy? It might be useful to implement NoCell, IntoBytes and possibly other traits for std::convert::Infallible so that it can be used e.g. in associated types. This would improve how specific invariants are enforced and would allow use Infallible instead of () or a custom defined type with the same behavior of Infallible.

joshlf commented 2 months ago

Thanks for this, @mseravalli!

Just a heads up that, thanks to #1292, we won't be able to vendor new versions of zerocopy (including any that would include an implementation of this issue) into Fuchsia until https://github.com/rust-lang/rust/issues/45713 is fixed, published in a new Rust toolchain version, and that version is vendored into Fuchsia. I discovered the issue when trying to vendor (see my WIP CL stack here), and so far the only problem I've found is in packet-formats. Since you guys own that library, you could potentially work around it by changing the visibility of some types if you care about getting this in on a particular timeline; feel free to reach out internally if you would like guidance on how to do that.