Skip to content

Commit bd0ea19

Browse files
committed
add comments
1 parent 5b06025 commit bd0ea19

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/librustc_mir/borrow_check/diagnostics/region_errors.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ enum Trace {
6363

6464
/// A collection of errors encountered during region inference. This is needed to efficiently
6565
/// report errors after borrow checking.
66+
///
67+
/// Usually we expect this to either be empty or contain a small number of items, so we can avoid
68+
/// allocation most of the time.
6669
crate type RegionErrors<'tcx> = smallvec::SmallVec<[RegionErrorKind<'tcx>; 4]>;
6770

6871
#[derive(Clone, Debug)]

src/librustc_mir/borrow_check/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,6 +1666,9 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
16661666

16671667
db.buffer(&mut self.errors_buffer);
16681668
} else {
1669+
// We only report the first error, so as not to overwhelm the user. See
1670+
// `RegRegionErrorKind` docs.
1671+
//
16691672
// FIXME: currently we do nothing with these, but perhaps we can do better?
16701673
// FIXME: try collecting these constraints on the outlives suggestion
16711674
// builder. Does it make the suggestions any better?

0 commit comments

Comments
 (0)