diff --git a/pyo3-ffi/src/moduleobject.rs b/pyo3-ffi/src/moduleobject.rs index b9026997d2e..64b3a37d038 100644 --- a/pyo3-ffi/src/moduleobject.rs +++ b/pyo3-ffi/src/moduleobject.rs @@ -59,6 +59,7 @@ pub struct PyModuleDef_Base { pub m_copy: *mut PyObject, } +#[allow(clippy::declare_interior_mutable_const)] pub const PyModuleDef_HEAD_INIT: PyModuleDef_Base = PyModuleDef_Base { ob_base: PyObject_HEAD_INIT, m_init: None, diff --git a/pyo3-ffi/src/object.rs b/pyo3-ffi/src/object.rs index 48aa1f31861..3f71c5f324f 100644 --- a/pyo3-ffi/src/object.rs +++ b/pyo3-ffi/src/object.rs @@ -31,6 +31,7 @@ pub const _Py_IMMORTAL_REFCNT_LOCAL: u32 = u32::MAX; #[cfg(Py_GIL_DISABLED)] pub const _Py_REF_SHARED_SHIFT: isize = 2; +#[allow(clippy::declare_interior_mutable_const)] pub const PyObject_HEAD_INIT: PyObject = PyObject { #[cfg(py_sys_config = "Py_TRACE_REFS")] _ob_next: std::ptr::null_mut(), diff --git a/src/impl_/pymodule.rs b/src/impl_/pymodule.rs index 08d55bfa5e8..9cca48f5594 100644 --- a/src/impl_/pymodule.rs +++ b/src/impl_/pymodule.rs @@ -54,6 +54,7 @@ impl ModuleDef { doc: &'static CStr, initializer: ModuleInitializer, ) -> Self { + #[allow(clippy::declare_interior_mutable_const)] const INIT: ffi::PyModuleDef = ffi::PyModuleDef { m_base: ffi::PyModuleDef_HEAD_INIT, m_name: std::ptr::null(),