-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
dyn* does not support trait upcasting #104800
Copy link
Copy link
Closed
Labels
F-dyn_star`#![feature(dyn_star)]``#![feature(dyn_star)]`T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
F-dyn_star`#![feature(dyn_star)]``#![feature(dyn_star)]`T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Currently trait upcasting is done via the
Unsize/CoerceUnsizedtraits -- however, sinceCoerceUnsizedworks structurally, implementingdyn*upcasting via the same codepaths allows this erroneous code to make it to codegen and ICE:https://github.com/rust-lang/rust/blob/d8cb8c37adfbfb641a1b30d3a2de3ba7226bb744/src/test/ui/dyn-star/no-unsize-coerce-dyn-trait.rs#L1-L13
That's why although
dyn*trait upcasting was implemented in #101832, I removed it in #104594 due to introduced ICEs.dyn*upcasting first, sincedyn*is not currently intended to be user-facing syntax. Due to this, the feature is not currently needed even if it is interesting and possible theoretically.dyn*upcasting, then it needs to be implemented separately fromdyn Traitupcasting with a much narrower scope.