From 2d5a54e4d28aee564b2eab6643e4b24417a3c322 Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Thu, 22 Feb 2024 09:02:52 +0000 Subject: [PATCH] ci: updates for Rust 1.76 --- src/tests/hygiene/misc.rs | 2 +- tests/test_frompyobject.rs | 2 +- tests/test_proto_methods.rs | 4 ++-- tests/ui/not_send.stderr | 10 +++++----- tests/ui/traverse.stderr | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/tests/hygiene/misc.rs b/src/tests/hygiene/misc.rs index 2e7d3e6f..66db7f3a 100644 --- a/src/tests/hygiene/misc.rs +++ b/src/tests/hygiene/misc.rs @@ -2,7 +2,7 @@ #[derive(crate::FromPyObject)] #[pyo3(crate = "crate")] -struct Derive1(i32); // newtype case +struct Derive1(#[allow(dead_code)] i32); // newtype case #[derive(crate::FromPyObject)] #[pyo3(crate = "crate")] diff --git a/tests/test_frompyobject.rs b/tests/test_frompyobject.rs index 3b6ba288..8a16812c 100644 --- a/tests/test_frompyobject.rs +++ b/tests/test_frompyobject.rs @@ -421,7 +421,7 @@ TypeError: failed to extract enum Foo ('TupleVar | StructVar | TransparentTuple #[derive(Debug, FromPyObject)] enum EnumWithCatchAll<'a> { #[pyo3(transparent)] - Foo(Foo<'a>), + Foo(#[allow(dead_code)] Foo<'a>), #[pyo3(transparent)] CatchAll(&'a PyAny), } diff --git a/tests/test_proto_methods.rs b/tests/test_proto_methods.rs index 6e6d499a..e7dc854e 100644 --- a/tests/test_proto_methods.rs +++ b/tests/test_proto_methods.rs @@ -264,13 +264,13 @@ impl Sequence { self.values.len() } - fn __getitem__(&self, index: SequenceIndex<'_>) -> PyResult { + fn __getitem__(&self, py: Python<'_>, index: SequenceIndex<'_>) -> PyResult { match index { SequenceIndex::Integer(index) => { let uindex = self.usize_index(index)?; self.values .get(uindex) - .map(Clone::clone) + .map(|o| o.clone_ref(py)) .ok_or_else(|| PyIndexError::new_err(index)) } // Just to prove that slicing can be implemented diff --git a/tests/ui/not_send.stderr b/tests/ui/not_send.stderr index 9ac51f36..5d05b3de 100644 --- a/tests/ui/not_send.stderr +++ b/tests/ui/not_send.stderr @@ -7,23 +7,23 @@ error[E0277]: `*mut pyo3::Python<'static>` cannot be shared between threads safe | required by a bound introduced by this call | = help: within `pyo3::Python<'_>`, the trait `Sync` is not implemented for `*mut pyo3::Python<'static>` -note: required because it appears within the type `PhantomData<*mut Python<'static>>` +note: required because it appears within the type `PhantomData<*mut pyo3::Python<'static>>` --> $RUST/core/src/marker.rs | | pub struct PhantomData; | ^^^^^^^^^^^ -note: required because it appears within the type `NotSend` +note: required because it appears within the type `impl_::not_send::NotSend` --> src/impl_/not_send.rs | | pub(crate) struct NotSend(PhantomData<*mut Python<'static>>); | ^^^^^^^ - = note: required because it appears within the type `(&GILGuard, NotSend)` -note: required because it appears within the type `PhantomData<(&GILGuard, NotSend)>` + = note: required because it appears within the type `(&pyo3::gil::GILGuard, impl_::not_send::NotSend)` +note: required because it appears within the type `PhantomData<(&pyo3::gil::GILGuard, impl_::not_send::NotSend)>` --> $RUST/core/src/marker.rs | | pub struct PhantomData; | ^^^^^^^^^^^ -note: required because it appears within the type `Python<'_>` +note: required because it appears within the type `pyo3::Python<'_>` --> src/marker.rs | | pub struct Python<'py>(PhantomData<(&'py GILGuard, NotSend)>); diff --git a/tests/ui/traverse.stderr b/tests/ui/traverse.stderr index e2718c76..4448e67e 100644 --- a/tests/ui/traverse.stderr +++ b/tests/ui/traverse.stderr @@ -15,7 +15,7 @@ error[E0308]: mismatched types | |___________________^ expected fn pointer, found fn item | = note: expected fn pointer `for<'a, 'b> fn(&'a TraverseTriesToTakePyRef, PyVisit<'b>) -> Result<(), PyTraverseError>` - found fn item `for<'a, 'b> fn(pyo3::PyRef<'a, TraverseTriesToTakePyRef>, PyVisit<'b>) {TraverseTriesToTakePyRef::__traverse__}` + found fn item `for<'a, 'b> fn(pyo3::PyRef<'a, TraverseTriesToTakePyRef, >, PyVisit<'b>) {TraverseTriesToTakePyRef::__traverse__}` note: function defined here --> src/impl_/pymethods.rs |