Fix more “a”/“an” typos

This commit is contained in:
Frank Steffahn 2021-08-22 17:27:18 +02:00
parent b08b92eb42
commit 2396fad095
18 changed files with 20 additions and 20 deletions
compiler
rustc_infer/src/infer
rustc_lexer/src
rustc_lint/src
rustc_middle/src
rustc_mir/src
borrow_check
monomorphize/partitioning
transform/check_consts
rustc_mir_build/src/thir/pattern
rustc_parse/src/parser
rustc_resolve/src
rustc_typeck/src/check/fn_ctxt
library/core/src/char
src

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

@ -96,7 +96,7 @@ impl Default for InferCtxtUndoLogs<'_> {
}
/// The UndoLogs trait defines how we undo a particular kind of action (of type T). We can undo any
/// action that is convertable into a UndoLog (per the From impls above).
/// action that is convertable into an UndoLog (per the From impls above).
impl<'tcx, T> UndoLogs<T> for InferCtxtUndoLogs<'tcx>
where
UndoLog<'tcx>: From<T>,

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

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

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

@ -681,7 +681,7 @@ impl<'tcx> ty::TyS<'tcx> {
}
/// Checks whether values of this type `T` implement the `Freeze`
/// trait -- frozen types are those that do not contain a
/// trait -- frozen types are those that do not contain an
/// `UnsafeCell` anywhere. This is a language concept used to
/// distinguish "true immutability", which is relevant to
/// optimization as well as the rules around static values. Note

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

@ -2003,7 +2003,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
}
if let Some((prefix, mpi)) = shortest_uninit_seen {
// Check for a reassignment into a uninitialized field of a union (for example,
// Check for a reassignment into an uninitialized field of a union (for example,
// after a move out). In this case, do not report an error here. There is an
// exception, if this is the first assignment into the union (that is, there is
// no move out from an earlier location) then this is an attempt at initialization

@ -455,7 +455,7 @@ fn mono_item_visibility(
def_id
} else {
return if export_generics && is_generic {
// If it is a upstream monomorphization and we export generics, we must make
// If it is an upstream monomorphization and we export generics, we must make
// it available to downstream crates.
*can_be_internalized = false;
default_visibility(tcx, def_id, true)

@ -86,7 +86,7 @@ impl NonConstOp for FnCallNonConst {
}
}
/// A call to a `#[unstable]` const fn or `#[rustc_const_unstable]` function.
/// A call to an `#[unstable]` const fn or `#[rustc_const_unstable]` function.
///
/// Contains the name of the feature that would allow the use of this function.
#[derive(Debug)]

@ -762,7 +762,7 @@ impl<'p, 'tcx> SubPatSet<'p, 'tcx> {
for i in 0..*alt_count {
let sub_set = subpats.get(&i).unwrap_or(&SubPatSet::Empty);
if sub_set.is_empty() {
// Found a unreachable subpattern.
// Found an unreachable subpattern.
spans.push(expanded[i].span);
} else {
fill_spans(sub_set, spans);

@ -486,7 +486,7 @@ fn make_token_stream(
if let AttrAnnotatedTokenTree::Token(last_token) = last_token {
let unglued_first = last_token.kind.break_two_token_op().unwrap().0;
// A 'unglued' token is always two ASCII characters
// An 'unglued' token is always two ASCII characters
let mut first_span = last_token.span.shrink_to_lo();
first_span = first_span.with_hi(first_span.lo() + rustc_span::BytePos(1));

@ -3161,7 +3161,7 @@ impl<'a> Resolver<'a> {
}
}
/// This function adds a suggestion to remove a unnecessary binding from an import that is
/// This function adds a suggestion to remove an unnecessary binding from an import that is
/// nested. In the following example, this function will be invoked to remove the `a` binding
/// in the second use statement:
///

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

@ -958,7 +958,7 @@ impl char {
/// Returns an iterator that yields the uppercase mapping of this `char` as one or more
/// `char`s.
///
/// If this `char` does not have a uppercase mapping, the iterator yields the same `char`.
/// If this `char` does not have an uppercase mapping, the iterator yields the same `char`.
///
/// If this `char` has a one-to-one uppercase mapping given by the [Unicode Character
/// Database][ucd] [`UnicodeData.txt`], the iterator yields that `char`.

@ -30,7 +30,7 @@ struct 对__否;
struct __χ;
//~^ ERROR type `ヒ__χ` should have an upper camel case name
// also cannot have lowercase letter next to a underscore.
// also cannot have lowercase letter next to an underscore.
// so this triggers the lint:
struct Hello_你好;

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

@ -122,7 +122,7 @@ fn is_unfrozen<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool {
// Ignore types whose layout is unknown since `is_freeze` reports every generic types as `!Freeze`,
// making it indistinguishable from `UnsafeCell`. i.e. it isn't a tool to prove a type is
// 'unfrozen'. However, this code causes a false negative in which
// a type contains a layout-unknown type, but also a unsafe cell like `const CELL: Cell<T>`.
// a type contains a layout-unknown type, but also an unsafe cell like `const CELL: Cell<T>`.
// Yet, it's better than `ty.has_type_flags(TypeFlags::HAS_TY_PARAM | TypeFlags::HAS_PROJECTION)`
// since it works when a pointer indirection involves (`Cell<*const T>`).
// 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 {
// in other words, lint consts whose value *could* be unfrozen, not definitely is.
// This feels inconsistent with how the lint treats generic types,
// which avoids linting types which potentially become unfrozen.
// One could check whether a unfrozen type have a *frozen variant*
// One could check whether an unfrozen type have a *frozen variant*
// (like `body_id_opt.map_or_else(|| !has_frozen_variant(...), ...)`),
// and do the same as the case of generic types at impl items.
// Note that it isn't sufficient to check if it has an enum