Skip to content

Commit 4c5c397

Browse files
committed
apply non-upper-case-globals to generated statics
1 parent bbe8907 commit 4c5c397

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ macro_rules! __lazy_static_internal {
156156
$(#[$attr])*
157157
$($vis)* struct $N {__private_field: ()}
158158
#[doc(hidden)]
159+
#[allow(non_upper_case_globals)]
159160
$($vis)* static $N: $N = $N {__private_field: ()};
160161
};
161162
() => ()

tests/test.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![deny(warnings)]
2+
13
#[macro_use]
24
extern crate lazy_static;
35
use std::collections::HashMap;
@@ -35,6 +37,11 @@ lazy_static! {
3537
static ref S3: String = [*S1, *S2].join("");
3638
}
3739

40+
lazy_static! {
41+
#[allow(non_upper_case_globals)]
42+
pub static ref string: String = "hello".to_string();
43+
}
44+
3845
#[test]
3946
fn s3() {
4047
assert_eq!(&*S3, "ab");

0 commit comments

Comments
 (0)