-
Notifications
You must be signed in to change notification settings - Fork 831
chore: Fix 1.58 release #2100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Fix 1.58 release #2100
Changes from all commits
6430fc4
b7263dd
2006ee0
a8a10ac
de17511
f7d7da9
46c4581
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,10 +77,9 @@ extern "C" { | |
) -> *mut PyObject; | ||
#[cfg_attr(PyPy, link_name = "PyPyUnicode_FromObject")] | ||
pub fn PyUnicode_FromObject(obj: *mut PyObject) -> *mut PyObject; | ||
// #[cfg_attr(PyPy, link_name = "PyPyUnicode_FromFormatV")] | ||
// pub fn PyUnicode_FromFormatV(format: *const c_char, vargs: va_list) -> *mut PyObject; | ||
Comment on lines
+80
to
+81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure what's up with this..it seems that all functions using the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess it's because support in std is not stable? We could enable it behind an optional flag. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I had no idea that existed. Given that it's been on nightly for 3 years now and it doesn't look like it's close to stabilization, I think I prefer just not having these. |
||
#[cfg_attr(PyPy, link_name = "PyPyUnicode_FromFormat")] | ||
#[cfg_attr(PyPy, link_name = "PyPyUnicode_FromFormatV")] | ||
//pub fn PyUnicode_FromFormatV(format: *const c_char, | ||
// vargs: va_list) -> *mut PyObject; | ||
pub fn PyUnicode_FromFormat(format: *const c_char, ...) -> *mut PyObject; | ||
#[cfg_attr(PyPy, link_name = "PyPyUnicode_InternInPlace")] | ||
pub fn PyUnicode_InternInPlace(arg1: *mut *mut PyObject); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
error[E0277]: the trait bound `i32: From<&PyCell<MyClass>>` is not satisfied | ||
--> tests/ui/invalid_pymethod_receiver.rs:8:43 | ||
| | ||
8 | fn method_with_invalid_self_type(slf: i32, py: Python, index: u32) {} | ||
| ^^^ the trait `From<&PyCell<MyClass>>` is not implemented for `i32` | ||
| | ||
= help: the following implementations were found: | ||
<i32 as From<NonZeroI32>> | ||
<i32 as From<bool>> | ||
<i32 as From<i16>> | ||
<i32 as From<i8>> | ||
and 2 others | ||
= note: required because of the requirements on the impl of `Into<i32>` for `&PyCell<MyClass>` | ||
= note: required because of the requirements on the impl of `TryFrom<&PyCell<MyClass>>` for `i32` | ||
note: required by `std::convert::TryFrom::try_from` | ||
--> $RUST/core/src/convert/mod.rs | ||
| | ||
| fn try_from(value: T) -> Result<Self, Self::Error>; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
--> tests/ui/invalid_pymethod_receiver.rs:8:43 | ||
| | ||
8 | fn method_with_invalid_self_type(slf: i32, py: Python, index: u32) {} | ||
| ^^^ the trait `From<&PyCell<MyClass>>` is not implemented for `i32` | ||
| | ||
= help: the following implementations were found: | ||
<i32 as From<NonZeroI32>> | ||
<i32 as From<bool>> | ||
<i32 as From<i16>> | ||
<i32 as From<i8>> | ||
and 2 others | ||
= note: required because of the requirements on the impl of `Into<i32>` for `&PyCell<MyClass>` | ||
= note: required because of the requirements on the impl of `TryFrom<&PyCell<MyClass>>` for `i32` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
error[E0277]: the trait bound `TestClass: Clone` is not satisfied | ||
--> tests/ui/missing_clone.rs:15:32 | ||
| | ||
15 | let t: TestClass = pyvalue.extract(py).unwrap(); | ||
| ^^^^^^^ the trait `Clone` is not implemented for `TestClass` | ||
| | ||
= note: required because of the requirements on the impl of `pyo3::FromPyObject<'_>` for `TestClass` | ||
--> tests/ui/missing_clone.rs:15:32 | ||
| | ||
15 | let t: TestClass = pyvalue.extract(py).unwrap(); | ||
| ^^^^^^^ the trait `Clone` is not implemented for `TestClass` | ||
| | ||
= note: required because of the requirements on the impl of `pyo3::FromPyObject<'_>` for `TestClass` | ||
note: required by a bound in `pyo3::Py::<T>::extract` | ||
--> src/instance.rs | ||
| | ||
| D: FromPyObject<'p>, | ||
| ^^^^^^^^^^^^^^^^ required by this bound in `pyo3::Py::<T>::extract` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
error[E0277]: `*mut pyo3::Python<'static>` cannot be shared between threads safely | ||
--> tests/ui/not_send.rs:4:8 | ||
| | ||
4 | py.allow_threads(|| { drop(py); }); | ||
| ^^^^^^^^^^^^^ `*mut pyo3::Python<'static>` cannot be shared between threads safely | ||
| | ||
= 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 pyo3::Python<'static>>` | ||
= note: required because it appears within the type `pyo3::impl_::not_send::NotSend` | ||
= note: required because it appears within the type `(&GILGuard, pyo3::impl_::not_send::NotSend)` | ||
= note: required because it appears within the type `PhantomData<(&GILGuard, pyo3::impl_::not_send::NotSend)>` | ||
= note: required because it appears within the type `pyo3::Python<'_>` | ||
= note: required because of the requirements on the impl of `Send` for `&pyo3::Python<'_>` | ||
= note: required because it appears within the type `[closure@$DIR/tests/ui/not_send.rs:4:22: 4:38]` | ||
--> tests/ui/not_send.rs:4:8 | ||
| | ||
4 | py.allow_threads(|| { drop(py); }); | ||
| ^^^^^^^^^^^^^ `*mut pyo3::Python<'static>` cannot be shared between threads safely | ||
| | ||
= 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 pyo3::Python<'static>>` | ||
= note: required because it appears within the type `pyo3::impl_::not_send::NotSend` | ||
= note: required because it appears within the type `(&GILGuard, pyo3::impl_::not_send::NotSend)` | ||
= note: required because it appears within the type `PhantomData<(&GILGuard, pyo3::impl_::not_send::NotSend)>` | ||
= note: required because it appears within the type `pyo3::Python<'_>` | ||
= note: required because of the requirements on the impl of `Send` for `&pyo3::Python<'_>` | ||
= note: required because it appears within the type `[closure@$DIR/tests/ui/not_send.rs:4:22: 4:38]` | ||
note: required by a bound in `pyo3::Python::<'py>::allow_threads` | ||
--> src/python.rs | ||
| | ||
| F: Send + FnOnce() -> T, | ||
| ^^^^ required by this bound in `pyo3::Python::<'py>::allow_threads` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See rust-lang/rust-clippy#8045
We could also just make the fields
Send
, because right now the only types that implementElement
are threadsafe already. However that would be a breaking change for anyone who has implementedElement
on their own types.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. Should we mark this with a FIXME or TODO to decide later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually that's not going to silence the lint, because it's triggering on
ffi::Py_buffer
, and we can't make that Send. 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok. This is just one of the many cases where Python ffi makes clippy uneasy, we'll just have to live with it.