Commit f08cc60
authored
Commit 603a55f ("fix `#[pyclass]` could not be named `Probe`
(#4794)") fixed the issue where it was not possible to define a class
named `Probe`. However, similar issue exists when trying to add
`#[pymethods]` implementations to the `Probe` class. It generates
similar confusing errors as the original issue (#4792), due to the
internal `Probe` trait being in scope at the user code:
error[E0782]: expected a type, found a trait
help: you can add the `dyn` keyword if you want a trait object
# | impl dyn Probe {
Fix the issue by avoiding pollution of the imports from the macro
expansion and instead use qualified path to the internal types.
1 parent 8e7ac5d commit f08cc60
File tree
3 files changed
+16
-2
lines changed- newsfragments
- pyo3-macros-backend/src
- tests/ui
3 files changed
+16
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
371 | 370 | | |
372 | | - | |
| 371 | + | |
373 | 372 | | |
374 | 373 | | |
375 | 374 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
6 | 20 | | |
0 commit comments