Skip to content

Commit 671d7e0

Browse files
committed
Change a method name and clarify a comment
1 parent bd2b54c commit 671d7e0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/librustc_mir/borrow_check/move_errors.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,9 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
347347
_ => false,
348348
};
349349
if try_remove_deref && snippet.starts_with('*') {
350-
// This is false for (e.g.) index expressions `a[b]`,
351-
// which roughly desugar to `*Index::index(&a, b)` or
350+
// The snippet doesn't start with `*` in (e.g.) index
351+
// expressions `a[b]`, which roughly desugar to
352+
// `*Index::index(&a, b)` or
352353
// `*IndexMut::index_mut(&mut a, b)`.
353354
err.span_suggestion(
354355
span,
@@ -365,13 +366,13 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
365366

366367
binds_to.sort();
367368
binds_to.dedup();
368-
self.add_move_error_labels(err, &binds_to);
369+
self.add_move_error_details(err, &binds_to);
369370
}
370371
GroupedMoveError::MovesFromValue { mut binds_to, .. } => {
371372
binds_to.sort();
372373
binds_to.dedup();
373374
self.add_move_error_suggestions(err, &binds_to);
374-
self.add_move_error_labels(err, &binds_to);
375+
self.add_move_error_details(err, &binds_to);
375376
}
376377
// No binding. Nothing to suggest.
377378
GroupedMoveError::OtherIllegalMove { .. } => (),
@@ -428,7 +429,7 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
428429
}
429430
}
430431

431-
fn add_move_error_labels(
432+
fn add_move_error_details(
432433
&self,
433434
err: &mut DiagnosticBuilder<'a>,
434435
binds_to: &[Local],

0 commit comments

Comments
 (0)