Skip to content

Commit 989bf05

Browse files
committed
Add saftey docs for PreallocatedContext trait
Add `# Safety` section to the rustdocs of the `PrealocatedContext` trait. This change was back ported manually (instead of directly cherry-picking the patch) so as to add a blank newline after the heading as is customary. Original: `commit 1e6eb6c`
1 parent 2b9a5b6 commit 989bf05

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/context.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,12 @@ unsafe impl<'buf> Context for AllPreallocated<'buf> {
299299

300300
/// Trait marking that a particular context object internally points to
301301
/// memory that must outlive `'a`
302+
///
303+
/// # Safety
304+
///
305+
/// This trait is used internally to gate which context markers can safely
306+
/// be used with the `preallocated_gen_new` function. Do not implement it
307+
/// on your own structures.
302308
pub unsafe trait PreallocatedContext<'a> {}
303309

304310
unsafe impl<'buf> PreallocatedContext<'buf> for AllPreallocated<'buf> {}

0 commit comments

Comments
 (0)