#[pymethods]
generated code triggers unsafe_op_in_unsafe_fn
lint
#4663
Labels
#[pymethods]
generated code triggers unsafe_op_in_unsafe_fn
lint
#4663
Bug Description
Functions in
impl
blocks annotated withpymethods
trigger theunsafe_op_in_unsafe_fn
lint. In a crate with#![deny(unsafe_op_in_unsafe_fn)]
set, I get the following error:This points to a call to
ref_from_ptr
, which we can see in the expanded code:Steps to Reproduce
Quick method:
cargo build
Alternatively:
lib.rs
with the following code:cargo build
Backtrace
No response
Your operating system and version
macOS Sonoma
Your Python version (
python --version
)Python 3.10.14
Your Rust version (
rustc --version
)rustc 1.80.0 (051478957 2024-07-21)
Your PyO3 version
0.22.0
How did you install python? Did you use a virtualenv?
pyenv, using a virtual env as in the steps laid out here https://github.com/PyO3/pyo3?tab=readme-ov-file#using-rust-from-python
Additional Info
No response
The text was updated successfully, but these errors were encountered: