Skip to content

Commit ea3454e

Browse files
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/
2 parents 5236c8e + f44d116 commit ea3454e

File tree

16 files changed

+18
-18
lines changed

16 files changed

+18
-18
lines changed

compiler/rustc_ast/src/token.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ impl Token {
446446
}
447447
}
448448

449-
/// Returns `true` if the token can appear at the start of an pattern.
449+
/// Returns `true` if the token can appear at the start of a pattern.
450450
///
451451
/// Shamelessly borrowed from `can_begin_expr`, only used for diagnostics right now.
452452
pub fn can_begin_pattern(&self) -> bool {

compiler/rustc_attr/src/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ pub enum StabilityLevel {
162162
is_soft: bool,
163163
/// If part of a feature is stabilized and a new feature is added for the remaining parts,
164164
/// then the `implied_by` attribute is used to indicate which now-stable feature previously
165-
/// contained a item.
165+
/// contained an item.
166166
///
167167
/// ```pseudo-Rust
168168
/// #[unstable(feature = "foo", issue = "...")]

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
13641364
err.note(format!(
13651365
"a for loop advances the iterator for you, the result is stored in `{loop_bind}`."
13661366
));
1367-
err.help("if you want to call `next` on a iterator within the loop, consider using `while let`.");
1367+
err.help("if you want to call `next` on an iterator within the loop, consider using `while let`.");
13681368
}
13691369
}
13701370

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1359,9 +1359,9 @@ fn suggest_ampmut<'tcx>(
13591359
None => (false, decl_span),
13601360
};
13611361

1362-
// if the binding already exists and is a reference with a explicit
1362+
// if the binding already exists and is a reference with an explicit
13631363
// lifetime, then we can suggest adding ` mut`. this is special-cased from
1364-
// the path without a explicit lifetime.
1364+
// the path without an explicit lifetime.
13651365
if let Ok(src) = tcx.sess.source_map().span_to_snippet(span)
13661366
&& src.starts_with("&'")
13671367
// note that `& 'a T` is invalid so this is correct.

compiler/rustc_borrowck/src/lib.rs

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

compiler/rustc_borrowck/src/universal_regions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ struct UniversalRegionIndices<'tcx> {
164164
/// be able to map them to our internal `RegionVid`. This is
165165
/// basically equivalent to an `GenericArgs`, except that it also
166166
/// contains an entry for `ReStatic` -- it might be nice to just
167-
/// use a args, and then handle `ReStatic` another way.
167+
/// use an args, and then handle `ReStatic` another way.
168168
indices: FxHashMap<ty::Region<'tcx>, RegionVid>,
169169

170170
/// The vid assigned to `'static`. Used only for diagnostics.
@@ -290,7 +290,7 @@ impl<'tcx> UniversalRegions<'tcx> {
290290
(FIRST_GLOBAL_INDEX..self.num_universals).map(RegionVid::from_usize)
291291
}
292292

293-
/// Returns `true` if `r` is classified as an local region.
293+
/// Returns `true` if `r` is classified as a local region.
294294
pub fn is_local_free_region(&self, r: RegionVid) -> bool {
295295
self.region_classification(r) == Some(RegionClassification::Local)
296296
}

compiler/rustc_codegen_cranelift/src/abi/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn clif_sig_from_fn_abi<'tcx>(
3030
let inputs = fn_abi.args.iter().flat_map(|arg_abi| arg_abi.get_abi_param(tcx).into_iter());
3131

3232
let (return_ptr, returns) = fn_abi.ret.get_abi_return(tcx);
33-
// Sometimes the first param is an pointer to the place where the return value needs to be stored.
33+
// Sometimes the first param is a pointer to the place where the return value needs to be stored.
3434
let params: Vec<_> = return_ptr.into_iter().chain(inputs).collect();
3535

3636
Signature { params, returns, call_conv }

compiler/rustc_codegen_llvm/src/type_.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl<'ll> CodegenCx<'ll, '_> {
112112
}
113113
}
114114

115-
/// Return a LLVM type that has at most the required alignment,
115+
/// Return an LLVM type that has at most the required alignment,
116116
/// and exactly the required size, as a best-effort padding array.
117117
pub(crate) fn type_padding_filler(&self, size: Size, align: Align) -> &'ll Type {
118118
let unit = Integer::approximate_align(self, align);

compiler/rustc_codegen_ssa/src/traits/type_.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub trait BaseTypeMethods<'tcx>: Backend<'tcx> {
3030
fn type_ptr_ext(&self, address_space: AddressSpace) -> Self::Type;
3131
fn element_type(&self, ty: Self::Type) -> Self::Type;
3232

33-
/// Returns the number of elements in `self` if it is a LLVM vector type.
33+
/// Returns the number of elements in `self` if it is an LLVM vector type.
3434
fn vector_length(&self, ty: Self::Type) -> usize;
3535

3636
fn float_width(&self, ty: Self::Type) -> usize;

compiler/rustc_mir_build/src/build/expr/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
//! the most suitable spot to implement it, and then just let the
4545
//! other fns cycle around. The handoff works like this:
4646
//!
47-
//! - `into(place)` -> fallback is to create a rvalue with `as_rvalue` and assign it to `place`
47+
//! - `into(place)` -> fallback is to create an rvalue with `as_rvalue` and assign it to `place`
4848
//! - `as_rvalue` -> fallback is to create an Operand with `as_operand` and use `Rvalue::use`
4949
//! - `as_operand` -> either invokes `as_constant` or `as_temp`
5050
//! - `as_constant` -> (no fallback)

compiler/rustc_ty_utils/src/abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ fn fn_abi_adjust_for_abi<'tcx>(
528528
arg.make_indirect();
529529
} else {
530530
// We want to pass small aggregates as immediates, but using
531-
// a LLVM aggregate type for this leads to bad optimizations,
531+
// an LLVM aggregate type for this leads to bad optimizations,
532532
// so we pick an appropriately sized integer type instead.
533533
arg.cast_to(Reg { kind: RegKind::Integer, size });
534534
}

library/alloc/src/collections/btree/dedup_sorted_iter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use core::iter::Peekable;
22

3-
/// A iterator for deduping the key of a sorted iterator.
3+
/// An iterator for deduping the key of a sorted iterator.
44
/// When encountering the duplicated key, only the last key-value pair is yielded.
55
///
66
/// Used by [`BTreeMap::bulk_build_from_sorted_iter`][1].

src/doc/rustc/src/platform-support/mips-release-6.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The following procedure outlines the build process for the MIPS64 R6 target with
6767

6868
### Prerequisite: Disable debuginfo
6969

70-
A LLVM bug makes rustc crash if debug or debug info generation is enabled. You need to edit `config.toml` to disable this:
70+
An LLVM bug makes rustc crash if debug or debug info generation is enabled. You need to edit `config.toml` to disable this:
7171

7272
```toml
7373
[rust]

tests/ui/codegen/issue-79865-llvm-miscompile.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Regression test for issue #79865.
66
// The assertion will fail when compiled with Rust 1.56..=1.59
7-
// due to a LLVM miscompilation.
7+
// due to an LLVM miscompilation.
88

99
use std::arch::x86_64::*;
1010

tests/ui/consts/const-adt-align-mismatch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ enum Foo {
1212
}
1313

1414
// NOTE(eddyb) Don't make this a const, needs to be a static
15-
// so it is always instantiated as a LLVM constant value.
15+
// so it is always instantiated as an LLVM constant value.
1616
static FOO: Foo = Foo::C;
1717

1818
fn main() {

tests/ui/debuginfo/sroa-fragment-debuginfo.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Verify that we do not trigger a LLVM assertion by creating zero-sized DWARF fragments.
1+
// Verify that we do not trigger an LLVM assertion by creating zero-sized DWARF fragments.
22
//
33
// build-pass
44
// compile-flags: -g -Zmir-opt-level=0 -Zmir-enable-passes=+ScalarReplacementOfAggregates

0 commit comments

Comments
 (0)