1
Fork 0

Rollup merge of #116223 - catandcoder:master, r=cjgillot

Fix misuses of a vs an

Fixes the misuse of "a" vs "an", according to English grammatical
expectations and using https://www.a-or-an.com/
This commit is contained in:
Jubilee 2023-10-05 00:56:29 -07:00 committed by GitHub
commit ea3454eabb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 18 additions and 18 deletions

View file

@ -1364,7 +1364,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
err.note(format!(
"a for loop advances the iterator for you, the result is stored in `{loop_bind}`."
));
err.help("if you want to call `next` on a iterator within the loop, consider using `while let`.");
err.help("if you want to call `next` on an iterator within the loop, consider using `while let`.");
}
}

View file

@ -1359,9 +1359,9 @@ fn suggest_ampmut<'tcx>(
None => (false, decl_span),
};
// if the binding already exists and is a reference with a explicit
// if the binding already exists and is a reference with an explicit
// lifetime, then we can suggest adding ` mut`. this is special-cased from
// the path without a explicit lifetime.
// the path without an explicit lifetime.
if let Ok(src) = tcx.sess.source_map().span_to_snippet(span)
&& src.starts_with("&'")
// note that `& 'a T` is invalid so this is correct.

View file

@ -1967,7 +1967,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
Reservation(WriteKind::MutableBorrow(BorrowKind::Mut { kind: mut_borrow_kind }))
| Write(WriteKind::MutableBorrow(BorrowKind::Mut { kind: mut_borrow_kind })) => {
let is_local_mutation_allowed = match mut_borrow_kind {
// `ClosureCapture` is used for mutable variable with a immutable binding.
// `ClosureCapture` is used for mutable variable with an immutable binding.
// This is only behaviour difference between `ClosureCapture` and mutable borrows.
MutBorrowKind::ClosureCapture => LocalMutationIsAllowed::Yes,
MutBorrowKind::Default | MutBorrowKind::TwoPhaseBorrow => {

View file

@ -164,7 +164,7 @@ struct UniversalRegionIndices<'tcx> {
/// be able to map them to our internal `RegionVid`. This is
/// basically equivalent to an `GenericArgs`, except that it also
/// contains an entry for `ReStatic` -- it might be nice to just
/// use a args, and then handle `ReStatic` another way.
/// use an args, and then handle `ReStatic` another way.
indices: FxHashMap<ty::Region<'tcx>, RegionVid>,
/// The vid assigned to `'static`. Used only for diagnostics.
@ -290,7 +290,7 @@ impl<'tcx> UniversalRegions<'tcx> {
(FIRST_GLOBAL_INDEX..self.num_universals).map(RegionVid::from_usize)
}
/// Returns `true` if `r` is classified as an local region.
/// Returns `true` if `r` is classified as a local region.
pub fn is_local_free_region(&self, r: RegionVid) -> bool {
self.region_classification(r) == Some(RegionClassification::Local)
}