Can `DynMetadata` be made constructable?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Related tracking issue: https://github.com/rust-lang/rust/issues/81513
As of right now, the only way to get a DynMetadata is to call ptr::metadata on an existing pointer, which can create a chicken-and-egg problem. It could be useful to be able to get the metadata for a hypothetical trait object Foo as Trait as well, without first having to construct such a trait object. However, I don't know if this would be possible, and whether it would lead to soundness issues or have other undesired consequences.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the related tracking issue #81513 and the discussion around DynMetadata and ptr::metadata. Investigate how metadata for a hypothetical trait object could be obtained without an existing pointer, including the stated soundness concerns. Done means establishing whether a constructable API is feasible and defining its intended behavior or documenting why it should not be added.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100