Fix typos “a”→“an”

This commit is contained in:
Frank Steffahn
2021-08-22 14:46:15 +02:00
parent 2ad56d5c90
commit bf88b113ea
99 changed files with 157 additions and 157 deletions

View File

@@ -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)

View File

@@ -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<'_, '_>>();

View File

@@ -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

View File

@@ -2571,14 +2571,14 @@ where
/// Compute a `FnAbi` suitable for indirect calls, i.e. to `fn` pointers.
///
/// NB: this doesn't handle virtual calls - those should use `FnAbi::of_instance`
/// instead, where the instance is a `InstanceDef::Virtual`.
/// instead, where the instance is an `InstanceDef::Virtual`.
fn of_fn_ptr(cx: &C, sig: ty::PolyFnSig<'tcx>, extra_args: &[Ty<'tcx>]) -> Self;
/// Compute a `FnAbi` suitable for declaring/defining an `fn` instance, and for
/// direct calls to an `fn`.
///
/// NB: that includes virtual calls, which are represented by "direct calls"
/// to a `InstanceDef::Virtual` instance (of `<dyn Trait as Trait>::fn`).
/// to an `InstanceDef::Virtual` instance (of `<dyn Trait as Trait>::fn`).
fn of_instance(cx: &C, instance: ty::Instance<'tcx>, extra_args: &[Ty<'tcx>]) -> Self;
fn new_internal(

View File

@@ -865,7 +865,7 @@ impl<'tcx> Predicate<'tcx> {
/// Represents the bounds declared on a particular set of type
/// parameters. Should eventually be generalized into a flag list of
/// where-clauses. You can obtain a `InstantiatedPredicates` list from a
/// where-clauses. You can obtain an `InstantiatedPredicates` list from a
/// `GenericPredicates` by using the `instantiate` method. Note that this method
/// reflects an important semantic invariant of `InstantiatedPredicates`: while
/// the `GenericPredicates` are expressed in terms of the bound type
@@ -1371,7 +1371,7 @@ bitflags! {
}
}
/// Definition of a variant -- a struct's fields or a enum variant.
/// Definition of a variant -- a struct's fields or an enum variant.
#[derive(Debug, HashStable)]
pub struct VariantDef {
/// `DefId` that identifies the variant itself.

View File

@@ -1323,7 +1323,7 @@ pub type Region<'tcx> = &'tcx RegionKind;
/// These are regions that are stored behind a binder and must be substituted
/// with some concrete region before being used. There are two kind of
/// bound regions: early-bound, which are bound in an item's `Generics`,
/// and are substituted by a `InternalSubsts`, and late-bound, which are part of
/// and are substituted by an `InternalSubsts`, and late-bound, which are part of
/// higher-ranked types (e.g., `for<'a> fn(&'a ())`), and are substituted by
/// the likes of `liberate_late_bound_regions`. The distinction exists
/// because higher-ranked lifetimes aren't supported in all places. See [1][2].
@@ -1471,7 +1471,7 @@ pub type PolyExistentialProjection<'tcx> = Binder<'tcx, ExistentialProjection<'t
impl<'tcx> ExistentialProjection<'tcx> {
/// Extracts the underlying existential trait reference from this projection.
/// For example, if this is a projection of `exists T. <T as Iterator>::Item == X`,
/// then this function would return a `exists T. T: Iterator` existential trait
/// then this function would return an `exists T. T: Iterator` existential trait
/// reference.
pub fn trait_ref(&self, tcx: TyCtxt<'tcx>) -> ty::ExistentialTraitRef<'tcx> {
let def_id = tcx.associated_item(self.item_def_id).container.id();

View File

@@ -22,7 +22,7 @@ use std::ops::ControlFlow;
/// An entity in the Rust type system, which can be one of
/// several kinds (types, lifetimes, and consts).
/// To reduce memory usage, a `GenericArg` is a interned pointer,
/// To reduce memory usage, a `GenericArg` is an interned pointer,
/// with the lowest 2 bits being reserved for a tag to
/// indicate the type (`Ty`, `Region`, or `Const`) it points to.
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
@@ -204,12 +204,12 @@ impl<'a, 'tcx> InternalSubsts<'tcx> {
GeneratorSubsts { substs: self }
}
/// Creates a `InternalSubsts` that maps each generic parameter to itself.
/// Creates an `InternalSubsts` that maps each generic parameter to itself.
pub fn identity_for_item(tcx: TyCtxt<'tcx>, def_id: DefId) -> SubstsRef<'tcx> {
Self::for_item(tcx, def_id, |param, _| tcx.mk_param_from_def(param))
}
/// Creates a `InternalSubsts` for generic parameter definitions,
/// Creates an `InternalSubsts` for generic parameter definitions,
/// by calling closures to obtain each kind.
/// The closures get to observe the `InternalSubsts` as they're
/// being built, which can be used to correctly