Skip to content

Commit

Permalink
add safety note to downcast_into_unchecked
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Dec 21, 2023
1 parent 3092289 commit 4ac6a6b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/types/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1617,6 +1617,10 @@ pub trait PyAnyMethods<'py> {
unsafe fn downcast_unchecked<T>(&self) -> &Bound<'py, T>;

/// Like `downcast_unchecked` but takes ownership of `self`.
///
/// # Safety
///
/// Callers must ensure that the type is valid or risk type confusion.
unsafe fn downcast_into_unchecked<T>(self) -> Bound<'py, T>;

/// Extracts some type from the Python object.
Expand Down

0 comments on commit 4ac6a6b

Please sign in to comment.