Skip to content

Commit a60d643

Browse files
committed
Wrap some overlong comments.
1 parent 85e56e8 commit a60d643

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

compiler/rustc_interface/src/passes.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -880,16 +880,18 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
880880

881881
let trait_ref = ty::Binder::dummy(ty::TraitRef::identity(tcx, tr));
882882

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.
885886
//
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:
887889
//
888890
// trait A: AsRef<Self::T> + AsRef<()> { type T; }
889891
//
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.
893895
//
894896
// Similarly this is wrong for traits that have methods with possibly-impossible bounds.
895897
// For example:
@@ -916,10 +918,10 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
916918
let own_existential_entries =
917919
tcx.own_existential_vtable_entries(trait_ref.def_id());
918920

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.
923925
entries_ignoring_upcasting += own_existential_entries.len();
924926

925927
if emit_vptr {

0 commit comments

Comments
 (0)