Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Sadly there's no way to tell miri to consider &mut T valid only if T is valid (that choice is not settled yet, AFAIK, at the language design level), in order to demonstrate the difference (https://github.com/rust-lang/miri/issues/1638).
I opened an issue about it.
This is where I was going to link to a custom derive that someone has written to generate that kind of transform manually (with the necessary check for safe field access wrt alignment). To my shock, I can't find one. Did I see one and did it have a funny name? (the one thing I did find was a macro crate but unlike a derive those have a harder time checking everything so I had to report https://github.com/youngspe/project-uninit/issues/1)
Don't believe, read the RFC for nonzero integers https://github.com/rust-lang/rfcs/blob/master/text/2307-concrete-nonzero-types.md
Related posts
- I do not understand why Sized bound prevents a trait from being used as a trait object.
- Hey Rustaceans! Got an easy question? Ask here (8/2022)!
- Are default trait method implementations as reusable as inheritance?
- Is there any comprehensive documentation about lifetimes?
- Announcing fs-tracing: std::fs replacement with nice error messages!