Skip to content

Commit 406a295

Browse files
committed
Merge pull request #12 from niax/master
Update for rust nightly (2015-01-06)
2 parents 6588029 + 4f25859 commit 406a295

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ git = "https://github.com/Kimundi/lazy-static.rs"
5454
Using the macro:
5555

5656
```rust
57-
#![feature(phase)]
58-
59-
#[phase(plugin)]
57+
#[macro_use]
6058
extern crate lazy_static;
6159

6260
use std::collections::HashMap;

src/lazy_static.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ trait.
3333
Using the macro:
3434
3535
```rust
36-
#![feature(phase)]
37-
38-
#[phase(plugin)]
36+
#[macro_use]
3937
extern crate lazy_static;
4038
4139
use std::collections::HashMap;
@@ -72,8 +70,6 @@ define uninitialized `static mut` values.
7270

7371
#![crate_type = "dylib"]
7472

75-
#![feature(macro_rules)]
76-
7773
#[macro_export]
7874
macro_rules! lazy_static {
7975
(static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => {
@@ -96,7 +92,7 @@ macro_rules! lazy_static {
9692
unsafe {
9793
static mut __static: *const $T = 0 as *const $T;
9894
static mut __ONCE: Once = ONCE_INIT;
99-
__ONCE.doit(|| {
95+
__ONCE.call_once(|| {
10096
__static = transmute::<Box<$T>, *const $T>(box() ($e));
10197
});
10298
let static_ref = &*__static;

tests/test.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#![feature(phase)]
2-
3-
#[phase(plugin)]
1+
#[macro_use]
42
extern crate lazy_static;
53
use std::collections::HashMap;
64

@@ -15,6 +13,7 @@ lazy_static! {
1513
m.insert(2, "ghi");
1614
m
1715
};
16+
// This *should* triggger warn(dead_code) by design.
1817
static ref UNUSED: () = ();
1918
}
2019

0 commit comments

Comments
 (0)