Skip to content

Commit 10499f4

Browse files
committed
Prevent certian situations where internally created items can cause
pattern matching conflicts with user code by making them use names unlikely to be used by user code. Create new release of the package with this change
1 parent 43739b0 commit 10499f4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "lazy_static"
4-
version = "0.1.2"
4+
version = "0.1.3"
55
authors = [ "Marvin Löbel <loebel.marvin@gmail.com>" ]
66

77
# A short blurb about the package. This is not rendered in any format when

src/lazy_static.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ macro_rules! lazy_static {
9393
fn require_sync<T: Sync>(_: &T) { }
9494

9595
unsafe {
96-
static mut s: *const $T = 0 as *const $T;
97-
static mut ONCE: Once = ONCE_INIT;
98-
ONCE.doit(|| {
99-
s = transmute::<Box<$T>, *const $T>(box() ($e));
96+
static mut __static: *const $T = 0 as *const $T;
97+
static mut __ONCE: Once = ONCE_INIT;
98+
__ONCE.doit(|| {
99+
__static = transmute::<Box<$T>, *const $T>(box() ($e));
100100
});
101-
let static_ref = &*s;
101+
let static_ref = &*__static;
102102
require_sync(static_ref);
103103
static_ref
104104
}

0 commit comments

Comments
 (0)