rust/compiler/rustc_span/src
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
..
analyze_source_file
lev_distance Improve method name suggestions 2022-04-03 16:38:57 +01:00
source_map Add tests for FilePathMapping::to_embeddable_absolute_path(). 2022-05-18 11:42:43 +02:00
symbol Move the Lock into symbol::Interner 2021-09-15 18:46:45 +02:00
analyze_source_file.rs
caching_source_map_view.rs Convert debug_assert to assert in CachingSourceMapView 2021-09-17 12:01:29 -05:00
def_id.rs Use delayed error handling for Encodable and Encoder infallible. 2022-06-08 07:01:26 +10:00
edition.rs Create 2024 edition 2022-04-02 02:45:49 -04:00
fatal_error.rs Make fatal DiagnosticBuilder yield never 2022-03-27 22:25:32 -07:00
hygiene.rs Auto merge of #99231 - Dylan-DPC:rollup-0tl8c0o, r=Dylan-DPC 2022-07-14 11:00:30 +00:00
lev_distance.rs Improve method name suggestions 2022-04-03 16:38:57 +01:00
lib.rs Auto merge of #99231 - Dylan-DPC:rollup-0tl8c0o, r=Dylan-DPC 2022-07-14 11:00:30 +00:00
profiling.rs extend EventArgRecorder into span-aware SpannedEventArgRecorder 2022-04-22 18:06:21 +02:00
source_map.rs Use line numbers relative to function in mir opt tests 2022-07-28 11:59:54 +02:00
span_encoding.rs Enable rustc_pass_by_value for Span 2022-02-25 08:00:53 -05:00
symbol.rs Auto merge of #92268 - jswrenn:transmute, r=oli-obk 2022-08-02 21:17:31 +00:00
tests.rs Lazify SourceFile::lines. 2022-06-01 10:36:39 +10:00