summary refs log tree commit diff
path: root/tests/ui/transmutability/references
AgeCommit message (Collapse)AuthorLines
2023-11-24Show number in error message even for one errorNilstrieb-3/+3
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-06-29Enable co-induction support for Safe TransmuteBryan Garza-56/+4
This patch adds the `#[rustc_coinductive]` annotation to `BikeshedIntrinsicFrom`, so that it's possible to compute transmutability for recursive types.
2023-06-07Safe Transmute: Disable coinduction supportBryan Garza-4/+56
This patch just removes the `#[rustc_coinductive]` annotation from `BikeshedIntrinsicFrom` and flips the related tests to `check-fail`. Once an FCP for setting the annotation on the trait is approved, it could be enabled again.
2023-05-24Safe Transmute: Check mutability before creating dst -> src obligationBryan Garza-41/+39
- Only create dst -> src obligation if Dst is mutable - Add some long comments to explain parts of the transmutability code that were unclear to me when reading - Update/add tests
2023-05-24Safe Transmute: Enable handling references, including recursive typesBryan Garza-0/+250
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>