pyo3 icon indicating copy to clipboard operation
pyo3 copied to clipboard

Error at compile-time when a non-subclassable class is being subclassed

Open ChayimFriedman2 opened this issue 1 year ago • 9 comments

Previously this crashed at runtime.

We even get to remove few tests. Nothing more fun than removing a no-longer-needed test!

Fixes #4451.

ChayimFriedman2 avatar Aug 18 '24 14:08 ChayimFriedman2

@davidhewitt Done.

ChayimFriedman2 avatar Aug 19 '24 14:08 ChayimFriedman2

Overall this looks good to me, however there seem to be some feature combinations which aren't satisfied. I'd suggest running nox -s check-feature-powerset to help identify the broken cases and add #[cfg]s on them.

(Note that in the long run we should be able to remove a lot of the cfgs if we solved #1344. Which I think is very doable but just hasn't managed to top my priorities...)

davidhewitt avatar Aug 21 '24 05:08 davidhewitt

@davidhewitt Fixed that. Those cfgs are a mess!

ChayimFriedman2 avatar Aug 21 '24 14:08 ChayimFriedman2

@davidhewitt How come this PR decreased coverage when all it did was fiddling with types? Do you have an idea?

ChayimFriedman2 avatar Aug 22 '24 11:08 ChayimFriedman2

Pretty sure the coverage is due to other changes reducing coverage on main compared to the merge base on this PR. I think it can be fixed by #4472.

Let's merge this - thanks very much!

davidhewitt avatar Aug 23 '24 12:08 davidhewitt

I think the test-debug failure is another manifestation of https://github.com/PyO3/pyo3/pull/4185#issuecomment-2113722396 🤔

davidhewitt avatar Aug 24 '24 22:08 davidhewitt

I can't reproduce the CI failure locally. Why does it even run the test under abi3 when it is explicitly cfg'ed out in this case?

ChayimFriedman2 avatar Aug 27 '24 03:08 ChayimFriedman2

It's a mismatch between how the configuration and features are set up for that job. I have an idea how to make progress here that I'm going to play with tonight.

davidhewitt avatar Aug 27 '24 06:08 davidhewitt

@ChayimFriedman2 I pushed a commit which should fix the test-debug issue. Looks like I got clippy wrong; don't worry about fixing here. If test-debug passes we can drop the commit from this branch and merge it in #4497.

davidhewitt avatar Aug 28 '24 07:08 davidhewitt

I merged #4497 so I dropped the commit from here; hopefully CI is green and we can merge this shortly!

davidhewitt avatar Aug 31 '24 13:08 davidhewitt