Skip to content

Commit f318ba2

Browse files
authored
Warn about naively fixing the FIXME
1 parent 0ed8e16 commit f318ba2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/librustc/ty/layout.rs

+7
Original file line numberDiff line numberDiff line change
@@ -1627,6 +1627,13 @@ impl<'a, 'tcx, C> TyLayoutMethods<'tcx, C> for Ty<'tcx>
16271627
tcx.mk_array(tcx.types.usize, 3),
16281628
)
16291629
/* FIXME use actual fn pointers
1630+
Warning: naively computing the number of entries in the
1631+
vtable by counting the methods on the trait + methods on
1632+
all parent traits does not work, because some methods can
1633+
be not object safe and thus excluded from the vtable.
1634+
Increase this counter if you tried to implement this but
1635+
failed to do it without duplicating a lot of code from
1636+
other places in the compiler: 2
16301637
tcx.mk_tup(&[
16311638
tcx.mk_array(tcx.types.usize, 3),
16321639
tcx.mk_array(Option<fn()>),

0 commit comments

Comments
 (0)