@@ -118,7 +118,7 @@ pub type PyArray6<T> = PyArray<T, Ix6>;
118118pub type PyArrayDyn < T > = PyArray < T , IxDyn > ;
119119
120120/// Returns a handle to NumPy's multiarray module.
121- pub fn get_array_module ( py : Python < ' _ > ) -> PyResult < & PyModule > {
121+ pub fn get_array_module < ' py > ( py : Python < ' py > ) -> PyResult < & PyModule > {
122122 PyModule :: import ( py, npyffi:: array:: MOD_NAME )
123123}
124124
@@ -128,7 +128,7 @@ unsafe impl<T: Element, D: Dimension> PyTypeInfo for PyArray<T, D> {
128128 const NAME : & ' static str = "PyArray<T, D>" ;
129129 const MODULE : Option < & ' static str > = Some ( "numpy" ) ;
130130
131- fn type_object_raw ( py : Python ) -> * mut ffi:: PyTypeObject {
131+ fn type_object_raw < ' py > ( py : Python < ' py > ) -> * mut ffi:: PyTypeObject {
132132 unsafe { npyffi:: PY_ARRAY_API . get_type_object ( py, npyffi:: NpyTypes :: PyArray_Type ) }
133133 }
134134
@@ -164,7 +164,7 @@ impl<T, D> AsPyPointer for PyArray<T, D> {
164164
165165impl < T , D > IntoPy < Py < PyArray < T , D > > > for & ' _ PyArray < T , D > {
166166 #[ inline]
167- fn into_py ( self , py : Python < ' _ > ) -> Py < PyArray < T , D > > {
167+ fn into_py < ' py > ( self , py : Python < ' py > ) -> Py < PyArray < T , D > > {
168168 unsafe { Py :: from_borrowed_ptr ( py, self . as_ptr ( ) ) }
169169 }
170170}
@@ -183,7 +183,7 @@ impl<'a, T, D> From<&'a PyArray<T, D>> for &'a PyAny {
183183}
184184
185185impl < T , D > IntoPy < PyObject > for PyArray < T , D > {
186- fn into_py ( self , py : Python < ' _ > ) -> PyObject {
186+ fn into_py < ' py > ( self , py : Python < ' py > ) -> PyObject {
187187 unsafe { PyObject :: from_borrowed_ptr ( py, self . as_ptr ( ) ) }
188188 }
189189}
@@ -327,16 +327,16 @@ impl<T: Element, D: Dimension> PyArray<T, D> {
327327 /// assert_eq!(arr.shape(), &[4, 5, 6]);
328328 /// });
329329 /// ```
330- pub unsafe fn new < ID > ( py : Python , dims : ID , is_fortran : bool ) -> & Self
330+ pub unsafe fn new < ' py , ID > ( py : Python < ' py > , dims : ID , is_fortran : bool ) -> & Self
331331 where
332332 ID : IntoDimension < Dim = D > ,
333333 {
334334 let flags = c_int:: from ( is_fortran) ;
335335 Self :: new_uninit ( py, dims, ptr:: null_mut ( ) , flags)
336336 }
337337
338- pub ( crate ) unsafe fn new_uninit < ID > (
339- py : Python ,
338+ pub ( crate ) unsafe fn new_uninit < ' py , ID > (
339+ py : Python < ' py > ,
340340 dims : ID ,
341341 strides : * const npy_intp ,
342342 flag : c_int ,
@@ -484,7 +484,7 @@ impl<T: Element, D: Dimension> PyArray<T, D> {
484484 ///
485485 /// [numpy-zeros]: https://numpy.org/doc/stable/reference/generated/numpy.zeros.html
486486 /// [PyArray_Zeros]: https://numpy.org/doc/stable/reference/c-api/array.html#c.PyArray_Zeros
487- pub fn zeros < ID > ( py : Python , dims : ID , is_fortran : bool ) -> & Self
487+ pub fn zeros < ' py , ID > ( py : Python < ' py > , dims : ID , is_fortran : bool ) -> & Self
488488 where
489489 ID : IntoDimension < Dim = D > ,
490490 {
@@ -989,7 +989,7 @@ where
989989 #[ doc( alias = "nalgebra" ) ]
990990 pub unsafe fn try_as_matrix < R , C , RStride , CStride > (
991991 & self ,
992- ) -> Option < nalgebra:: MatrixView < N , R , C , RStride , CStride > >
992+ ) -> Option < nalgebra:: MatrixView < ' _ , N , R , C , RStride , CStride > >
993993 where
994994 R : nalgebra:: Dim ,
995995 C : nalgebra:: Dim ,
@@ -1011,7 +1011,7 @@ where
10111011 #[ doc( alias = "nalgebra" ) ]
10121012 pub unsafe fn try_as_matrix_mut < R , C , RStride , CStride > (
10131013 & self ,
1014- ) -> Option < nalgebra:: MatrixViewMut < N , R , C , RStride , CStride > >
1014+ ) -> Option < nalgebra:: MatrixViewMut < ' _ , N , R , C , RStride , CStride > >
10151015 where
10161016 R : nalgebra:: Dim ,
10171017 C : nalgebra:: Dim ,
@@ -1086,7 +1086,7 @@ impl<T: Copy + Element> PyArray<T, Ix0> {
10861086}
10871087
10881088impl < T : Element > PyArray < T , Ix1 > {
1089- /// Construct a one-dimensional array from a [slice][std:: slice].
1089+ /// Construct a one-dimensional array from a [mod@ slice].
10901090 ///
10911091 /// # Example
10921092 ///
@@ -1144,7 +1144,7 @@ impl<T: Element> PyArray<T, Ix1> {
11441144 /// assert_eq!(pyarray.readonly().as_slice().unwrap(), &[97, 98, 99, 100, 101]);
11451145 /// });
11461146 /// ```
1147- pub fn from_iter < I > ( py : Python < ' _ > , iter : I ) -> & Self
1147+ pub fn from_iter < ' py , I > ( py : Python < ' py > , iter : I ) -> & ' py Self
11481148 where
11491149 I : IntoIterator < Item = T > ,
11501150 {
@@ -1448,7 +1448,7 @@ impl<T: Element + AsPrimitive<f64>> PyArray<T, Ix1> {
14481448 ///
14491449 /// [numpy.arange]: https://numpy.org/doc/stable/reference/generated/numpy.arange.html
14501450 /// [PyArray_Arange]: https://numpy.org/doc/stable/reference/c-api/array.html#c.PyArray_Arange
1451- pub fn arange ( py : Python , start : T , stop : T , step : T ) -> & Self {
1451+ pub fn arange < ' py > ( py : Python < ' py > , start : T , stop : T , step : T ) -> & Self {
14521452 unsafe {
14531453 let ptr = PY_ARRAY_API . PyArray_Arange (
14541454 py,
0 commit comments