Skip to content

Commit ecabd81

Browse files
authored
Merge pull request #91 from rust-lang-nursery/release_v1.0
1.0 release
2 parents 5acf245 + ad4ad8e commit ecabd81

File tree

6 files changed

+19
-6
lines changed

6 files changed

+19
-6
lines changed

Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "lazy_static"
33
# NB: When modifying, also modify html_root_url in lib.rs
4-
version = "0.2.11"
4+
version = "1.0.0"
55
authors = ["Marvin Löbel <[email protected]>"]
66
license = "MIT/Apache-2.0"
77

@@ -30,7 +30,7 @@ compiletest = ["compiletest_rs"]
3030
appveyor = { repository = "rust-lang-nursery/lazy-static.rs" }
3131
travis-ci = { repository = "rust-lang-nursery/lazy-static.rs" }
3232

33-
# is-it-maintained-issue-resolution = { repository = "rust-lang-nursery/lazy-static.rs" }
34-
# is-it-maintained-open-issues = { repository = "rust-lang-nursery/lazy-static.rs" }
33+
is-it-maintained-issue-resolution = { repository = "rust-lang-nursery/lazy-static.rs" }
34+
is-it-maintained-open-issues = { repository = "rust-lang-nursery/lazy-static.rs" }
3535

3636
maintenance = { status = "passively-maintained" }

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Add the following dependency to your Cargo manifest...
2121

2222
```toml
2323
[dependencies]
24-
lazy_static = "0.2"
24+
lazy_static = "1.0"
2525
```
2626

2727
...and see the [docs](https://docs.rs/lazy_static) for how to use it.

src/core_lazy.rs

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ impl<T: Sync> Lazy<T> {
2626
}
2727

2828
#[macro_export]
29+
#[doc(hidden)]
2930
macro_rules! __lazy_static_create {
3031
($NAME:ident, $T:ty) => {
3132
static $NAME: $crate::lazy::Lazy<$T> = $crate::lazy::Lazy::new();

src/lazy.rs

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ impl<T: Sync> Lazy<T> {
3232
unsafe impl<T: Sync> Sync for Lazy<T> {}
3333

3434
#[macro_export]
35+
#[doc(hidden)]
3536
macro_rules! __lazy_static_create {
3637
($NAME:ident, $T:ty) => {
3738
static mut $NAME: $crate::lazy::Lazy<$T> = $crate::lazy::Lazy(0 as *const $T, $crate::lazy::ONCE_INIT);

src/lib.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,24 @@ fn main() {
8686
8787
# Implementation details
8888
89-
The `Deref` implementation uses a hidden static variable that is guarded by a atomic check on each access. On stable Rust, the macro may need to allocate each static on the heap.
89+
The `Deref` implementation uses a hidden static variable that is guarded by a atomic check on each access.
90+
91+
# Cargo features
92+
93+
This crate provides two cargo features:
94+
95+
- `nightly`: This uses unstable language features only available on the nightly release channel for a more optimal implementation. In practice this currently means avoiding a heap allocation per static. This feature might get deprecated at a later point once all relevant optimizations are usable from stable.
96+
- `spin_no_std` (implies `nightly`): This allows using this crate in a no-std environment, by depending on the standalone `spin` crate.
97+
98+
Both features depend on unstable language features, which means
99+
no guarantees can be made about them in regard to SemVer stability.
90100
91101
*/
92102

93103
#![cfg_attr(feature="spin_no_std", feature(const_fn))]
94104
#![cfg_attr(feature="nightly", feature(unreachable))]
95105

96-
#![doc(html_root_url = "https://docs.rs/lazy_static/0.2.11")]
106+
#![doc(html_root_url = "https://docs.rs/lazy_static/1.0.0")]
97107
#![no_std]
98108

99109
#[cfg(not(feature="nightly"))]

src/nightly_lazy.rs

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ impl<T: Sync> Lazy<T> {
3636
unsafe impl<T: Sync> Sync for Lazy<T> {}
3737

3838
#[macro_export]
39+
#[doc(hidden)]
3940
macro_rules! __lazy_static_create {
4041
($NAME:ident, $T:ty) => {
4142
static mut $NAME: $crate::lazy::Lazy<$T> = $crate::lazy::Lazy(None, $crate::lazy::ONCE_INIT);

0 commit comments

Comments
 (0)