Skip to content

Commit

Permalink
Merge pull request #91 from rust-lang-nursery/release_v1.0
Browse files Browse the repository at this point in the history
1.0 release
  • Loading branch information
Kimundi committed Nov 29, 2017
2 parents 5acf245 + ad4ad8e commit ecabd81
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "lazy_static"
# NB: When modifying, also modify html_root_url in lib.rs
version = "0.2.11"
version = "1.0.0"
authors = ["Marvin Löbel <loebel.marvin@gmail.com>"]
license = "MIT/Apache-2.0"

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

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

maintenance = { status = "passively-maintained" }
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -21,7 +21,7 @@ Add the following dependency to your Cargo manifest...

```toml
[dependencies]
lazy_static = "0.2"
lazy_static = "1.0"
```

...and see the [docs](https://docs.rs/lazy_static) for how to use it.
Expand Down
1 change: 1 addition & 0 deletions src/core_lazy.rs
Expand Up @@ -26,6 +26,7 @@ impl<T: Sync> Lazy<T> {
}

#[macro_export]
#[doc(hidden)]
macro_rules! __lazy_static_create {
($NAME:ident, $T:ty) => {
static $NAME: $crate::lazy::Lazy<$T> = $crate::lazy::Lazy::new();
Expand Down
1 change: 1 addition & 0 deletions src/lazy.rs
Expand Up @@ -32,6 +32,7 @@ impl<T: Sync> Lazy<T> {
unsafe impl<T: Sync> Sync for Lazy<T> {}

#[macro_export]
#[doc(hidden)]
macro_rules! __lazy_static_create {
($NAME:ident, $T:ty) => {
static mut $NAME: $crate::lazy::Lazy<$T> = $crate::lazy::Lazy(0 as *const $T, $crate::lazy::ONCE_INIT);
Expand Down
14 changes: 12 additions & 2 deletions src/lib.rs
Expand Up @@ -86,14 +86,24 @@ fn main() {
# Implementation details
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.
The `Deref` implementation uses a hidden static variable that is guarded by a atomic check on each access.
# Cargo features
This crate provides two cargo features:
- `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.
- `spin_no_std` (implies `nightly`): This allows using this crate in a no-std environment, by depending on the standalone `spin` crate.
Both features depend on unstable language features, which means
no guarantees can be made about them in regard to SemVer stability.
*/

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

#![doc(html_root_url = "https://docs.rs/lazy_static/0.2.11")]
#![doc(html_root_url = "https://docs.rs/lazy_static/1.0.0")]
#![no_std]

#[cfg(not(feature="nightly"))]
Expand Down
1 change: 1 addition & 0 deletions src/nightly_lazy.rs
Expand Up @@ -36,6 +36,7 @@ impl<T: Sync> Lazy<T> {
unsafe impl<T: Sync> Sync for Lazy<T> {}

#[macro_export]
#[doc(hidden)]
macro_rules! __lazy_static_create {
($NAME:ident, $T:ty) => {
static mut $NAME: $crate::lazy::Lazy<$T> = $crate::lazy::Lazy(None, $crate::lazy::ONCE_INIT);
Expand Down

0 comments on commit ecabd81

Please sign in to comment.