-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DispatchFromDyn builtin checks are weaker than CoerceUnsized #135215
Comments
I think actually @Darksonn noticed this issue. It's definitely an issue for dispatch-from-dyn as a feature. Is this the right place to track that, or is this specific to the issue only as far as it is relevant for |
This comment has been minimized.
This comment has been minimized.
Is this really a concern for |
I think it makes sense to track the question of “how much should this be fixed before |
tbc this issue is supposed to track the bug itself more so than the actual concern for the stabilization PR. I just didn't bother to write out a proper issue description because i was in a hurry :3 |
…atch, r=BoxyUwU Improve `DispatchFromDyn` and `CoerceUnsized` impl validation * Disallow arbitrary 1-ZST fields in `DispatchFromDyn` -- only `PhantomData`, and 1-ZSTs that mention no params (which is needed to support, e.g., the `Global` alloctor in `Box<T, U = Global>`). * Don't allow coercing between non-ZSTs to ZSTs (since the previous check wasn't actually checking the field tys were the same before checking the layout...) * Normalize the field before checking it's `PhantomData`. Fixes rust-lang#135215 Fixes rust-lang#135214 Fixes rust-lang#135220 r? `@BoxyUwU` or reassign
…atch, r=BoxyUwU Improve `DispatchFromDyn` and `CoerceUnsized` impl validation * Disallow arbitrary 1-ZST fields in `DispatchFromDyn` -- only `PhantomData`, and 1-ZSTs that mention no params (which is needed to support, e.g., the `Global` alloctor in `Box<T, U = Global>`). * Don't allow coercing between non-ZSTs to ZSTs (since the previous check wasn't actually checking the field tys were the same before checking the layout...) * Normalize the field before checking it's `PhantomData`. Fixes rust-lang#135215 Fixes rust-lang#135214 Fixes rust-lang#135220 r? ``@BoxyUwU`` or reassign
Rollup merge of rust-lang#135228 - compiler-errors:normalizes-ur-dispatch, r=BoxyUwU Improve `DispatchFromDyn` and `CoerceUnsized` impl validation * Disallow arbitrary 1-ZST fields in `DispatchFromDyn` -- only `PhantomData`, and 1-ZSTs that mention no params (which is needed to support, e.g., the `Global` alloctor in `Box<T, U = Global>`). * Don't allow coercing between non-ZSTs to ZSTs (since the previous check wasn't actually checking the field tys were the same before checking the layout...) * Normalize the field before checking it's `PhantomData`. Fixes rust-lang#135215 Fixes rust-lang#135214 Fixes rust-lang#135220 r? ```@BoxyUwU``` or reassign
Originally posted by @BoxyUwU in #133820 (comment)
The text was updated successfully, but these errors were encountered: