File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " static-reflect"
3- version = " 0.1.5 "
3+ version = " 0.1.6 "
44edition = " 2018"
55description = " Static type information, giving a form of compile-time reflection"
66license = " MIT"
Original file line number Diff line number Diff line change 11//! Implementations of [StaticReflect] for core types (for `#![no_std]`)
22use crate :: StaticReflect ;
3- use crate :: types:: { TypeInfo } ;
3+ use crate :: types:: { TypeInfo , SimpleNonZeroPointer } ;
44use std:: mem:: { self , ManuallyDrop } ;
55use core:: ptr:: NonNull ;
66
@@ -64,12 +64,6 @@ unsafe impl <T> StaticReflect for *const T {
6464 const TYPE_INFO : TypeInfo < ' static > = TypeInfo :: Pointer ;
6565}
6666
67- /// A non-zero pointer type, where optional types
68- /// are guaranteed to use the nullable representation
69- ///
70- /// If `T: SimpleNonZeroPointer` -> `sizeof(Option<T>) == sizeof(T) && repr(Option<T>) == repr(T)`
71- pub unsafe trait SimpleNonZeroPointer : StaticReflect { }
72-
7367unsafe impl < T > SimpleNonZeroPointer for NonNull < T > { }
7468unsafe impl < T > StaticReflect for NonNull < T > {
7569 const TYPE_INFO : TypeInfo < ' static > = TypeInfo :: Pointer ;
Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ use zerogc_derive::{unsafe_gc_impl};
1313#[ cfg( feature = "builtins" ) ]
1414use crate :: builtins:: { AsmSlice , AsmStr } ;
1515
16+ /// A non-zero pointer type, where optional types
17+ /// are guaranteed to use the nullable representation
18+ ///
19+ /// If `T: SimpleNonZeroPointer` -> `sizeof(Option<T>) == sizeof(T) && repr(Option<T>) == repr(T)`
20+ pub unsafe trait SimpleNonZeroPointer : StaticReflect { }
21+
1622/// An integer size, named in the style of C/Java
1723///
1824/// Although named after their C equivalents,
You can’t perform that action at this time.
0 commit comments