File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -62,12 +62,20 @@ pub mod global {
6262
6363/// A trait for all kinds of contexts that lets you define the exact flags and a function to
6464/// 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`.
6569pub unsafe trait Context : private:: Sealed {
6670 /// Flags for the ffi.
6771 const FLAGS : c_uint ;
6872 /// A constant description of the context.
6973 const DESCRIPTION : & ' static str ;
7074 /// 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`].
7179 unsafe fn deallocate ( ptr : * mut u8 , size : usize ) ;
7280}
7381
Original file line number Diff line number Diff line change 152152// Coding conventions
153153#![ deny( non_upper_case_globals, non_camel_case_types, non_snake_case) ]
154154#![ warn( missing_docs, missing_copy_implementations, missing_debug_implementations) ]
155- #![ allow( clippy:: missing_safety_doc) ]
156155#![ cfg_attr( all( not( test) , not( feature = "std" ) ) , no_std) ]
157156// Experimental features we need.
158157#![ cfg_attr( docsrs, feature( doc_cfg) ) ]
You can’t perform that action at this time.
0 commit comments