Skip to content

Conversation

@kngwyu
Copy link
Member

@kngwyu kngwyu commented Nov 5, 2021

Resolves #207

/// Represents that a type can be an element of `PyArray`.
pub trait Element: Clone + Send {
///
/// A type `T` that implements this trait should be safe when managed in numpy array,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adding the header

/// # Safety

before this section would be good so that Clippy's missing_safety_doc is appeased.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could you please take a glance at the revised version?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@kngwyu kngwyu merged commit 975b5ee into main Nov 6, 2021
@adamreichold adamreichold deleted the element-is-unsafe branch January 6, 2022 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Naively implementing Element on arbitrary object causes segfault.

3 participants