rust/tests
Matthias Krüger fbed195b4d
Rollup merge of #133226 - compiler-errors:opt-in-pointer-like, r=lcnr
Make `PointerLike` opt-in instead of built-in

The `PointerLike` trait currently is a built-in trait that computes the layout of the type. This is a bit problematic, because types implement this trait automatically. Since this can be broken due to semver-compatible changes to a type's layout, this is undesirable. Also, calling `layout_of` in the trait system also causes cycles.

This PR makes the trait implemented via regular impls, and adds additional validation on top to make sure that those impls are valid. This could eventually be `derive()`d for custom smart pointers, and we can trust *that* as a semver promise rather than risking library authors accidentally breaking it.

On the other hand, we may never expose `PointerLike`, but at least now the implementation doesn't invoke `layout_of` which could cause ICEs or cause cycles.

Right now for a `PointerLike` impl to be valid, it must be an ADT that is `repr(transparent)` and the non-1zst field needs to implement `PointerLike`. There are also some primitive impls for `&T`/ `&mut T`/`*const T`/`*mut T`/`Box<T>`.
2024-11-20 20:10:13 +01:00
..
assembly tests: use max-llvm-major-version instead of ignore-llvm-version range like N - 99 2024-11-14 17:44:54 +08:00
auxiliary Fix typo in tests/auxiliary/minicore.rs 2024-11-03 17:32:33 +09:00
codegen Likely unlikely fix 2024-11-17 21:49:10 +01:00
codegen-units
coverage coverage: Restrict empty-span expansion to only cover { and } 2024-11-08 20:43:08 +11:00
coverage-run-rustdoc coverage: Restrict empty-span expansion to only cover { and } 2024-11-08 20:43:08 +11:00
crashes Make PointerLike opt-in as a trait 2024-11-20 16:36:12 +00:00
debuginfo Mark numeric-types.rs as 64-bit only for now 2024-11-17 04:16:59 +08:00
incremental fixup some test directives 2024-11-17 22:15:54 +00:00
mir-opt Likely unlikely fix 2024-11-17 21:49:10 +01:00
pretty
run-make Auto merge of #132646 - jieyouxu:liberate-aarch64-gnu-debug, r=Kobzol 2024-11-17 20:51:52 +00:00
rustdoc Add regression test for jump to def links on items with generics 2024-11-18 18:11:50 +01:00
rustdoc-gui rustdoc-search: simplify rules for generics and type params 2024-10-30 12:27:48 -07:00
rustdoc-js rustdoc-search: add standalone trailing :: test 2024-11-17 08:07:16 -07:00
rustdoc-js-std rustdoc search: allow queries to end in an empty path segment 2024-11-15 16:32:40 -06:00
rustdoc-json Rename Receiver -> LegacyReceiver 2024-10-22 12:55:16 +00:00
rustdoc-ui Auto merge of #126597 - estebank:unicode-output, r=fmease 2024-11-11 00:00:58 +00:00
ui Rollup merge of #133226 - compiler-errors:opt-in-pointer-like, r=lcnr 2024-11-20 20:10:13 +01:00
ui-fulldeps Likely unlikely fix 2024-11-17 21:49:10 +01:00
COMPILER_TESTS.md