Skip to content

Reducing boilerplates via template types and layout forwards #136

Description

@RaitoBezarius

In idiomatic Rust code, it's frequent to have a dozens of monomorphization of types which layouts are very much like max(T, E).

Template types allows to set methods once, but still requires manual declaration of instantiations.

What if we could:

  • declare #layout_conservative_like(T1, T2, …, TN) on a template type to define a generic layout
  • not have to manually declare instantiations anymore

Let zngur encounter an uninstantiated type for which a template type exist with a generic layout and instantiate on the fly.
This wouldn't solve all boilerplate cases but this would probably pave the way to reduce it.

WDYT?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions