File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " atomic_ref"
3
- version = " 0.1.0 "
3
+ version = " 0.1.1 "
4
4
authors = [" Michael Layzell <michael@thelayzells.com>" ]
5
5
6
6
description = " Atomic &'a T types with support for static allocation"
7
7
repository = " https://github.com/mystor/atomic_ref"
8
+ documentation = " https://docs.rs/atomic_ref/"
8
9
readme = " README.md"
9
10
license = " MIT"
10
11
keywords = [" atomic" , " reference" , " static" ]
Original file line number Diff line number Diff line change @@ -137,7 +137,8 @@ macro_rules! static_atomic_ref {
137
137
type Target = $crate:: AtomicRef <' static , $T>;
138
138
#[ allow( unsafe_code) ]
139
139
fn deref<' a>( & ' a self ) -> & ' a $crate:: AtomicRef <' static , $T> {
140
- unsafe { :: std:: mem:: transmute( & self . _ref) }
140
+ static STORAGE : $crate:: AtomicRef <' static , u8 > = $crate:: ATOMIC_U8_REF_INIT ;
141
+ unsafe { :: std:: mem:: transmute( & STORAGE ) }
141
142
}
142
143
}
143
144
static_atomic_ref!( $( $t) * ) ;
@@ -147,18 +148,18 @@ macro_rules! static_atomic_ref {
147
148
#[ allow( non_camel_case_types) ]
148
149
#[ allow( dead_code) ]
149
150
$( #[ $attr] ) *
150
- pub struct $N { _ref : $crate :: AtomicRef < ' static , u8 > }
151
+ pub struct $N { _private : ( ) }
151
152
#[ doc( hidden) ]
152
- pub static $N: $N = $N { _ref : $crate :: ATOMIC_U8_REF_INIT } ;
153
+ pub static $N: $N = $N { _private : ( ) } ;
153
154
} ;
154
155
( @MAKE TY , PRIV , $( #[ $attr: meta] ) * , $N: ident) => {
155
156
#[ allow( missing_copy_implementations) ]
156
157
#[ allow( non_camel_case_types) ]
157
158
#[ allow( dead_code) ]
158
159
$( #[ $attr] ) *
159
- struct $N { _ref : $crate :: AtomicRef < ' static , u8 > }
160
+ struct $N { _private : ( ) }
160
161
#[ doc( hidden) ]
161
- static $N: $N = $N { _ref : $crate :: ATOMIC_U8_REF_INIT } ;
162
+ static $N: $N = $N { _private : ( ) } ;
162
163
} ;
163
164
( ) => ( ) ;
164
165
}
You can’t perform that action at this time.
0 commit comments