Skip to content

Commit

Permalink
Fix typos “a”→“an”
Browse files Browse the repository at this point in the history
  • Loading branch information
steffahn committed Aug 22, 2021
1 parent 2ad56d5 commit bf88b11
Show file tree
Hide file tree
Showing 99 changed files with 157 additions and 157 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ impl Token {
self.lifetime().is_some()
}

/// Returns `true` if the token is a identifier whose name is the given
/// Returns `true` if the token is an identifier whose name is the given
/// string slice.
pub fn is_ident_named(&self, name: Symbol) -> bool {
self.ident().map_or(false, |(ident, _)| ident.name == name)
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
ty,
);

// Construct a AnonConst where the expr is the "ty"'s path.
// Construct an AnonConst where the expr is the "ty"'s path.

let parent_def_id = self.current_hir_id_owner.0;
let node_id = self.resolver.next_node_id();
Expand Down Expand Up @@ -2690,7 +2690,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
}

/// Report an error on illegal use of `'_` or a `&T` with no explicit lifetime;
/// return a "error lifetime".
/// return an "error lifetime".
fn new_error_lifetime(&mut self, id: Option<NodeId>, span: Span) -> hir::Lifetime {
let (id, msg, label) = match id {
Some(id) => (id, "`'_` cannot be used here", "`'_` is a reserved lifetime name"),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/deriving/generic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,7 @@ where
/// One or more fields: call the base case function on the first value (which depends on
/// `use_fold`), and use that as the base case. Then perform `cs_fold` on the remainder of the
/// fields.
/// When the `substructure` is a `EnumNonMatchingCollapsed`, the result of `enum_nonmatch_f`
/// When the `substructure` is an `EnumNonMatchingCollapsed`, the result of `enum_nonmatch_f`
/// is returned. Statics may not be folded over.
/// See `cs_op` in `partial_ord.rs` for a model example.
pub fn cs_fold1<F, B>(
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
match scalar.value {
Primitive::Int(..) => {
if self.cx().size_of(ret_ty).bytes() < 4 {
// `va_arg` should not be called on a integer type
// `va_arg` should not be called on an integer type
// less than 4 bytes in length. If it is, promote
// the integer to a `i32` and truncate the result
// back to the smaller type.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/mir/rvalue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ fn cast_float_to_int<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
//
// Performance note: Unordered comparison can be lowered to a "flipped"
// comparison and a negation, and the negation can be merged into the
// select. Therefore, it not necessarily any more expensive than a
// select. Therefore, it not necessarily any more expensive than an
// ordered ("normal") comparison. Whether these optimizations will be
// performed is ultimately up to the backend, but at least x86 does
// perform them.
Expand Down
48 changes: 24 additions & 24 deletions compiler/rustc_data_structures/src/owning_ref/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ pub unsafe trait IntoErasedSendSync<'a> {
/////////////////////////////////////////////////////////////////////////////

impl<O, T: ?Sized> OwningRef<O, T> {
/// Creates a new owning reference from a owner
/// Creates a new owning reference from an owner
/// initialized to the direct dereference of it.
///
/// # Example
Expand Down Expand Up @@ -368,7 +368,7 @@ impl<O, T: ?Sized> OwningRef<O, T> {
/// fn main() {
/// let owning_ref = OwningRef::new(Box::new([1, 2, 3, 4]));
///
/// // create a owning reference that points at the
/// // create an owning reference that points at the
/// // third element of the array.
/// let owning_ref = owning_ref.map(|array| &array[2]);
/// assert_eq!(*owning_ref, 3);
Expand Down Expand Up @@ -396,7 +396,7 @@ impl<O, T: ?Sized> OwningRef<O, T> {
/// fn main() {
/// let owning_ref = OwningRef::new(Box::new([1, 2, 3, 4]));
///
/// // create a owning reference that points at the
/// // create an owning reference that points at the
/// // third element of the array.
/// let owning_ref = owning_ref.try_map(|array| {
/// if array[2] == 3 { Ok(&array[2]) } else { Err(()) }
Expand Down Expand Up @@ -430,7 +430,7 @@ impl<O, T: ?Sized> OwningRef<O, T> {
/// in an additional `Box<O>`.
///
/// This can be used to safely erase the owner of any `OwningRef<O, T>`
/// to a `OwningRef<Box<Erased>, T>`.
/// to an `OwningRef<Box<Erased>, T>`.
pub fn map_owner_box(self) -> OwningRef<Box<O>, T> {
OwningRef { reference: self.reference, owner: Box::new(self.owner) }
}
Expand Down Expand Up @@ -511,7 +511,7 @@ impl<O, T: ?Sized> OwningRef<O, T> {
}

impl<O, T: ?Sized> OwningRefMut<O, T> {
/// Creates a new owning reference from a owner
/// Creates a new owning reference from an owner
/// initialized to the direct dereference of it.
///
/// # Example
Expand Down Expand Up @@ -558,7 +558,7 @@ impl<O, T: ?Sized> OwningRefMut<O, T> {
/// fn main() {
/// let owning_ref_mut = OwningRefMut::new(Box::new([1, 2, 3, 4]));
///
/// // create a owning reference that points at the
/// // create an owning reference that points at the
/// // third element of the array.
/// let owning_ref = owning_ref_mut.map(|array| &array[2]);
/// assert_eq!(*owning_ref, 3);
Expand Down Expand Up @@ -586,7 +586,7 @@ impl<O, T: ?Sized> OwningRefMut<O, T> {
/// fn main() {
/// let owning_ref_mut = OwningRefMut::new(Box::new([1, 2, 3, 4]));
///
/// // create a owning reference that points at the
/// // create an owning reference that points at the
/// // third element of the array.
/// let owning_ref_mut = owning_ref_mut.map_mut(|array| &mut array[2]);
/// assert_eq!(*owning_ref_mut, 3);
Expand Down Expand Up @@ -614,7 +614,7 @@ impl<O, T: ?Sized> OwningRefMut<O, T> {
/// fn main() {
/// let owning_ref_mut = OwningRefMut::new(Box::new([1, 2, 3, 4]));
///
/// // create a owning reference that points at the
/// // create an owning reference that points at the
/// // third element of the array.
/// let owning_ref = owning_ref_mut.try_map(|array| {
/// if array[2] == 3 { Ok(&array[2]) } else { Err(()) }
Expand Down Expand Up @@ -644,7 +644,7 @@ impl<O, T: ?Sized> OwningRefMut<O, T> {
/// fn main() {
/// let owning_ref_mut = OwningRefMut::new(Box::new([1, 2, 3, 4]));
///
/// // create a owning reference that points at the
/// // create an owning reference that points at the
/// // third element of the array.
/// let owning_ref_mut = owning_ref_mut.try_map_mut(|array| {
/// if array[2] == 3 { Ok(&mut array[2]) } else { Err(()) }
Expand Down Expand Up @@ -678,7 +678,7 @@ impl<O, T: ?Sized> OwningRefMut<O, T> {
/// in an additional `Box<O>`.
///
/// This can be used to safely erase the owner of any `OwningRefMut<O, T>`
/// to a `OwningRefMut<Box<Erased>, T>`.
/// to an `OwningRefMut<Box<Erased>, T>`.
pub fn map_owner_box(self) -> OwningRefMut<Box<O>, T> {
OwningRefMut { reference: self.reference, owner: Box::new(self.owner) }
}
Expand Down Expand Up @@ -970,7 +970,7 @@ where
}
}

// ^ FIXME: Is a Into impl for calling into_inner() possible as well?
// ^ FIXME: Is an Into impl for calling into_inner() possible as well?

impl<O, T: ?Sized> Debug for OwningRef<O, T>
where
Expand Down Expand Up @@ -1139,27 +1139,27 @@ impl<T: 'static> ToHandleMut for RefCell<T> {
// about which handle creation to use (i.e., read() vs try_read()) as well as
// what to do with error results.

/// Typedef of a owning reference that uses a `Box` as the owner.
/// Typedef of an owning reference that uses a `Box` as the owner.
pub type BoxRef<T, U = T> = OwningRef<Box<T>, U>;
/// Typedef of a owning reference that uses a `Vec` as the owner.
/// Typedef of an owning reference that uses a `Vec` as the owner.
pub type VecRef<T, U = T> = OwningRef<Vec<T>, U>;
/// Typedef of a owning reference that uses a `String` as the owner.
/// Typedef of an owning reference that uses a `String` as the owner.
pub type StringRef = OwningRef<String, str>;

/// Typedef of a owning reference that uses a `Rc` as the owner.
/// Typedef of an owning reference that uses a `Rc` as the owner.
pub type RcRef<T, U = T> = OwningRef<Rc<T>, U>;
/// Typedef of a owning reference that uses a `Arc` as the owner.
/// Typedef of an owning reference that uses a `Arc` as the owner.
pub type ArcRef<T, U = T> = OwningRef<Arc<T>, U>;

/// Typedef of a owning reference that uses a `Ref` as the owner.
/// Typedef of an owning reference that uses a `Ref` as the owner.
pub type RefRef<'a, T, U = T> = OwningRef<Ref<'a, T>, U>;
/// Typedef of a owning reference that uses a `RefMut` as the owner.
/// Typedef of an owning reference that uses a `RefMut` as the owner.
pub type RefMutRef<'a, T, U = T> = OwningRef<RefMut<'a, T>, U>;
/// Typedef of a owning reference that uses a `MutexGuard` as the owner.
/// Typedef of an owning reference that uses a `MutexGuard` as the owner.
pub type MutexGuardRef<'a, T, U = T> = OwningRef<MutexGuard<'a, T>, U>;
/// Typedef of a owning reference that uses a `RwLockReadGuard` as the owner.
/// Typedef of an owning reference that uses a `RwLockReadGuard` as the owner.
pub type RwLockReadGuardRef<'a, T, U = T> = OwningRef<RwLockReadGuard<'a, T>, U>;
/// Typedef of a owning reference that uses a `RwLockWriteGuard` as the owner.
/// Typedef of an owning reference that uses a `RwLockWriteGuard` as the owner.
pub type RwLockWriteGuardRef<'a, T, U = T> = OwningRef<RwLockWriteGuard<'a, T>, U>;

/// Typedef of a mutable owning reference that uses a `Box` as the owner.
Expand Down Expand Up @@ -1219,11 +1219,11 @@ unsafe impl<'a, T: Send + Sync + 'a> IntoErasedSendSync<'a> for Arc<T> {
}
}

/// Typedef of a owning reference that uses an erased `Box` as the owner.
/// Typedef of an owning reference that uses an erased `Box` as the owner.
pub type ErasedBoxRef<U> = OwningRef<Box<dyn Erased>, U>;
/// Typedef of a owning reference that uses an erased `Rc` as the owner.
/// Typedef of an owning reference that uses an erased `Rc` as the owner.
pub type ErasedRcRef<U> = OwningRef<Rc<dyn Erased>, U>;
/// Typedef of a owning reference that uses an erased `Arc` as the owner.
/// Typedef of an owning reference that uses an erased `Arc` as the owner.
pub type ErasedArcRef<U> = OwningRef<Arc<dyn Erased>, U>;

/// Typedef of a mutable owning reference that uses an erased `Box` as the owner.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/profiling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl SelfProfilerRef {
VerboseTimingGuard::start(message, self.generic_activity(event_label))
}

/// Start profiling a extra verbose generic activity. Profiling continues until the
/// Start profiling an extra verbose generic activity. Profiling continues until the
/// VerboseTimingGuard returned from this call is dropped. In addition to recording
/// a measureme event, "extra verbose" generic activities also print a timing entry to
/// stdout if the compiler is invoked with -Ztime-passes.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//!
//! `MTRef` is an immutable reference if cfg!(parallel_compiler), and a mutable reference otherwise.
//!
//! `rustc_erase_owner!` erases a OwningRef owner into Erased or Erased + Send + Sync
//! `rustc_erase_owner!` erases an OwningRef owner into Erased or Erased + Send + Sync
//! depending on the value of cfg!(parallel_compiler).

use crate::owning_ref::{Erased, OwningRef};
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/tiny_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//!
//! - If you have a list that rarely stores more than one element, then this
//! data-structure can store the element without allocating and only uses as
//! much space as a `Option<(T, usize)>`. If T can double as the `Option`
//! much space as an `Option<(T, usize)>`. If T can double as the `Option`
//! discriminant, it will even only be as large as `T, usize`.
//!
//! If you expect to store more than 1 element in the common case, steer clear
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2323,7 +2323,7 @@ pub enum TyKind<'hir> {
///
/// Type parameters may be stored in each `PathSegment`.
Path(QPath<'hir>),
/// A opaque type definition itself. This is currently only used for the
/// An opaque type definition itself. This is currently only used for the
/// `opaque type Foo: Trait` item that `impl Trait` in desugars to.
///
/// The generic argument list contains the lifetimes (and in the future
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir/src/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ pub trait Visitor<'v>: Sized {
}

/// When invoking `visit_all_item_likes()`, you need to supply an
/// item-like visitor. This method converts a "intra-visit"
/// item-like visitor. This method converts an "intra-visit"
/// visitor into an item-like visitor that walks the entire tree.
/// If you use this, you probably don't want to process the
/// contents of nested item-like things, since the outer loop will
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
}

// In some (most?) cases cause.body_id points to actual body, but in some cases
// it's a actual definition. According to the comments (e.g. in
// it's an actual definition. According to the comments (e.g. in
// librustc_typeck/check/compare_method.rs:compare_predicate_entailment) the latter
// is relied upon by some other code. This might (or might not) need cleanup.
let body_owner_def_id =
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/infer/nll_relate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ where
}
}

/// When we instantiate a inference variable with a value in
/// When we instantiate an inference variable with a value in
/// `relate_ty_var`, we always have the pair of a `TyVid` and a `Ty`,
/// but the ordering may vary (depending on whether the inference
/// variable was found on the `a` or `b` sides). Therefore, this trait
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/infer/region_constraints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ pub enum GenericKind<'tcx> {
/// ('a: min) || ('b: min)
/// }
///
/// This is described with a `AnyRegion('a, 'b)` node.
/// This is described with an `AnyRegion('a, 'b)` node.
#[derive(Debug, Clone)]
pub enum VerifyBound<'tcx> {
/// Given a kind K and a bound B, expands to a function like the
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub use self::project::{
pub use rustc_middle::traits::*;

/// An `Obligation` represents some trait reference (e.g., `i32: Eq`) for
/// which the "impl_source" must be found. The process of finding a "impl_source" is
/// which the "impl_source" must be found. The process of finding an "impl_source" is
/// called "resolving" the `Obligation`. This process consists of
/// either identifying an `impl` (e.g., `impl Eq for i32`) that
/// satisfies the obligation, or else finding a bound that is in
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
ty::Projection(..) => {
let ty = self.cx.tcx.normalize_erasing_regions(self.cx.param_env, ty);

// If `ty` is a opaque type directly then `super_visit_with` won't invoke
// If `ty` is an opaque type directly then `super_visit_with` won't invoke
// this function again.
if ty.has_opaque_types() {
self.visit_ty(ty)
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_metadata/src/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ impl<'a> CrateLoader<'a> {
}

// Alright, so we've gotten this far which means that `data` has the
// right name, we don't have a hash, and we don't have a --extern
// right name, we don't have a hash, and we don't have an --extern
// pointing for ourselves. We're still not quite yet done because we
// have to make sure that this crate was found in the crate lookup
// path (this is a top-level dependency) as we don't want to
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/hir/map/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl MaybeFnLike for hir::Expr<'_> {
}
}

/// Carries either an FnLikeNode or a Expr, as these are the two
/// Carries either an FnLikeNode or an Expr, as these are the two
/// constructs that correspond to "code" (as in, something from which
/// we can construct a control-flow graph).
#[derive(Copy, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/middle/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ rustc_index::newtype_index! {
static_assert_size!(ScopeData, 4);

impl Scope {
/// Returns a item-local ID associated with this scope.
/// Returns an item-local ID associated with this scope.
///
/// N.B., likely to be replaced as API is refined; e.g., pnkfelix
/// anticipates `fn entry_node_id` and `fn each_exit_node_id`.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/mir/interpret/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static_assert_size!(InterpErrorInfo<'_>, 8);
/// Packages the kind of error we got from the const code interpreter
/// up with a Rust-level backtrace of where the error occurred.
/// These should always be constructed by calling `.into()` on
/// a `InterpError`. In `rustc_mir::interpret`, we have `throw_err_*`
/// an `InterpError`. In `rustc_mir::interpret`, we have `throw_err_*`
/// macros for this.
#[derive(Debug)]
pub struct InterpErrorInfo<'tcx>(Box<InterpErrorInfoInner<'tcx>>);
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/mir/interpret/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use super::{
/// Represents the result of const evaluation via the `eval_to_allocation` query.
#[derive(Copy, Clone, HashStable, TyEncodable, TyDecodable, Debug, Hash, Eq, PartialEq)]
pub struct ConstAlloc<'tcx> {
// the value lives here, at offset 0, and that allocation definitely is a `AllocKind::Memory`
// the value lives here, at offset 0, and that allocation definitely is an `AllocKind::Memory`
// (so you can use `AllocMap::unwrap_memory`).
pub alloc_id: AllocId,
pub ty: Ty<'tcx>,
Expand Down Expand Up @@ -113,7 +113,7 @@ impl<'tcx> ConstValue<'tcx> {
}

/// A `Scalar` represents an immediate, primitive value existing outside of a
/// `memory::Allocation`. It is in many ways like a small chunk of a `Allocation`, up to 16 bytes in
/// `memory::Allocation`. It is in many ways like a small chunk of an `Allocation`, up to 16 bytes in
/// size. Like a range of bytes in an `Allocation`, a `Scalar` can either represent the raw bytes
/// of a simple value or a pointer into another `Allocation`
///
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ pub enum ImplSource<'tcx, N> {
TraitUpcasting(ImplSourceTraitUpcastingData<'tcx, N>),

/// ImplSource automatically generated for a closure. The `DefId` is the ID
/// of the closure expression. This is a `ImplSource::UserDefined` in spirit, but the
/// of the closure expression. This is an `ImplSource::UserDefined` in spirit, but the
/// impl is generated by the compiler and does not appear in the source.
Closure(ImplSourceClosureData<'tcx, N>),

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/traits/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub enum SelectionCandidate<'tcx> {
ProjectionCandidate(usize),

/// Implementation of a `Fn`-family trait by one of the anonymous types
/// generated for a `||` expression.
/// generated for an `||` expression.
ClosureCandidate,

/// Implementation of a `Generator` trait by one of the anonymous types
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/adt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ impl<'tcx> AdtDef {
self.flags.contains(AdtFlags::IS_UNION)
}

/// Returns `true` if this is a enum.
/// Returns `true` if this is an enum.
#[inline]
pub fn is_enum(&self) -> bool {
self.flags.contains(AdtFlags::IS_ENUM)
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1792,7 +1792,7 @@ pub mod tls {
if context == 0 {
f(None)
} else {
// We could get a `ImplicitCtxt` pointer from another thread.
// We could get an `ImplicitCtxt` pointer from another thread.
// Ensure that `ImplicitCtxt` is `Sync`.
sync::assert_sync::<ImplicitCtxt<'_, '_>>();

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/inhabitedness/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::ty::{DefId, SubstsRef};

mod def_id_forest;

// The methods in this module calculate `DefIdForest`s of modules in which a
// The methods in this module calculate `DefIdForest`s of modules in which an
// `AdtDef`/`VariantDef`/`FieldDef` is visibly uninhabited.
//
// # Example
Expand Down
Loading

0 comments on commit bf88b11

Please sign in to comment.