Imperfect vtable layout with an empty super trait comming after non-empty one #114942
Labels
A-trait-objects
Area: trait objects, vtable layout
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
C-optimization
Category: An issue highlighting optimization opportunities or PRs implementing such
F-trait_upcasting
`#![feature(trait_upcasting)]`
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
(play)
I expected
Imperfection
to have vtable layout which isDSA, Pencil::f
.Instead, it also includes
vptr(Marker)
. Note that this is unnecessary asMarker
's vtable only containsDSA
triplet andImperfection
's vtable can be casted toMarker
's. Ideally we should never emitvptr
s to empty traits.This is a continuation of #113840, inspired by #113856 (comment); #113856 missed this case.
Meta
rustc
version:The text was updated successfully, but these errors were encountered: