File tree 3 files changed +8
-8
lines changed
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " static-reflect"
3
- version = " 0.1.5 "
3
+ version = " 0.1.6 "
4
4
edition = " 2018"
5
5
description = " Static type information, giving a form of compile-time reflection"
6
6
license = " MIT"
Original file line number Diff line number Diff line change 1
1
//! Implementations of [StaticReflect] for core types (for `#![no_std]`)
2
2
use crate :: StaticReflect ;
3
- use crate :: types:: { TypeInfo } ;
3
+ use crate :: types:: { TypeInfo , SimpleNonZeroPointer } ;
4
4
use std:: mem:: { self , ManuallyDrop } ;
5
5
use core:: ptr:: NonNull ;
6
6
@@ -64,12 +64,6 @@ unsafe impl <T> StaticReflect for *const T {
64
64
const TYPE_INFO : TypeInfo < ' static > = TypeInfo :: Pointer ;
65
65
}
66
66
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
-
73
67
unsafe impl < T > SimpleNonZeroPointer for NonNull < T > { }
74
68
unsafe impl < T > StaticReflect for NonNull < T > {
75
69
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};
13
13
#[ cfg( feature = "builtins" ) ]
14
14
use crate :: builtins:: { AsmSlice , AsmStr } ;
15
15
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
+
16
22
/// An integer size, named in the style of C/Java
17
23
///
18
24
/// Although named after their C equivalents,
You can’t perform that action at this time.
0 commit comments