Incremental compilation breaks trait objects in async fns #66814
Labels
A-async-await
Area: Async & Await
A-incr-comp
Area: Incremental compilation
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Hi,
my colleague @Wenceslaw stumbled upon a strange problem when comparing
Arc
pointers equality. It seems that when constructing trait objects inasync
functions, sometimes the vtable pointer is different even though the type is the same, leading toArc::ptr_eq()
returningfalse
.I've put together a minimal-ish example: playground link.
Through some experimentation I've found out the problem occurs when incremental compilation is turned on. On the playground it's off, so you don't see a problem there, but with incremental on, I get an output like this:
Toolchain version and optimization level doesn't seem to make any difference.
cc @janbraiins
(edit: typos)
The text was updated successfully, but these errors were encountered: