Safe Transmute: Revise safety analysis by jswrenn · Pull Request #121681 · rust-lang/rust (original) (raw)
This PR migrates BikeshedIntrinsicFrom
to a simplified safety analysis (described here) that does not rely on analyzing the visibility of types and fields.
The revised analysis treats primitive types as safe, and user-defined types as potentially carrying safety invariants. If Rust gains explicit (un)safe fields, this PR is structured so that it will be fairly easy to thread support for those annotations into the analysis.
Notably, this PR removes the Context
type parameter from BikeshedIntrinsicFrom
. Most of the files changed by this PR are just UI tests tweaked to accommodate the removed parameter.