You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today they are implemented so that the data pointer is returned and metadata discarded. However, this behavior does not appear to be documented anywhere authoritative.
In the rfc to ptr_metadata (Tracking issue: rust-lang/rust#81513) the following text was proposed, but as of today hasn't made it into the unstable Pointee trait:
Pointer metadata can be extracted from a pointer or reference with the metadata function. The data pointer can be extracted by casting a (fat) pointer to a (thin) pointer to a Sized type with the as operator, for example (x: &dyn SomeTrait) as *const SomeTrait as *const () or (x: *const dyn SomeTrait).cast::<()>().
Should this be documented in the reference or is the semantics contentious?
The text was updated successfully, but these errors were encountered:
Related #66, rust-lang/rust#81513
The following casts are considered "true casts" per the reference:
*const [T] as *const U
*const dyn T as *const U
Today they are implemented so that the data pointer is returned and metadata discarded. However, this behavior does not appear to be documented anywhere authoritative.
In the rfc to
ptr_metadata
(Tracking issue: rust-lang/rust#81513) the following text was proposed, but as of today hasn't made it into the unstable Pointee trait:Should this be documented in the reference or is the semantics contentious?
The text was updated successfully, but these errors were encountered: