about summary refs log tree commit diff
path: root/tests/ui/transmute
AgeCommit message (Collapse)AuthorLines
2025-07-13cleaned up some testsKivooeo-5/+11
Additionally, remove unused `tests/ui/auxiliary/svh-*` crates that are duplicates of `tests/ui/svh/auxiliary/svh-*`.
2025-07-13moved testsKivooeo-0/+21
2025-06-28cleaned up some testsKivooeo-0/+25
2025-05-25Make UNNECESSARY_TRANSMUTES into a HIR lintMichael Goulet-56/+170
2025-05-22use uX::from instead of _ as uX in non - const contextsbendn-43/+114
2025-05-15dont handle bool transmutebendn-12/+6
2025-05-08add signed integers to unnecessary_lints to ensure feature parity with clippybendn-14/+58
2025-04-25remove expect() in unnecessary_transmutesbendn-0/+20
2025-04-24Suggest {to,from}_ne_bytes for transmutations between arrays and integers, etcbendn-0/+405
2024-12-27Remove the `-test` suffix from normalize directivesZalathar-3/+3
2024-07-11Always use a colon in `//@ normalize-*:` headersZalathar-3/+3
2024-05-30transmute size check: properly account for alignmentRalf Jung-1/+49
2024-04-25Add testMichael Goulet-0/+20
2024-03-20compiler: allow transmute of ZST arrays with genericsDavid Rheinsberg-0/+34
Extend the `SizeSkeleton` evaluator to shortcut zero-sized arrays, thus considering `[T; 0]` to have a compile-time fixed-size of 0. The existing evaluator already deals with generic arrays under the feature-guard `transmute_const_generics`. However, it merely allows comparing fixed-size types with fixed-size types, and generic types with generic types. For generic types, it merely compares whether their arguments match (ordering them first). Even if their exact sizes are not known at compile time, it can ensure that they will eventually be the same. This patch extends this by shortcutting the size-evaluation of zero sized arrays and thus allowing size comparisons of `()` with `[T; 0]`, where one contains generics and the other does not. This code is guarded by `transmute_const_generics` (#109929), even though it is unclear whether it should be. However, this assumes that a separate stabilization PR is required to move this out of the feature guard. Initially reported in #98104.
2024-02-27safe transmute: revise safety analysisJack Wrenn-112/+0
Migrate to a simplified safety analysis that does not use visibility. Closes https://github.com/rust-lang/project-safe-transmute/issues/15
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-6/+6
2023-11-24Show number in error message even for one errorNilstrieb-3/+3
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-09-06Fix error report for size overflow from transmuteyukang-0/+60
2023-07-21Revert "Auto merge of #113166 - moulins:ref-niches-initial, r=oli-obk"David Tolnay-12/+0
This reverts commit 557359f92512ca88b62a602ebda291f17a953002, reversing changes made to 1e6c09a803fd543a98bfbe1624d697a55300a786.
2023-07-21Track (partial) niche information in `NaiveLayout`Moulins-0/+12
Still more complexity, but this allows computing exact `NaiveLayout`s for null-optimized enums, and thus allows calls like `transmute::<Option<&T>, &U>()` to work in generic contexts.
2023-04-13Improve safe transmute error reportingBryan Garza-3/+2
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-1/+1
2023-01-11Move /src/test to /testsAlbert Larsan-0/+576