Closed
Description
DispatchFromDyn
doesn't require the type parameter to only be used in one field and potentially phantomdata, instead it requires one field and arbitarily many ZSTs playground. This in theory means that dispatch from dyn impls can result in effectively arbitrary transmutes fromMyZST<dyn Trait>
toMyZST<Foo>
.In practice I don't think this is exploitable, regardless I don't think we should stabilize the ability for semi-user-written impls or trait bounds to be written involving this trait until the builtin checks are brought in line with
CoerceUnsized
.edit: thanks to @steffahn for pointing this out
@rfcbot concern
DispatchFromDyn
builtin checks are weaker thanCoerceUnsized
Originally posted by @BoxyUwU in #133820 (comment)