oncelock 0.1.0-alpha.0

A fast and simple implementation of OnceLock
Documentation
[package]
name = "oncelock"
description = "A fast and simple implementation of OnceLock"
version = "0.1.0-alpha.0"
license = "MIT OR Apache-2.0"
authors = ["Techcable <git@techcable.net>"]
repository = "https://github.com/Techcable/oncelock.rs"
readme = "README.md"
# 1.26 - impl Trait
# 1.31 - Rust 2018, rename dependencies
# 1.32 - const Once::new, const UnsafeCell::new
# 1.32 - OnceCell::new becomes const
# 1.52 - Once::call_once_force (needed to ignore poisoning)
# 1.56 - Rust 2021
rust-version = "1.31"
edition = "2018"
categories = ["concurrency", "rust-patterns", "memory-management", "no-std", "no-std::no-alloc"]
keywords = ["lazy", "static", "oncecell", "oncelock"]

[build-dependencies]
rustversion = "1"

[dependencies]
rustversion = "1"

# synchronization
parking_lot_0_12 = { package = "parking_lot", version = "0.12", optional = true }
spin_0_10 = { package = "spin", version = "0.10", optional = true, features = ["once"] }
spin_0_9 = { package = "spin", version = "0.9", optional = true, features = ["once"] }

[features]
default = ["std"]
std = ["alloc", "std-sync"]
alloc = []

#
# Lock implementations in order of preference
# If no lock implementation
#

# Use parking_lot v0.12 for synchronization
parking_lot_v0_12 = ["parking_lot_0_12"]
# Use stdlib for synchronization (implied by `std` feature)
std-sync = []
# Use spin v0.10 for synchronization
spin_v0_10 = ["spin_0_10"]
# Use spin v0.9 for synchronization
spin_v0_9 = ["spin_0_9"]

[workspace.lints.rust]
unsafe-op-in-unsafe-fn = "deny"

[lints.clippy]
## groups ##
pedantic = { level = "warn", priority = -1 }
cargo = { level = "warn", priority = -1 }

## aggressively lint casts ##
# in an ideal world. overflowing casts would panic
# linting them (with deny) is the second best option
cast-possible-truncation = "deny"
cast-possible-wrap = "deny"
cast-precision-loss = "deny"
cast-sign-loss = "deny"
char-lit-as-u8 = "deny"
cast-ptr-alignment = "deny"
fn-to-numeric-cast = "deny"
fn-to-numeric-cast-any = "deny"
fn-to-numeric-cast-with-truncation = "deny"
cast-lossless = "allow" # lossless casts are fine, lints will catch if types change
ptr-as-ptr = "allow" # pointer casts are fine as long as they don't violate another rule

## restrictions ##
alloc-instead-of-core = "deny"
std-instead-of-alloc = "deny"
std-instead-of-core = "deny"

## safety
undocumented-unsafe-blocks = "deny" # all unsafe blocks should be documented
missing-safety-doc = "deny"

## overly pedantic (even for clippy::pedantic) ##
items-after-statements = "allow"
missing-panics-doc = "allow"
must-use-candidate = "allow"
assertions-on-constants = "allow"