Fix typos “a”→“an”
This commit is contained in:
parent
2ad56d5c90
commit
bf88b113ea
99 changed files with 157 additions and 157 deletions
|
@ -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)]
|
||||
|
|
|
@ -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`.
|
||||
|
|
|
@ -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>>);
|
||||
|
|
|
@ -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>,
|
||||
|
@ -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`
|
||||
///
|
||||
|
|
|
@ -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>),
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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<'_, '_>>();
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue