Skip to content

Const + Static  #17

Open
Open

Description

@Lucretiel

It would be nice if we could add const or static global items to codegen scopes. To ensure correctness, these could only be allowed for a small set of primitives, like ints and floats and &str, as well as arrays / slices / references of those. I have a password generator which uses build.rs to compile a list of words directly into the source; codegen would be a great addition to this functionality.

Activity

  1. brandonryan commented on Oct 31, 2023

    @brandonryan

    Should not be limited to simple types. See https://doc.rust-lang.org/std/sync/struct.LazyLock.html for an example of a complex type being used in static.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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