rust/tests
Matthias Krüger 53afa97eb7
Rollup merge of #136083 - bend-n:⃤⃤, r=lcnr
Suggest {to,from}_ne_bytes for transmutations between arrays and integers, etc

implements #136067

Rust has helper methods for many kinds of safe transmutes, for example integer<->bytes. This is a lint against using transmute for these cases.

```rs
fn bytes_at_home(x: [u8; 4]) -> u32 {
   transmute(x)
}

// other examples
transmute::<[u8; 2], u16>();
transmute::<[u8; 8], f64>();
transmute::<u32, [u8; 4]>();
transmute::<char, u32>();
transmute::<u32, char>();
```
It would be handy to suggest `u32::from_ne_bytes(x)`.
This is implemented for `[u8; _]` -> `{float int}`

This also implements the cases:
`fXX` <-> `uXX` = `{from_bits, to_bits}`
`uXX` -> `iXX` via `cast_unsigned` and `cast_signed`
{`char` -> `u32`, `bool` -> `n8`} via `from`
`u32` -> `char` via `from_u32_unchecked` (note: notes `from_u32().unwrap()`) (contested)
`u8` -> `bool` via `==` (debatable)

---
try-job: aarch64-gnu
try-job: test-various
2025-04-24 17:19:42 +02:00
..
assembly Rollup merge of #140194 - jieyouxu:minicore-force-unwind-tables, r=bjorn3 2025-04-24 11:40:42 +02:00
auxiliary stabilize naked_functions 2025-04-20 11:18:38 +02:00
codegen Rollup merge of #139261 - RalfJung:msvc-align-mitigation, r=oli-obk 2025-04-24 11:40:35 +02:00
codegen-units
coverage Update the minimum external LLVM to 19 2025-04-05 11:44:38 -07:00
coverage-run-rustdoc Update coverage-run-rustdoc output 2025-03-28 10:35:53 +01:00
crashes Rollup merge of #140021 - compiler-errors:no-deep-norm-ice, r=lcnr 2025-04-21 15:55:58 +00:00
debuginfo Rollup merge of #138599 - adwinwhite:recursive-overflow, r=wesleywiser 2025-04-18 05:17:53 +02:00
incremental UI tests: migrate remaining compile time error-patterns to line annotations 2025-04-13 21:48:53 +03:00
mir-opt Auto merge of #132833 - est31:stabilize_let_chains, r=fee1-dead 2025-04-22 07:54:10 +00:00
pretty move autodiff pretty test to a autodiff sub module 2025-04-22 09:53:08 +05:30
run-make Auto merge of #139309 - RalfJung:abi_unsupported_vector_types, r=fee1-dead,traviscross 2025-04-24 00:44:40 +00:00
rustdoc Rollup merge of #139913 - fmease:rustdoc-fix-fn-param-handling, r=GuillaumeGomez 2025-04-18 05:16:31 +02:00
rustdoc-gui Add regression test for #139282 2025-04-07 17:28:46 +02:00
rustdoc-js rustdoc-search: add unbox flag to Result aliases 2025-04-11 11:36:40 -07:00
rustdoc-js-std rustdoc-search: add unbox flag to Result aliases 2025-04-11 11:36:40 -07:00
rustdoc-json Rollup merge of #140076 - aDotInTheVoid:jsondocline, r=GuillaumeGomez 2025-04-21 18:53:19 +00:00
rustdoc-ui Add regression test for #140026 2025-04-19 21:10:40 +02:00
ui Rollup merge of #136083 - bend-n:⃤⃤, r=lcnr 2025-04-24 17:19:42 +02:00
ui-fulldeps Refactor StableMir to avoid some clones. 2025-04-24 11:12:34 +10:00
COMPILER_TESTS.md