rust/compiler/rustc_hir_analysis/src
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
..
check Rustfmt 2025-02-08 22:12:13 +00:00
coherence Rollup merge of #136107 - dingxiangfei2009:coerce-pointee-wellformed, r=compiler-errors 2025-02-11 02:53:42 +01:00
collect Rustfmt 2025-02-08 22:12:13 +00:00
errors Use a different hir type for patterns in pattern types than we use in match patterns 2025-02-03 08:18:30 +00:00
hir_ty_lowering Rustfmt 2025-02-08 22:12:13 +00:00
impl_wf_check Fix a comment typo. 2025-01-31 08:28:14 +11:00
outlives Remove an unnecessary loop label. 2025-01-31 08:28:28 +11:00
variance Remove xform submodule. 2025-01-31 08:28:28 +11:00
autoderef.rs Rename structurally_normalize to structurally_normalize_ty 2025-01-22 07:04:53 +00:00
bounds.rs Merge HostPolarity and BoundConstness 2024-10-30 16:23:16 +00:00
check_unused.rs Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
collect.rs Rename tcx.ensure() to tcx.ensure_ok() 2025-02-01 12:38:54 +11:00
constrained_generic_params.rs Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
delegation.rs Rustfmt 2025-02-08 22:12:13 +00:00
errors.rs move repr(transparent) checks to coherence 2025-02-09 20:40:43 +08:00
hir_wf_check.rs visit_x_unambig 2025-01-23 06:01:36 +00:00
impl_wf_check.rs Rename tcx.ensure() to tcx.ensure_ok() 2025-02-01 12:38:54 +11:00
lib.rs Use an explicit type when discarding the result of tcx.ensure_ok() 2025-02-01 12:42:41 +11:00