Skip to content

Commit 0a696b2

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 dd194b6 commit 0a696b2

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
@@ -302,6 +302,12 @@ unsafe impl<'buf> Context for AllPreallocated<'buf> {
302302

303303
/// Trait marking that a particular context object internally points to
304304
/// memory that must outlive `'a`
305+
///
306+
/// # Safety
307+
///
308+
/// This trait is used internally to gate which context markers can safely
309+
/// be used with the `preallocated_gen_new` function. Do not implement it
310+
/// on your own structures.
305311
pub unsafe trait PreallocatedContext<'a> {}
306312

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

0 commit comments

Comments
 (0)