rust/library
Matthias Krüger af3c51d849
Rollup merge of #136107 - dingxiangfei2009:coerce-pointee-wellformed, r=compiler-errors
Introduce CoercePointeeWellformed for coherence checks at typeck stage

Fix #135206

This is the first PR to introduce the "wellformedness" check for `derive(CoercePointee)`.

This patch introduces a new error code to cover all the prerequisites of the said macro. The checks that is enforced with this patch is whether the data is indeed `struct` and whether the layout is set to `repr(transparent)`.

A following series of patch will arrive later to address the following concern.
1. #135217 so that we would only admit one single coercion on one type parameter, and leave the rest for future consideration in tandem of development of other coercion rules.
1. Enforcement of data field requirements.

**An open question** is whether there is a good schema to encode the `#[pointee]` as well, so that we could also check if the `#[pointee]` type parameter is indeed `?Sized`.

``@rustbot`` label F-derive_coerce_pointee
2025-02-11 02:53:42 +01:00
..
alloc Rollup merge of #136714 - tgross35:update-builtins, r=tgross35 2025-02-10 16:38:26 +01:00
backtrace@f8cc6ac9ac Bump backtrace to 0.3.75 2025-01-03 20:16:52 -08:00
core Rollup merge of #136107 - dingxiangfei2009:coerce-pointee-wellformed, r=compiler-errors 2025-02-11 02:53:42 +01:00
coretests Rollup merge of #136705 - compiler-errors:edition-library, r=jhpratt 2025-02-10 00:51:54 -08:00
panic_abort Mark extern blocks as unsafe 2025-02-09 17:11:13 +00:00
panic_unwind Rollup merge of #136705 - compiler-errors:edition-library, r=jhpratt 2025-02-10 00:51:54 -08:00
portable-simd Merge commit '3383cfbd35' into sync-from-portable-simd-2025-01-18 2025-01-18 15:37:14 -05:00
proc_macro proc_macro: add #![warn(unreachable_pub)] 2025-01-20 18:46:29 +01:00
profiler_builtins compiler & tools dependencies: 2024-12-17 17:41:00 +00:00
rtstartup Mark extern blocks as unsafe 2025-02-09 17:11:13 +00:00
rustc-std-workspace-alloc Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
rustc-std-workspace-core update rustc-std-workspace crates 2024-11-04 07:45:15 +01:00
rustc-std-workspace-std
std Rollup merge of #136714 - tgross35:update-builtins, r=tgross35 2025-02-10 16:38:26 +01:00
stdarch@684de0d6fe Bump stdarch 2024-12-24 19:00:57 +01:00
sysroot Make profiler_builtins an optional dependency of sysroot, not std 2024-10-17 22:08:36 +11:00
test Rollup merge of #136705 - compiler-errors:edition-library, r=jhpratt 2025-02-10 00:51:54 -08:00
unwind Mark extern blocks as unsafe 2025-02-09 17:11:13 +00:00
windows_targets Mark extern blocks as unsafe 2025-02-09 17:11:13 +00:00
Cargo.lock Update compiler-builtins to 0.1.146 2025-02-07 20:58:28 +00:00
Cargo.toml Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00