diff --git a/pyo3-macros-backend/src/module.rs b/pyo3-macros-backend/src/module.rs index 9def7b481d8..baec0f20c44 100644 --- a/pyo3-macros-backend/src/module.rs +++ b/pyo3-macros-backend/src/module.rs @@ -150,7 +150,7 @@ pub fn add_fn_to_module( syn::FnArg::Receiver(_) => { bail_spanned!(input.span() => "unexpected receiver for #[pyfn]"); } - syn::FnArg::Typed(ref mut cap) => { + syn::FnArg::Typed(cap) => { if pyfn_attrs.pass_module && i == 0 { if let syn::Type::Reference(tyref) = cap.ty.as_ref() { if let syn::Type::Path(typath) = tyref.elem.as_ref() {