Skip to content

Add links to troubles caused by unbounded lifetimes and types inside struct definitions #196

@JOE1994

Description

@JOE1994

The nomicon page for PhantomData (src/phantom-data.md) contains the paragraph as follows:

However because 'a is unused within the struct's body, it's unbounded. Because of the troubles this has historically caused, unbounded lifetimes and types are forbidden in struct definitions. Therefore we must somehow refer to these types in the body. Correctly doing this is necessary to have correct variance and drop checking.

I think it would be nice to add in a few links to troubles(GitHub issues or forum discussions) that were caused by unbounded lifetimes and types inside struct definitions.

If anyone is aware of relevant GitHub issues, adding them to the document would be helpful for new Rust learners.

As a Rust learner-in-progress myself, I'm not yet aware of the history of troubles that unbounded lifetimes and types caused in Rust, but maybe I could also try to find some relevant links to be added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions