You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Three codegen bugs plus stale UI test snapshots:
- The fused `unsafe` extraction blocks (extract_required_argument,
from_py_with_required, extract_receiver{,_trusted}) were emitted
inside quote_spanned! with user-code spans, so the `unsafe` token
was attributed to user code and rejected by #![forbid(unsafe_code)].
Build the unsafe wrapper with call-site spans and interpolate the
spanned call into it, as the previous codegen did.
- `fn into_pyobject(...) -> PyResult<Self::Output>` is ambiguous for
enums with a variant named `Output`; spell out the concrete return
type `PyResult<Bound<'py, Self>>` instead.
- Re-bless the UI test snapshots for the renamed extraction/conversion
helpers, and update inline annotations:
- invalid_pymethod_receiver now uses a local receiver type, because
the fused receiver extraction produces a `From` candidate list for
`i32` which varies with enabled features (jiff impls under `full`)
- missing_intopy no longer emits the `map_err` error (the old
ok_wrap + map_result_into_ptr codegen is gone)
- invalid_pyclass_generic gains never_type_fallback diagnostics from
the unsafe fused helpers in already-erroneous code
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: tests/ui/invalid_pyclass_args.default.stderr
+13-22Lines changed: 13 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -413,15 +413,6 @@ error[E0609]: no field `162543` on type `&Coord3`
413
413
|
414
414
= note: available fields are: `0`, `1`, `2`
415
415
416
-
warning: use of deprecated associated constant `pyo3::impl_::deprecated::HasAutomaticFromPyObject::<true>::MSG`: The `FromPyObject` implementation for `#[pyclass]` types which implement `Clone` is changing to an opt-in option. Use `#[pyclass(from_py_object)]` to opt-in to the `FromPyObject` derive now, or `#[pyclass(skip_from_py_object)]` to skip the `FromPyObject` implementation.
417
-
--> tests/ui/invalid_pyclass_args.rs:243:1
418
-
|
419
-
243 | #[pyclass]
420
-
| ^^^^^^^^^^
421
-
|
422
-
= note: `#[warn(deprecated)]` on by default
423
-
= note: this warning originates in the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info)
424
-
425
416
error[E0277]: `Box<dyn std::error::Error + Send + Sync>` cannot be used as a Python function argument
426
417
--> tests/ui/invalid_pyclass_args.rs:252:12
427
418
|
@@ -442,14 +433,14 @@ error[E0277]: `Box<dyn std::error::Error + Send + Sync>` cannot be used as a Pyt
442
433
and $N others
443
434
= note: required for `Box<dyn std::error::Error + Send + Sync>` to implement `pyo3::FromPyObject<'_, '_>`
444
435
= note: required for `Box<dyn std::error::Error + Send + Sync>` to implement `pyo3::impl_::extract_argument::PyFunctionArgument<'_, '_, '_, true>`
445
-
note: required by a bound in `pyo3::impl_::extract_argument::extract_argument`
436
+
note: required by a bound in `pyo3::impl_::extract_argument::extract_required_argument`
0 commit comments