# rust-lang-nursery/lazy-static.rs

A small macro for defining lazy evaluated static variables in Rust.

Repository: https://github.com/rust-lang-nursery/lazy-static.rs
Canonical: https://ross.abutalabs.com/products/lazy-staticrs
Language: Rust
License: Apache-2.0
License Family: permissive
Last push: 2025-01-29T15:31:06+00:00

## Health v2 (maintenance only)
Score: 25/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 4, release rhythm 8, longevity 100
- inputs: {"age_days": 4453, "days_push": 581, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2034, forks 125 (observed 2026-08-28T04:06:07.833628+00:00)

## What it is
A Rust macro crate for declaring lazily evaluated static variables that require runtime initialization, such as heap-allocated collections or non-const computations. It is largely superseded by std::sync::LazyLock in the Rust standard library.

## Use cases
- define lazily initialized static variables in rust
- create global hashmap or vector singletons in rust
- initialize statics with non-const function calls
- avoid unsafe static initialization in rust
- share lazily computed configuration across a rust program

## When to choose
- you need lazy statics on rustc versions older than 1.80 without LazyLock
- you prefer a macro-based API for declaring statics
- you maintain legacy code already using lazy_static

## When to avoid
- you target modern Rust where std::sync::LazyLock covers the same need without a dependency
- you need async lazy initialization
- you want actively developed features beyond lazy statics

## Facets
- artifact type: library
- maturity: maintenance
- function: concurrency, developer-tools
- domain: programming-languages, developer-tools
- platform: rust, cross-platform
- tags: lazy-evaluation, static-variables, macro, rust-crate, singletons

## Member repositories
- rust-lang-nursery/lazy-static.rs (main) score 25

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:07.833628+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:59:25.262794+00:00, confidence not recorded.
  - readme: https://github.com/rust-lang-nursery/lazy-static.rs (fetched 2026-08-28T04:06:07.833628+00:00, sha d7c6f9e52cf7)
- Data as of 2026-08-30T08:39:29.467469+00:00.
