pyo3/tests/ui/invalid_pymethods_buffer.rs
2021-12-30 15:48:55 +00:00

19 lines
389 B
Rust

use pyo3::prelude::*;
#[pyclass]
struct MyClass {}
#[pymethods]
impl MyClass {
#[pyo3(name = "__getbuffer__")]
fn getbuffer_must_be_unsafe(&self, _view: *mut pyo3::ffi::Py_buffer, _flags: std::os::raw::c_int) {}
}
#[pymethods]
impl MyClass {
#[pyo3(name = "__releasebuffer__")]
fn releasebuffer_must_be_unsafe(&self, _view: *mut pyo3::ffi::Py_buffer) {}
}
fn main() {}