Skip to content

Use PhantomData<fn() -> (T0, T1, ...)> everywhere #2115

@addisoncrump

Description

@addisoncrump

This was a trick I saw here: astral-sh/ruff#10849 (comment)

This has a lot of nice qualities for derive that can help us with #2068:

  • Eq
  • Copy
  • Debug
  • Serialize/Deserialize (with #[serde(skip)])
  • Send/Sync (in case we ever do any async)

If a lifetime is stored in the PhantomData, then use PhantomData<fn() -> &'a &'b ... (T0, T1, ...)>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions