Skip to content

Commit cbf22e6

Browse files
committed
Wrap some overlong comments.
1 parent 4ddb0b7 commit cbf22e6

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

compiler/rustc_middle/src/ty/context.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,15 @@ pub struct CtxtInterners<'tcx> {
205205

206206
impl<'tcx> CtxtInterners<'tcx> {
207207
fn new(arena: &'tcx WorkerLocal<Arena<'tcx>>) -> CtxtInterners<'tcx> {
208-
// Default interner size - this value has been chosen empirically, and may need to be adjusted
209-
// as the compiler evolves.
208+
// Default interner size - this value has been chosen empirically, and may need to be
209+
// adjusted as the compiler evolves.
210210
const N: usize = 2048;
211211
CtxtInterners {
212212
arena,
213-
// The factors have been chosen by @FractalFir based on observed interner sizes, and local perf runs.
214-
// To get the interner sizes, insert `eprintln` printing the size of the interner in functions like `intern_ty`.
215-
// Bigger benchmarks tend to give more accurate ratios, so use something like `x perf eprintln --includes cargo`.
213+
// The factors have been chosen by @FractalFir based on observed interner sizes, and
214+
// local perf runs. To get the interner sizes, insert `eprintln` printing the size of
215+
// the interner in functions like `intern_ty`. Bigger benchmarks tend to give more
216+
// accurate ratios, so use something like `x perf eprintln --includes cargo`.
216217
type_: InternedSet::with_capacity(N * 16),
217218
const_lists: InternedSet::with_capacity(N * 4),
218219
args: InternedSet::with_capacity(N * 4),
@@ -326,11 +327,12 @@ const NUM_PREINTERNED_ANON_BOUND_TYS_I: u32 = 3;
326327
// From general profiling of the *max vars during canonicalization* of a value:
327328
// - about 90% of the time, there are no canonical vars
328329
// - about 9% of the time, there is only one canonical var
329-
// - there are rarely more than 3-5 canonical vars (with exceptions in particularly pathological cases)
330+
// - there are rarely more than 3-5 canonical vars (with exceptions in particularly pathological
331+
// cases)
330332
// This may not match the number of bound vars found in `for`s.
331333
// Given that this is all heap interned, it seems likely that interning fewer
332-
// vars here won't make an appreciable difference. Though, if we were to inline the data (in an array),
333-
// we may want to consider reducing the number for canonicalized vars down to 4 or so.
334+
// vars here won't make an appreciable difference. Though, if we were to inline the data (in an
335+
// array), we may want to consider reducing the number for canonicalized vars down to 4 or so.
334336
const NUM_PREINTERNED_ANON_BOUND_TYS_V: u32 = 20;
335337

336338
// This number may seem high, but it is reached in all but the smallest crates.
@@ -381,8 +383,8 @@ pub struct CommonTypes<'tcx> {
381383
pub fresh_float_tys: Vec<Ty<'tcx>>,
382384

383385
/// Pre-interned values of the form:
384-
/// `Bound(BoundVarIndexKind::Bound(DebruijnIndex(i)), BoundTy { var: v, kind: BoundTyKind::Anon})`
385-
/// for small values of `i` and `v`.
386+
/// `Bound(BoundVarIndexKind::Bound(DebruijnIndex(i)), BoundTy { var: v, kind:
387+
/// BoundTyKind::Anon})` for small values of `i` and `v`.
386388
pub anon_bound_tys: Vec<Vec<Ty<'tcx>>>,
387389

388390
// Pre-interned values of the form:

0 commit comments

Comments
 (0)