VTables include uncallable methods (that take self
by value)
#114007
Labels
A-trait-system
Area: Trait system
C-bug
Category: This is a bug.
F-trait_upcasting
`#![feature(trait_upcasting)]`
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I expected that given the following method, both methods won't be included in the vtable (note that this trait is object safe,
self
"implies"where Self: Sized
for object safety check)But, in reality, with
1.73.0-nightly (2023-07-23 8771282d4e7a5c4569e4)
,method_that_takes_self
is included in the vtable, even though you can't call it:This is especially sub-optimal in the presence of trait upcasting, since this makes otherwise empty (wrt to trait objects) traits non-empty, adding need for more vptrs.
The text was updated successfully, but these errors were encountered: