]> git.lizzy.rs Git - rust.git/commitdiff
Warn about naively fixing the FIXME
authorOliver Schneider <github35764891676564198441@oli-obk.de>
Tue, 28 Aug 2018 12:04:07 +0000 (14:04 +0200)
committerGitHub <noreply@github.com>
Tue, 28 Aug 2018 12:04:07 +0000 (14:04 +0200)
src/librustc/ty/layout.rs

index c93ca836bef00ff182c82a082904814fe5a71ff0..4524c486272b54e563bd62578b15e777616d4aad 100644 (file)
@@ -1627,6 +1627,13 @@ fn field(this: TyLayout<'tcx>, cx: C, i: usize) -> C::TyLayout {
                             tcx.mk_array(tcx.types.usize, 3),
                         )
                         /* FIXME use actual fn pointers
+                        Warning: naively computing the number of entries in the
+                        vtable by counting the methods on the trait + methods on
+                        all parent traits does not work, because some methods can
+                        be not object safe and thus excluded from the vtable.
+                        Increase this counter if you tried to implement this but
+                        failed to do it without duplicating a lot of code from
+                        other places in the compiler: 2
                         tcx.mk_tup(&[
                             tcx.mk_array(tcx.types.usize, 3),
                             tcx.mk_array(Option<fn()>),