-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
CoercePointee leaks unstable unsizing impls #135217
Labels
A-coercions
Area: implicit and explicit `expr as Type` coercions
F-derive_coerce_pointee
Feature: RFC 3621's oft-renamed implementation
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
Comments
I'll take a stab at this. |
90 tasks
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 10, 2025
…llformed, r=compiler-errors Introduce CoercePointeeWellformed for coherence checks at typeck stage Fix rust-lang#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. rust-lang#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
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 10, 2025
…llformed, r=compiler-errors Introduce CoercePointeeWellformed for coherence checks at typeck stage Fix rust-lang#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. rust-lang#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
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 11, 2025
…llformed, r=compiler-errors Introduce CoercePointeeWellformed for coherence checks at typeck stage Fix rust-lang#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. rust-lang#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
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Feb 11, 2025
Rollup merge of rust-lang#136107 - dingxiangfei2009:coerce-pointee-wellformed, r=compiler-errors Introduce CoercePointeeWellformed for coherence checks at typeck stage Fix rust-lang#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. rust-lang#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
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Feb 27, 2025
Remove unsizing coercions for tuples See rust-lang#42877 (comment) and below comments for justification. Tracking issue: rust-lang#42877 Fixes: rust-lang#135217
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
A-coercions
Area: implicit and explicit `expr as Type` coercions
F-derive_coerce_pointee
Feature: RFC 3621's oft-renamed implementation
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
Originally posted by @lcnr in #133820 (comment)
The text was updated successfully, but these errors were encountered: