Fix typos “a”→“an”
This commit is contained in:
parent
2ad56d5c90
commit
bf88b113ea
99 changed files with 157 additions and 157 deletions
|
@ -825,7 +825,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
// We're going to want to traverse the first borrowed place to see if we can find
|
||||
// field access to a union. If we find that, then we will keep the place of the
|
||||
// union being accessed and the field that was being accessed so we can check the
|
||||
// second borrowed place for the same union and a access to a different field.
|
||||
// second borrowed place for the same union and an access to a different field.
|
||||
for (place_base, elem) in first_borrowed_place.iter_projections().rev() {
|
||||
match elem {
|
||||
ProjectionElem::Field(field, _) if union_ty(place_base).is_some() => {
|
||||
|
@ -838,7 +838,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
})
|
||||
.and_then(|(target_base, target_field)| {
|
||||
// With the place of a union and a field access into it, we traverse the second
|
||||
// borrowed place and look for a access to a different field of the same union.
|
||||
// borrowed place and look for an access to a different field of the same union.
|
||||
for (place_base, elem) in second_borrowed_place.iter_projections().rev() {
|
||||
if let ProjectionElem::Field(field, _) = elem {
|
||||
if let Some(union_ty) = union_ty(place_base) {
|
||||
|
|
|
@ -72,7 +72,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
|||
|
||||
// If the place is immutable then:
|
||||
//
|
||||
// - Either we deref a immutable ref to get to our final place.
|
||||
// - Either we deref an immutable ref to get to our final place.
|
||||
// - We don't capture derefs of raw ptrs
|
||||
// - Or the final place is immut because the root variable of the capture
|
||||
// isn't marked mut and we should suggest that to the user.
|
||||
|
@ -601,7 +601,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
|||
let reason = if let PlaceBase::Upvar(upvar_id) = closure_kind_origin.base {
|
||||
let upvar = ty::place_to_string_for_capture(tcx, closure_kind_origin);
|
||||
let root_hir_id = upvar_id.var_path.hir_id;
|
||||
// we have a origin for this closure kind starting at this root variable so it's safe to unwrap here
|
||||
// we have an origin for this closure kind starting at this root variable so it's safe to unwrap here
|
||||
let captured_places = tables.closure_min_captures[id].get(&root_hir_id).unwrap();
|
||||
|
||||
let origin_projection = closure_kind_origin
|
||||
|
|
|
@ -423,7 +423,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
|||
diag
|
||||
}
|
||||
|
||||
/// Reports a error specifically for when data is escaping a closure.
|
||||
/// Reports an error specifically for when data is escaping a closure.
|
||||
///
|
||||
/// ```text
|
||||
/// error: borrowed data escapes outside of function
|
||||
|
@ -566,7 +566,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
|||
diag
|
||||
}
|
||||
|
||||
/// Adds a suggestion to errors where a `impl Trait` is returned.
|
||||
/// Adds a suggestion to errors where an `impl Trait` is returned.
|
||||
///
|
||||
/// ```text
|
||||
/// help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as
|
||||
|
|
|
@ -1241,7 +1241,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
// Special case: you can assign a immutable local variable
|
||||
// Special case: you can assign an immutable local variable
|
||||
// (e.g., `x = ...`) so long as it has never been initialized
|
||||
// before (at this point in the flow).
|
||||
if let Some(local) = place_span.0.as_local() {
|
||||
|
@ -1702,7 +1702,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
// initialization state of `a.b` is all we need to inspect to
|
||||
// know if `a.b.c` is valid (and from that we infer that the
|
||||
// dereference and `.d` access is also valid, since we assume
|
||||
// `a.b.c` is assigned a reference to a initialized and
|
||||
// `a.b.c` is assigned a reference to an initialized and
|
||||
// well-formed record structure.)
|
||||
|
||||
// Therefore, if we seek out the *closest* prefix for which we
|
||||
|
@ -2004,7 +2004,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,
|
||||
// after a move out). In this case, do not report a error here. There is an
|
||||
// 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
|
||||
// of the union - we should error in that case.
|
||||
|
|
|
@ -169,7 +169,7 @@ struct UniversalRegionIndices<'tcx> {
|
|||
/// used because trait matching and type-checking will feed us
|
||||
/// region constraints that reference those regions and we need to
|
||||
/// be able to map them our internal `RegionVid`. This is
|
||||
/// basically equivalent to a `InternalSubsts`, except that it also
|
||||
/// basically equivalent to an `InternalSubsts`, except that it also
|
||||
/// contains an entry for `ReStatic` -- it might be nice to just
|
||||
/// use a substs, and then handle `ReStatic` another way.
|
||||
indices: FxHashMap<ty::Region<'tcx>, RegionVid>,
|
||||
|
|
|
@ -295,7 +295,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
/// we can find the data.
|
||||
/// Note that for a given layout, this operation will either always fail or always
|
||||
/// succeed! Whether it succeeds depends on whether the layout can be represented
|
||||
/// in a `Immediate`, not on which data is stored there currently.
|
||||
/// in an `Immediate`, not on which data is stored there currently.
|
||||
pub(crate) fn try_read_immediate(
|
||||
&self,
|
||||
src: &OpTy<'tcx, M::PointerTag>,
|
||||
|
|
|
@ -100,7 +100,7 @@ impl CoverageCounters {
|
|||
CounterValueReference::from(next)
|
||||
}
|
||||
|
||||
/// Expression IDs start from u32::MAX and go down because a Expression can reference
|
||||
/// Expression IDs start from u32::MAX and go down because an Expression can reference
|
||||
/// (add or subtract counts) of both Counter regions and Expression regions. The counter
|
||||
/// expression operand IDs must be unique across both types.
|
||||
fn next_expression(&mut self) -> InjectedExpressionId {
|
||||
|
|
|
@ -334,7 +334,7 @@ impl<'a, 'tcx> Instrumentor<'a, 'tcx> {
|
|||
/// process (via `take_counter()`).
|
||||
///
|
||||
/// Any other counter associated with a `BasicCoverageBlock`, or its incoming edge, but not
|
||||
/// associated with a `CoverageSpan`, should only exist if the counter is a `Expression`
|
||||
/// associated with a `CoverageSpan`, should only exist if the counter is an `Expression`
|
||||
/// dependency (one of the expression operands). Collect them, and inject the additional
|
||||
/// counters into the MIR, without a reportable coverage span.
|
||||
fn inject_indirect_counters(
|
||||
|
|
|
@ -88,7 +88,7 @@ impl<'tcx> MirPass<'tcx> for SanityCheck {
|
|||
/// For each such call, determines what the dataflow bit-state is for
|
||||
/// the L-value corresponding to `expr`; if the bit-state is a 1, then
|
||||
/// that call to `rustc_peek` is ignored by the sanity check. If the
|
||||
/// bit-state is a 0, then this pass emits a error message saying
|
||||
/// bit-state is a 0, then this pass emits an error message saying
|
||||
/// "rustc_peek: bit not set".
|
||||
///
|
||||
/// The intention is that one can write unit tests for dataflow by
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue