File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,17 @@ mod private {
2424/// A marker trait for primitive types which can be zero.
2525///
2626/// 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.
2731#[ unstable(
2832 feature = "nonzero_internals" ,
2933 reason = "implementation detail which may disappear or be replaced at any time" ,
3034 issue = "none"
3135) ]
3236#[ const_trait]
33- pub trait ZeroablePrimitive : Sized + Copy + private:: Sealed { }
37+ pub unsafe trait ZeroablePrimitive : Sized + Copy + private:: Sealed { }
3438
3539macro_rules! impl_zeroable_primitive {
3640 ( $primitive: ty) => {
@@ -46,7 +50,7 @@ macro_rules! impl_zeroable_primitive {
4650 reason = "implementation detail which may disappear or be replaced at any time" ,
4751 issue = "none"
4852 ) ]
49- impl const ZeroablePrimitive for $primitive { }
53+ unsafe impl const ZeroablePrimitive for $primitive { }
5054 } ;
5155}
5256
You can’t perform that action at this time.
0 commit comments