Skip to content

Commit 61a2858

Browse files
committed
Disabled warning about a missing Copy implementantion from the generated
types. Seeing how the type just exists for the generated static, making it copyable does not seem to have any benefits.
1 parent 31a7aa0 commit 61a2858

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/lazy_static.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,14 @@ macro_rules! lazy_static {
104104
lazy_static!($($t)*);
105105
};
106106
(MAKE TY PUB $N:ident) => {
107+
#[allow(missing_copy_implementations)]
107108
#[allow(non_camel_case_types)]
108109
#[allow(dead_code)]
109110
pub struct $N {__private_field: ()}
110111
pub static $N: $N = $N {__private_field: ()};
111112
};
112113
(MAKE TY PRIV $N:ident) => {
114+
#[allow(missing_copy_implementations)]
113115
#[allow(non_camel_case_types)]
114116
#[allow(dead_code)]
115117
struct $N {__private_field: ()}

tests/test.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,8 @@ mod visibility {
4949
fn test_visibility() {
5050
assert_eq!(*visibility::FOO, Box::new(0));
5151
}
52+
53+
// This should not cause a warning about a missing Copy implementation
54+
lazy_static! {
55+
pub static ref VAR: i32 = { 0 };
56+
}

0 commit comments

Comments
 (0)