@@ -880,16 +880,18 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
880
880
881
881
let trait_ref = ty:: Binder :: dummy ( ty:: TraitRef :: identity ( tcx, tr) ) ;
882
882
883
- // A slightly edited version of the code in `rustc_trait_selection::traits::vtable::vtable_entries`,
884
- // that works without self type and just counts number of entries.
883
+ // A slightly edited version of the code in
884
+ // `rustc_trait_selection::traits::vtable::vtable_entries`, that works without self
885
+ // type and just counts number of entries.
885
886
//
886
- // Note that this is technically wrong, for traits which have associated types in supertraits:
887
+ // Note that this is technically wrong, for traits which have associated types in
888
+ // supertraits:
887
889
//
888
890
// trait A: AsRef<Self::T> + AsRef<()> { type T; }
889
891
//
890
- // Without self type we can't normalize `Self::T`, so we can't know if `AsRef<Self::T>` and
891
- // `AsRef<()>` are the same trait, thus we assume that those are different, and potentially
892
- // over-estimate how many vtable entries there are.
892
+ // Without self type we can't normalize `Self::T`, so we can't know if `AsRef<Self::T>`
893
+ // and `AsRef<()>` are the same trait, thus we assume that those are different, and
894
+ // potentially over-estimate how many vtable entries there are.
893
895
//
894
896
// Similarly this is wrong for traits that have methods with possibly-impossible bounds.
895
897
// For example:
@@ -916,10 +918,10 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
916
918
let own_existential_entries =
917
919
tcx. own_existential_vtable_entries ( trait_ref. def_id ( ) ) ;
918
920
919
- // The original code here ignores the method if its predicates are impossible.
920
- // We can't really do that as, for example, all not trivial bounds on generic
921
- // parameters are impossible (since we don't know the parameters...),
922
- // see the comment above.
921
+ // The original code here ignores the method if its predicates are
922
+ // impossible. We can't really do that as, for example, all not trivial
923
+ // bounds on generic parameters are impossible (since we don't know the
924
+ // parameters...), see the comment above.
923
925
entries_ignoring_upcasting += own_existential_entries. len ( ) ;
924
926
925
927
if emit_vptr {
0 commit comments