Closed
Description
Location
https://doc.rust-lang.org/stable/std/collections/struct.HashMap.html#usage-in-const-and-static
Summary
In the documentation for HashMap, the section on using it in a static
/const
context mentions that a const seed should be used. However, using a LazyLock<>
to wrap the HashMap
allows it to be constructed with a random seed, which resolves the main problem highlighted at the end of the paragraph.
LazyLock
has been stabilized as of rust 1.80