File tree Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -54,9 +54,7 @@ git = "https://github.com/Kimundi/lazy-static.rs"
54
54
Using the macro:
55
55
56
56
``` rust
57
- #![feature(phase)]
58
-
59
- #[phase(plugin)]
57
+ #[macro_use]
60
58
extern crate lazy_static;
61
59
62
60
use std :: collections :: HashMap ;
Original file line number Diff line number Diff line change 33
33
Using the macro:
34
34
35
35
```rust
36
- #![feature(phase)]
37
-
38
- #[phase(plugin)]
36
+ #[macro_use]
39
37
extern crate lazy_static;
40
38
41
39
use std::collections::HashMap;
@@ -72,8 +70,6 @@ define uninitialized `static mut` values.
72
70
73
71
#![ crate_type = "dylib" ]
74
72
75
- #![ feature( macro_rules) ]
76
-
77
73
#[ macro_export]
78
74
macro_rules! lazy_static {
79
75
( static ref $N: ident : $T: ty = $e: expr; $( $t: tt) * ) => {
@@ -96,7 +92,7 @@ macro_rules! lazy_static {
96
92
unsafe {
97
93
static mut __static: * const $T = 0 as * const $T;
98
94
static mut __ONCE: Once = ONCE_INIT ;
99
- __ONCE. doit ( || {
95
+ __ONCE. call_once ( || {
100
96
__static = transmute:: <Box <$T>, * const $T>( box( ) ( $e) ) ;
101
97
} ) ;
102
98
let static_ref = & * __static;
Original file line number Diff line number Diff line change 1
- #![ feature( phase) ]
2
-
3
- #[ phase( plugin) ]
1
+ #[ macro_use]
4
2
extern crate lazy_static;
5
3
use std:: collections:: HashMap ;
6
4
@@ -15,6 +13,7 @@ lazy_static! {
15
13
m. insert( 2 , "ghi" ) ;
16
14
m
17
15
} ;
16
+ // This *should* triggger warn(dead_code) by design.
18
17
static ref UNUSED : ( ) = ( ) ;
19
18
}
20
19
You can’t perform that action at this time.
0 commit comments