File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,17 @@ mod private {
24
24
/// A marker trait for primitive types which can be zero.
25
25
///
26
26
/// This is an implementation detail for <code>[NonZero]\<T></code> which may disappear or be replaced at any time.
27
+ ///
28
+ /// # Safety
29
+ ///
30
+ /// Types implementing this trait must be primitves that are valid when zeroed.
27
31
#[ unstable(
28
32
feature = "nonzero_internals" ,
29
33
reason = "implementation detail which may disappear or be replaced at any time" ,
30
34
issue = "none"
31
35
) ]
32
36
#[ const_trait]
33
- pub trait ZeroablePrimitive : Sized + Copy + private:: Sealed { }
37
+ pub unsafe trait ZeroablePrimitive : Sized + Copy + private:: Sealed { }
34
38
35
39
macro_rules! impl_zeroable_primitive {
36
40
( $primitive: ty) => {
@@ -46,7 +50,7 @@ macro_rules! impl_zeroable_primitive {
46
50
reason = "implementation detail which may disappear or be replaced at any time" ,
47
51
issue = "none"
48
52
) ]
49
- impl const ZeroablePrimitive for $primitive { }
53
+ unsafe impl const ZeroablePrimitive for $primitive { }
50
54
} ;
51
55
}
52
56
You can’t perform that action at this time.
0 commit comments