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"
5454Using the macro:
5555
5656``` rust
57- #![feature(phase)]
58-
59- #[phase(plugin)]
57+ #[macro_use]
6058extern crate lazy_static;
6159
6260use std :: collections :: HashMap ;
Original file line number Diff line number Diff line change 3333Using the macro:
3434
3535```rust
36- #![feature(phase)]
37-
38- #[phase(plugin)]
36+ #[macro_use]
3937extern crate lazy_static;
4038
4139use 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]
7874macro_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;
Original file line number Diff line number Diff line change 1- #![ feature( phase) ]
2-
3- #[ phase( plugin) ]
1+ #[ macro_use]
42extern crate lazy_static;
53use 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
You can’t perform that action at this time.
0 commit comments