File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -62,12 +62,20 @@ pub mod global {
62
62
63
63
/// A trait for all kinds of contexts that lets you define the exact flags and a function to
64
64
/// deallocate memory. It isn't possible to implement this for types outside this crate.
65
+ ///
66
+ /// # Safety
67
+ ///
68
+ /// This trait is marked unsafe to allow unsafe implementations of `deallocate`.
65
69
pub unsafe trait Context : private:: Sealed {
66
70
/// Flags for the ffi.
67
71
const FLAGS : c_uint ;
68
72
/// A constant description of the context.
69
73
const DESCRIPTION : & ' static str ;
70
74
/// A function to deallocate the memory when the context is dropped.
75
+ ///
76
+ /// # Safety
77
+ ///
78
+ /// `ptr` must be valid. Further safety constraints may be imposed by [`std::alloc::dealloc`].
71
79
unsafe fn deallocate ( ptr : * mut u8 , size : usize ) ;
72
80
}
73
81
Original file line number Diff line number Diff line change 152
152
// Coding conventions
153
153
#![ deny( non_upper_case_globals, non_camel_case_types, non_snake_case) ]
154
154
#![ warn( missing_docs, missing_copy_implementations, missing_debug_implementations) ]
155
- #![ allow( clippy:: missing_safety_doc) ]
156
155
#![ cfg_attr( all( not( test) , not( feature = "std" ) ) , no_std) ]
157
156
// Experimental features we need.
158
157
#![ cfg_attr( docsrs, feature( doc_cfg) ) ]
You can’t perform that action at this time.
0 commit comments