rust/library
bors e4417cf020 Auto merge of #92268 - jswrenn:transmute, r=oli-obk
Initial implementation of transmutability trait.

*T'was the night before Christmas and all through the codebase, not a miri was stirring — no hint of `unsafe`!*

This PR provides an initial, **incomplete** implementation of *[MCP 411: Lang Item for Transmutability](https://github.com/rust-lang/compiler-team/issues/411)*. The `core::mem::BikeshedIntrinsicFrom` trait provided by this PR is implemented on-the-fly by the compiler for types `Src` and `Dst` when the bits of all possible values of type `Src` are safely reinterpretable as a value of type `Dst`.

What this PR provides is:
- [x] [support for transmutations involving primitives](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/primitives)
- [x] [support for transmutations involving arrays](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/arrays)
- [x] [support for transmutations involving structs](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/structs)
- [x] [support for transmutations involving enums](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/enums)
- [x] [support for transmutations involving unions](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/unions)
- [x] [support for weaker validity checks](https://github.com/jswrenn/rust/blob/transmute/src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs) (i.e., `Assume::VALIDITY`)
- [x] visibility checking

What isn't yet implemented:
- [ ] transmutability options passed using the `Assume` struct
- [ ] [support for references](https://github.com/jswrenn/rust/blob/transmute/src/test/ui/transmutability/references.rs)
- [ ] smarter error messages

These features will be implemented in future PRs.
2022-08-02 21:17:31 +00:00
..
alloc Auto merge of #98553 - the8472:next_chunk_opt, r=Mark-Simulacrum 2022-07-27 01:12:30 +00:00
backtrace@4e5a3f7292
core Auto merge of #92268 - jswrenn:transmute, r=oli-obk 2022-08-02 21:17:31 +00:00
panic_abort Rollup merge of #95916 - solid-rs:feat-kmc-solid-abort, r=Mark-Simulacrum 2022-07-25 18:46:48 +09:00
panic_unwind Fix unwinding when debug assertions are enabled 2022-07-30 05:14:54 +02:00
portable-simd
proc_macro proc_macro: use crossbeam channels for the proc_macro cross-thread bridge 2022-07-29 17:38:12 -04:00
profiler_builtins
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Auto merge of #100048 - matthiaskrgr:rollup-agimvm6, r=matthiaskrgr 2022-08-02 06:09:22 +00:00
stdarch@28335054b1
test
unwind