about summary refs log tree commit diff
path: root/tests/ui/transmutability/enums/repr
AgeCommit message (Collapse)AuthorLines
2025-05-28Stabilise `repr128`beetrees-2/+1
2024-12-12Filter empty lines, comments and delimiters from previous to last multiline ↵Esteban Küber-20/+0
span rendering
2024-08-27safe transmute: Rename `BikeshedIntrinsicFrom` to `TransmuteFrom`Jack Wrenn-27/+27
As our implementation of MCP411 nears completion and we begin to solicit testing, it's no longer reasonable to expect testers to type or remember `BikeshedIntrinsicFrom`. The name degrades the ease-of-reading of documentation, and the overall experience of using compiler safe transmute. Tentatively, we'll instead adopt `TransmuteFrom`. This name seems to be the one most likely to be stabilized, after discussion on Zulip [1]. We may want to revisit the ordering of `Src` and `Dst` before stabilization, at which point we'd likely consider `TransmuteInto` or `Transmute`. [1] https://rust-lang.zulipchat.com/#narrow/stream/216762-project-safe-transmute/topic/What.20should.20.60BikeshedIntrinsicFrom.60.20be.20named.3F
2024-04-08Compute transmutability from `rustc_target::abi::Layout`Jack Wrenn-149/+87
In its first step of computing transmutability, `rustc_transmutability` constructs a byte-level representation of type layout (`Tree`). Previously, this representation was computed for ADTs by inspecting the ADT definition and performing our own layout computations. This process was error-prone, verbose, and limited our ability to analyze many types (particularly default-repr types). In this PR, we instead construct `Tree`s from `rustc_target::abi::Layout`s. This helps ensure that layout optimizations are reflected our analyses, and increases the kinds of types we can now analyze, including: - default repr ADTs - transparent unions - `UnsafeCell`-containing types Overall, this PR expands the expressvity of `rustc_transmutability` to be much closer to the transmutability analysis performed by miri. Future PRs will work to close the remaining gaps (e.g., support for `Box`, raw pointers, `NonZero*`, coroutines, etc.).
2024-03-15Safe Transmute: lowercase diagnosticsJack Wrenn-20/+20
2024-03-15Safe Transmute: Use 'not yet supported', not 'unspecified' in errorsJack Wrenn-6/+6
We can (and will) support analyzing the transmutability of types whose layouts aren't completely specified by its repr. This change ensures that the error messages remain sensible after this support lands.
2024-02-27safe transmute: revise safety analysisJack Wrenn-168/+157
Migrate to a simplified safety analysis that does not use visibility. Closes https://github.com/rust-lang/project-safe-transmute/issues/15
2023-05-24Safe Transmute: Fix propagation of errorsBryan Garza-21/+21
- Make sure that the most specific Reason is the one that bubbles up when we are folding over the `Answer` tree. `Reason::DstIsBitIncompatible` is the least specific, so that should be used only when there isn't anything else available. - Small fixes where we used the wrong Reason variant. - Tiny cleanups
2023-05-24Safe Transmute: Enable handling references, including recursive typesBryan Garza-13/+13
This patch enables support for references in Safe Transmute, by generating nested obligations during trait selection. Specifically, when we call `confirm_transmutability_candidate(...)`, we now recursively traverse the `rustc_transmute::Answer` tree and create obligations for all the `Answer` variants, some of which include multiple nested `Answer`s. Also, to handle recursive types, enable support for coinduction for the Safe Transmute trait (`BikeshedIntrinsicFrom`) by adding the `#[rustc_coinduction]` annotation. Also fix some small logic issues when reducing the `or` and `and` combinations in `rustc_transmute`, so that we don't end up with additional redundant `Answer`s in the tree. Co-authored-by: Jack Wrenn <jack@wrenn.fyi>
2023-04-13Improve safe transmute error reportingBryan Garza-78/+52
This patch updates the error reporting when Safe Transmute is not possible between 2 types by including the reason. Also, fix some small bugs that occur when computing the `Answer` for transmutability.
2023-02-21Specify what 'this' actually isMichael Goulet-26/+26
2023-01-11Move /src/test to /testsAlbert Larsan-0/+884