diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-10-30 15:33:05 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-10-30 15:33:05 +1100 |
| commit | a60d6438dc483f9d999716f70ea153d7246971b1 (patch) | |
| tree | d12cbfc67d20cbfe928150229b74080bbd5e76c6 /compiler/rustc_interface/src | |
| parent | 85e56e81f8b5ba947d2522369019088e5bd5d6e1 (diff) | |
| download | rust-a60d6438dc483f9d999716f70ea153d7246971b1.tar.gz rust-a60d6438dc483f9d999716f70ea153d7246971b1.zip | |
Wrap some overlong comments.
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 1736a1f6d53..9685b077776 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -880,16 +880,18 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> { let trait_ref = ty::Binder::dummy(ty::TraitRef::identity(tcx, tr)); - // A slightly edited version of the code in `rustc_trait_selection::traits::vtable::vtable_entries`, - // that works without self type and just counts number of entries. + // A slightly edited version of the code in + // `rustc_trait_selection::traits::vtable::vtable_entries`, that works without self + // type and just counts number of entries. // - // Note that this is technically wrong, for traits which have associated types in supertraits: + // Note that this is technically wrong, for traits which have associated types in + // supertraits: // // trait A: AsRef<Self::T> + AsRef<()> { type T; } // - // Without self type we can't normalize `Self::T`, so we can't know if `AsRef<Self::T>` and - // `AsRef<()>` are the same trait, thus we assume that those are different, and potentially - // over-estimate how many vtable entries there are. + // Without self type we can't normalize `Self::T`, so we can't know if `AsRef<Self::T>` + // and `AsRef<()>` are the same trait, thus we assume that those are different, and + // potentially over-estimate how many vtable entries there are. // // Similarly this is wrong for traits that have methods with possibly-impossible bounds. // For example: @@ -916,10 +918,10 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> { let own_existential_entries = tcx.own_existential_vtable_entries(trait_ref.def_id()); - // The original code here ignores the method if its predicates are impossible. - // We can't really do that as, for example, all not trivial bounds on generic - // parameters are impossible (since we don't know the parameters...), - // see the comment above. + // The original code here ignores the method if its predicates are + // impossible. We can't really do that as, for example, all not trivial + // bounds on generic parameters are impossible (since we don't know the + // parameters...), see the comment above. entries_ignoring_upcasting += own_existential_entries.len(); if emit_vptr { |
