Skip to content

Commit 2396fad

Browse files
committed
Fix more “a”/“an” typos
1 parent b08b92e commit 2396fad

File tree

18 files changed

+20
-20
lines changed

18 files changed

+20
-20
lines changed

compiler/rustc_infer/src/infer/nll_relate/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ where
307307
/// relations between `'0` and `'a`).
308308
///
309309
/// The variable `pair` can be either a `(vid, ty)` or `(ty, vid)`
310-
/// -- in other words, it is always a (unresolved) inference
310+
/// -- in other words, it is always an (unresolved) inference
311311
/// variable `vid` and a type `ty` that are being related, but the
312312
/// vid may appear either as the "a" type or the "b" type,
313313
/// depending on where it appears in the tuple. The trait

compiler/rustc_infer/src/infer/undo_log.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl Default for InferCtxtUndoLogs<'_> {
9696
}
9797

9898
/// The UndoLogs trait defines how we undo a particular kind of action (of type T). We can undo any
99-
/// action that is convertable into a UndoLog (per the From impls above).
99+
/// action that is convertable into an UndoLog (per the From impls above).
100100
impl<'tcx, T> UndoLogs<T> for InferCtxtUndoLogs<'tcx>
101101
where
102102
UndoLog<'tcx>: From<T>,

compiler/rustc_lexer/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ impl Cursor<'_> {
489489
// Start is already eaten, eat the rest of identifier.
490490
self.eat_while(is_id_continue);
491491
// Known prefixes must have been handled earlier. So if
492-
// we see a prefix here, it is definitely a unknown prefix.
492+
// we see a prefix here, it is definitely an unknown prefix.
493493
match self.first() {
494494
'#' | '"' | '\'' => UnknownPrefix,
495495
_ => Ident,

compiler/rustc_lint/src/nonstandard_style.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ fn to_camel_case(s: &str) -> String {
118118
})
119119
.fold((String::new(), None), |(acc, prev): (String, Option<String>), next| {
120120
// separate two components with an underscore if their boundary cannot
121-
// be distinguished using a uppercase/lowercase case distinction
121+
// be distinguished using an uppercase/lowercase case distinction
122122
let join = if let Some(prev) = prev {
123123
let l = prev.chars().last().unwrap();
124124
let f = next.chars().next().unwrap();

compiler/rustc_middle/src/query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ rustc_queries! {
648648
}
649649
}
650650

651-
/// HACK: when evaluated, this reports a "unsafe derive on repr(packed)" error.
651+
/// HACK: when evaluated, this reports an "unsafe derive on repr(packed)" error.
652652
///
653653
/// Unsafety checking is executed for each method separately, but we only want
654654
/// to emit this error once per derive. As there are some impls with multiple

compiler/rustc_middle/src/ty/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ impl<'tcx> ty::TyS<'tcx> {
681681
}
682682

683683
/// Checks whether values of this type `T` implement the `Freeze`
684-
/// trait -- frozen types are those that do not contain a
684+
/// trait -- frozen types are those that do not contain an
685685
/// `UnsafeCell` anywhere. This is a language concept used to
686686
/// distinguish "true immutability", which is relevant to
687687
/// optimization as well as the rules around static values. Note

compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
606606

607607
/// Checks if a borrowed value was captured by a trait object. We do this by
608608
/// looking forward in the MIR from the reserve location and checking if we see
609-
/// a unsized cast to a trait object on our data.
609+
/// an unsized cast to a trait object on our data.
610610
fn was_captured_by_trait_object(&self, borrow: &BorrowData<'tcx>) -> bool {
611611
// Start at the reserve location, find the place that we want to see cast to a trait object.
612612
let location = borrow.reserve_location;
@@ -666,7 +666,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
666666
}
667667
_ => {}
668668
},
669-
// If we see a unsized cast, then if it is our data we should check
669+
// If we see an unsized cast, then if it is our data we should check
670670
// whether it is being cast to a trait object.
671671
Rvalue::Cast(CastKind::Pointer(PointerCast::Unsize), operand, ty) => {
672672
match operand {

compiler/rustc_mir/src/borrow_check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2003,7 +2003,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
20032003
}
20042004

20052005
if let Some((prefix, mpi)) = shortest_uninit_seen {
2006-
// Check for a reassignment into a uninitialized field of a union (for example,
2006+
// Check for a reassignment into an uninitialized field of a union (for example,
20072007
// after a move out). In this case, do not report an error here. There is an
20082008
// exception, if this is the first assignment into the union (that is, there is
20092009
// no move out from an earlier location) then this is an attempt at initialization

compiler/rustc_mir/src/monomorphize/partitioning/default.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ fn mono_item_visibility(
455455
def_id
456456
} else {
457457
return if export_generics && is_generic {
458-
// If it is a upstream monomorphization and we export generics, we must make
458+
// If it is an upstream monomorphization and we export generics, we must make
459459
// it available to downstream crates.
460460
*can_be_internalized = false;
461461
default_visibility(tcx, def_id, true)

compiler/rustc_mir/src/transform/check_consts/ops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl NonConstOp for FnCallNonConst {
8686
}
8787
}
8888

89-
/// A call to a `#[unstable]` const fn or `#[rustc_const_unstable]` function.
89+
/// A call to an `#[unstable]` const fn or `#[rustc_const_unstable]` function.
9090
///
9191
/// Contains the name of the feature that would allow the use of this function.
9292
#[derive(Debug)]

compiler/rustc_mir_build/src/thir/pattern/usefulness.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ impl<'p, 'tcx> SubPatSet<'p, 'tcx> {
762762
for i in 0..*alt_count {
763763
let sub_set = subpats.get(&i).unwrap_or(&SubPatSet::Empty);
764764
if sub_set.is_empty() {
765-
// Found a unreachable subpattern.
765+
// Found an unreachable subpattern.
766766
spans.push(expanded[i].span);
767767
} else {
768768
fill_spans(sub_set, spans);

compiler/rustc_parse/src/parser/attr_wrapper.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ fn make_token_stream(
486486
if let AttrAnnotatedTokenTree::Token(last_token) = last_token {
487487
let unglued_first = last_token.kind.break_two_token_op().unwrap().0;
488488

489-
// A 'unglued' token is always two ASCII characters
489+
// An 'unglued' token is always two ASCII characters
490490
let mut first_span = last_token.span.shrink_to_lo();
491491
first_span = first_span.with_hi(first_span.lo() + rustc_span::BytePos(1));
492492

compiler/rustc_resolve/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3161,7 +3161,7 @@ impl<'a> Resolver<'a> {
31613161
}
31623162
}
31633163

3164-
/// This function adds a suggestion to remove a unnecessary binding from an import that is
3164+
/// This function adds a suggestion to remove an unnecessary binding from an import that is
31653165
/// nested. In the following example, this function will be invoked to remove the `a` binding
31663166
/// in the second use statement:
31673167
///

compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
743743
// possibly be referring to the current closure,
744744
// because we haven't produced the `Closure` for
745745
// this closure yet; this is exactly why the other
746-
// code is looking for a self type of a unresolved
746+
// code is looking for a self type of an unresolved
747747
// inference variable.
748748
ty::PredicateKind::ClosureKind(..) => None,
749749
ty::PredicateKind::TypeWellFormedFromEnv(..) => None,

library/core/src/char/methods.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ impl char {
958958
/// Returns an iterator that yields the uppercase mapping of this `char` as one or more
959959
/// `char`s.
960960
///
961-
/// If this `char` does not have a uppercase mapping, the iterator yields the same `char`.
961+
/// If this `char` does not have an uppercase mapping, the iterator yields the same `char`.
962962
///
963963
/// If this `char` has a one-to-one uppercase mapping given by the [Unicode Character
964964
/// Database][ucd] [`UnicodeData.txt`], the iterator yields that `char`.

src/test/ui/lint/lint-nonstandard-style-unicode-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct 对__否;
3030
struct ヒ__χ;
3131
//~^ ERROR type `ヒ__χ` should have an upper camel case name
3232

33-
// also cannot have lowercase letter next to a underscore.
33+
// also cannot have lowercase letter next to an underscore.
3434
// so this triggers the lint:
3535

3636
struct Hello_你好;

src/tools/clippy/clippy_lints/src/formatting.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ fn check_unop(cx: &EarlyContext<'_>, expr: &Expr) {
164164
if !differing_macro_contexts(lhs.span, rhs.span) && !lhs.span.from_expansion();
165165
// span between BinOp LHS and RHS
166166
let binop_span = lhs.span.between(rhs.span);
167-
// if RHS is a UnOp
167+
// if RHS is an UnOp
168168
if let ExprKind::Unary(op, ref un_rhs) = rhs.kind;
169169
// from UnOp operator to UnOp operand
170170
let unop_operand_span = rhs.span.until(un_rhs.span);

src/tools/clippy/clippy_lints/src/non_copy_const.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ fn is_unfrozen<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool {
122122
// Ignore types whose layout is unknown since `is_freeze` reports every generic types as `!Freeze`,
123123
// making it indistinguishable from `UnsafeCell`. i.e. it isn't a tool to prove a type is
124124
// 'unfrozen'. However, this code causes a false negative in which
125-
// a type contains a layout-unknown type, but also a unsafe cell like `const CELL: Cell<T>`.
125+
// a type contains a layout-unknown type, but also an unsafe cell like `const CELL: Cell<T>`.
126126
// Yet, it's better than `ty.has_type_flags(TypeFlags::HAS_TY_PARAM | TypeFlags::HAS_PROJECTION)`
127127
// since it works when a pointer indirection involves (`Cell<*const T>`).
128128
// Making up a `ParamEnv` where every generic params and assoc types are `Freeze`is another option;
@@ -266,7 +266,7 @@ impl<'tcx> LateLintPass<'tcx> for NonCopyConst {
266266
// in other words, lint consts whose value *could* be unfrozen, not definitely is.
267267
// This feels inconsistent with how the lint treats generic types,
268268
// which avoids linting types which potentially become unfrozen.
269-
// One could check whether a unfrozen type have a *frozen variant*
269+
// One could check whether an unfrozen type have a *frozen variant*
270270
// (like `body_id_opt.map_or_else(|| !has_frozen_variant(...), ...)`),
271271
// and do the same as the case of generic types at impl items.
272272
// Note that it isn't sufficient to check if it has an enum

0 commit comments

Comments
 (0)