Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
Clippy
A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
-
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.
That is indeed an overall goal (there are many known examples of code that is UB under Stacked Borrows but should be allowed, and these examples guided the development of Tree Borrows), but Stacked Borrows also had some cases of accidentally accepted code, such as some tests in stdlib recently patched.
I'm not the author, but this describes an alternative to the current Stacked Borrows model, that has recently landed as an option to use in miri.
/u/nvanille Excellent work. Evaluating whether this all makes sense is very much above my pay-grade, but I'm all in favor of making it harder to shoot yourself in the foot with unsafe. This actually happened with the memchr crate, if you're interested in those details.
It looks like .get_disjoint_mut() from slotmap failed under stacked borrows, but seems to pass under tree borrows
TIL. I've just filed a Clippy lint suggestion to warn about &slice[0] as *const T, given that slice.as_ptr() sounds more idiomatic (regardless of whether SB or TB is the "better" memory model): https://github.com/rust-lang/rust-clippy/issues/10560