Skip to content

Commit 9fea208

Browse files
committed
refactor documentation/comments
1 parent 1b13ca4 commit 9fea208

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -682,14 +682,13 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
682682
}
683683
};
684684

685-
// Lets see:
686-
// because of TypeChecking and indexing, we know: index is &Q
685+
// Because of TypeChecking and indexing, we know: index is &Q
687686
// with K: Eq + Hash + Borrow<Q>,
688-
// with Q: Eq + Hash + ?Sized,index is a &Q with K:Borrow<Q>,
687+
// with Q: Eq + Hash + ?Sized,
689688
//
690689
//
691690
//
692-
// there is no other constraint on the types, therefore we need to look at the
691+
// There is no other constraint on the types, therefore we need to look at the
693692
// constraints of the suggestions:
694693
// pub fn get_mut<Q>(&mut self, k: &Q) -> Option<&mut V>
695694
// where
@@ -699,15 +698,15 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
699698
// pub fn insert(&mut self, k: K, v: V) -> Option<V>
700699
// pub fn entry(&mut self, key: K) -> Entry<'_, K, V>
701700
//
702-
// But lets note that there could be also, if imported from hashbrown:
701+
// But let's note that there could be also, if imported from hashbrown:
703702
// pub fn entry_ref<'a, 'b, Q>(
704-
// &'a mut self,
705-
// key: &'b Q,
703+
// &'a mut self,
704+
// key: &'b Q,
706705
// ) -> EntryRef<'a, 'b, K, Q, V, S, A>
707706
// where
708-
// Q: Hash + Equivalent<K> + ?Sized,
707+
// Q: Hash + Equivalent<K> + ?Sized,
709708

710-
/// testing if index AND key are &Q. We cannot simply test equality because the
709+
/// Testing if index AND key are &Q. We cannot simply test equality because the
711710
/// lifetimes differ.
712711
fn index_and_key_are_same_borrowed_type<'tcx>(
713712
index: Ty<'tcx>,
@@ -721,7 +720,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
721720
false
722721
}
723722
}
724-
/// testing if index is &K:
723+
/// Testing if index is &K:
725724
fn index_is_borrowed_key<'tcx>(index: Ty<'tcx>, key: Ty<'tcx>) -> bool {
726725
if let ty::Ref(_, inner_ty, _) = index.kind() {
727726
*inner_ty == key

0 commit comments

Comments
 (0)