Rollup merge of #94960 - codehorseman:master, r=oli-obk
Fix many spelling mistakes Signed-off-by: codehorseman <cricis@yeah.net>
This commit is contained in:
commit
270a41c33e
59 changed files with 86 additions and 86 deletions
|
@ -26,7 +26,7 @@ pub(super) struct ItemLowerer<'a, 'lowering, 'hir> {
|
|||
}
|
||||
|
||||
/// When we have a ty alias we *may* have two where clauses. To give the best diagnostics, we set the span
|
||||
/// to the where clause that is prefered, if it exists. Otherwise, it sets the span to the other where
|
||||
/// to the where clause that is preferred, if it exists. Otherwise, it sets the span to the other where
|
||||
/// clause if it exists.
|
||||
fn add_ty_alias_where_clause(
|
||||
generics: &mut ast::Generics,
|
||||
|
|
|
@ -3695,7 +3695,7 @@ declare_lint! {
|
|||
/// ### Explanation
|
||||
///
|
||||
/// A duplicated attribute may erroneously originate from a copy-paste and the effect of it
|
||||
/// being duplicated may not be obvious or desireable.
|
||||
/// being duplicated may not be obvious or desirable.
|
||||
///
|
||||
/// For instance, doubling the `#[test]` attributes registers the test to be run twice with no
|
||||
/// change to its environment.
|
||||
|
|
|
@ -99,7 +99,7 @@ impl<T: HasDataLayout> PointerArithmetic for T {}
|
|||
/// mostly opaque; the `Machine` trait extends it with some more operations that also have access to
|
||||
/// some global state.
|
||||
/// We don't actually care about this `Debug` bound (we use `Provenance::fmt` to format the entire
|
||||
/// pointer), but `derive` adds some unecessary bounds.
|
||||
/// pointer), but `derive` adds some unnecessary bounds.
|
||||
pub trait Provenance: Copy + fmt::Debug {
|
||||
/// Says whether the `offset` field of `Pointer`s with this provenance is the actual physical address.
|
||||
/// If `true, ptr-to-int casts work by simply discarding the provenance.
|
||||
|
|
|
@ -337,7 +337,7 @@ rustc_query_append! { [define_callbacks!][<'tcx>] }
|
|||
mod sealed {
|
||||
use super::{DefId, LocalDefId};
|
||||
|
||||
/// An analogue of the `Into` trait that's intended only for query paramaters.
|
||||
/// An analogue of the `Into` trait that's intended only for query parameters.
|
||||
///
|
||||
/// This exists to allow queries to accept either `DefId` or `LocalDefId` while requiring that the
|
||||
/// user call `to_def_id` to convert between them everywhere else.
|
||||
|
|
|
@ -61,7 +61,7 @@ pub fn ty_slice_as_generic_args<'a, 'tcx>(ts: &'a [Ty<'tcx>]) -> &'a [GenericArg
|
|||
}
|
||||
|
||||
impl<'tcx> List<Ty<'tcx>> {
|
||||
/// Allows to freely switch betwen `List<Ty<'tcx>>` and `List<GenericArg<'tcx>>`.
|
||||
/// Allows to freely switch between `List<Ty<'tcx>>` and `List<GenericArg<'tcx>>`.
|
||||
///
|
||||
/// As lists are interned, `List<Ty<'tcx>>` and `List<GenericArg<'tcx>>` have
|
||||
/// be interned together, see `intern_type_list` for more details.
|
||||
|
|
|
@ -486,7 +486,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
}
|
||||
|
||||
/// Given the `DefId`, returns the `DefId` of the innermost item that
|
||||
/// has its own type-checking context or "inference enviornment".
|
||||
/// has its own type-checking context or "inference environment".
|
||||
///
|
||||
/// For example, a closure has its own `DefId`, but it is type-checked
|
||||
/// with the containing item. Similarly, an inline const block has its
|
||||
|
|
|
@ -527,7 +527,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
|
|||
ty::RawPtr(pointee) if pointee.ty.is_sized(tcx.at(span), param_env) => {
|
||||
PatKind::Constant { value: cv }
|
||||
}
|
||||
// FIXME: these can have very suprising behaviour where optimization levels or other
|
||||
// FIXME: these can have very surprising behaviour where optimization levels or other
|
||||
// compilation choices change the runtime behaviour of the match.
|
||||
// See https://github.com/rust-lang/rust/issues/70861 for examples.
|
||||
ty::FnPtr(..) | ty::RawPtr(..) => {
|
||||
|
|
|
@ -156,7 +156,7 @@ impl<'tcx> Visitor<'tcx> for UnsafetyChecker<'_, 'tcx> {
|
|||
// temporary holding the static pointer to avoid duplicate errors
|
||||
// <https://github.com/rust-lang/rust/pull/78068#issuecomment-731753506>.
|
||||
if decl.internal && place.projection.first() == Some(&ProjectionElem::Deref) {
|
||||
// If the projection root is an artifical local that we introduced when
|
||||
// If the projection root is an artificial local that we introduced when
|
||||
// desugaring `static`, give a more specific error message
|
||||
// (avoid the general "raw pointer" clause below, that would only be confusing).
|
||||
if let Some(box LocalInfo::StaticRef { def_id, .. }) = decl.local_info {
|
||||
|
|
|
@ -60,7 +60,7 @@ fn find_optimization_oportunities<'tcx>(body: &Body<'tcx>) -> Vec<(Local, Consta
|
|||
}
|
||||
}
|
||||
|
||||
let mut eligable_locals = Vec::new();
|
||||
let mut eligible_locals = Vec::new();
|
||||
for (local, mutating_uses) in visitor.local_mutating_uses.drain_enumerated(..) {
|
||||
if mutating_uses != 1 || !locals_to_debuginfo.contains(local) {
|
||||
continue;
|
||||
|
@ -78,13 +78,13 @@ fn find_optimization_oportunities<'tcx>(body: &Body<'tcx>) -> Vec<(Local, Consta
|
|||
&bb.statements[location.statement_index].kind
|
||||
{
|
||||
if let Some(local) = p.as_local() {
|
||||
eligable_locals.push((local, *c));
|
||||
eligible_locals.push((local, *c));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
eligable_locals
|
||||
eligible_locals
|
||||
}
|
||||
|
||||
impl Visitor<'_> for LocalUseVisitor {
|
||||
|
|
|
@ -359,7 +359,7 @@ fn verify_candidate_branch<'tcx>(
|
|||
if branch.statements.len() != 1 {
|
||||
return false;
|
||||
}
|
||||
// ...assign the descriminant of `place` in that statement
|
||||
// ...assign the discriminant of `place` in that statement
|
||||
let StatementKind::Assign(boxed) = &branch.statements[0].kind else {
|
||||
return false
|
||||
};
|
||||
|
|
|
@ -362,7 +362,7 @@ fn optimization_applies<'tcx>(
|
|||
return false;
|
||||
} else if last_assigned_to != opt_info.local_tmp_s1 {
|
||||
trace!(
|
||||
"NO: end of assignemnt chain does not match written enum temp: {:?} != {:?}",
|
||||
"NO: end of assignment chain does not match written enum temp: {:?} != {:?}",
|
||||
last_assigned_to,
|
||||
opt_info.local_tmp_s1
|
||||
);
|
||||
|
|
|
@ -1970,7 +1970,7 @@ impl<'a> Parser<'a> {
|
|||
// We use an over-approximation here.
|
||||
// `const const`, `fn const` won't parse, but we're not stepping over other syntax either.
|
||||
// `pub` is added in case users got confused with the ordering like `async pub fn`,
|
||||
// only if it wasn't preceeded by `default` as `default pub` is invalid.
|
||||
// only if it wasn't preceded by `default` as `default pub` is invalid.
|
||||
let quals: &[Symbol] = if check_pub {
|
||||
&[kw::Pub, kw::Const, kw::Async, kw::Unsafe, kw::Extern]
|
||||
} else {
|
||||
|
|
|
@ -2002,7 +2002,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
|
|||
if !matches!(opaque.origin, hir::OpaqueTyOrigin::AsyncFn(..)) {
|
||||
continue 'lifetimes;
|
||||
}
|
||||
// We want to do this only if the liftime identifier is already defined
|
||||
// We want to do this only if the lifetime identifier is already defined
|
||||
// in the async function that generated this. Otherwise it could be
|
||||
// an opaque type defined by the developer and we still want this
|
||||
// lint to fail compilation
|
||||
|
|
|
@ -223,7 +223,7 @@ top_level_options!(
|
|||
/// `true` if we're emitting a JSON blob containing the unused externs
|
||||
json_unused_externs: bool [UNTRACKED],
|
||||
|
||||
/// `true` if we're emitting a JSON job containg a future-incompat report for lints
|
||||
/// `true` if we're emitting a JSON job containing a future-incompat report for lints
|
||||
json_future_incompat: bool [TRACKED],
|
||||
|
||||
pretty: Option<PpMode> [UNTRACKED],
|
||||
|
|
|
@ -69,7 +69,7 @@ pub struct SymbolGallery {
|
|||
|
||||
impl SymbolGallery {
|
||||
/// Insert a symbol and its span into symbol gallery.
|
||||
/// If the symbol has occurred before, ignore the new occurrance.
|
||||
/// If the symbol has occurred before, ignore the new occurrence.
|
||||
pub fn insert(&self, symbol: Symbol, span: Span) {
|
||||
self.symbols.lock().entry(symbol).or_insert(span);
|
||||
}
|
||||
|
|
|
@ -29,14 +29,14 @@ pub enum NativeLibKind {
|
|||
/// Dynamic library (e.g. `libfoo.so` on Linux)
|
||||
/// or an import library corresponding to a dynamic library (e.g. `foo.lib` on Windows/MSVC).
|
||||
Dylib {
|
||||
/// Whether the dynamic library will be linked only if it satifies some undefined symbols
|
||||
/// Whether the dynamic library will be linked only if it satisfies some undefined symbols
|
||||
as_needed: Option<bool>,
|
||||
},
|
||||
/// Dynamic library (e.g. `foo.dll` on Windows) without a corresponding import library.
|
||||
RawDylib,
|
||||
/// A macOS-specific kind of dynamic libraries.
|
||||
Framework {
|
||||
/// Whether the framework will be linked only if it satifies some undefined symbols
|
||||
/// Whether the framework will be linked only if it satisfies some undefined symbols
|
||||
as_needed: Option<bool>,
|
||||
},
|
||||
/// The library kind wasn't specified, `Dylib` is currently used as a default.
|
||||
|
|
|
@ -226,7 +226,7 @@ fn compute_symbol_name<'tcx>(
|
|||
|
||||
// If we're dealing with an instance of a function that's inlined from
|
||||
// another crate but we're marking it as globally shared to our
|
||||
// compliation (aka we're not making an internal copy in each of our
|
||||
// compilation (aka we're not making an internal copy in each of our
|
||||
// codegen units) then this symbol may become an exported (but hidden
|
||||
// visibility) symbol. This means that multiple crates may do the same
|
||||
// and we want to be sure to avoid any symbol conflicts here.
|
||||
|
|
|
@ -1105,7 +1105,7 @@ impl Niche {
|
|||
|
||||
// Extend the range of valid values being reserved by moving either `v.start` or `v.end` bound.
|
||||
// Given an eventual `Option<T>`, we try to maximize the chance for `None` to occupy the niche of zero.
|
||||
// This is accomplished by prefering enums with 2 variants(`count==1`) and always taking the shortest path to niche zero.
|
||||
// This is accomplished by preferring enums with 2 variants(`count==1`) and always taking the shortest path to niche zero.
|
||||
// Having `None` in niche zero can enable some special optimizations.
|
||||
//
|
||||
// Bound selection criteria:
|
||||
|
|
|
@ -538,7 +538,7 @@ fn prepare_vtable_segments<'tcx, T>(
|
|||
|
||||
// the main traversal loop:
|
||||
// basically we want to cut the inheritance directed graph into a few non-overlapping slices of nodes
|
||||
// that each node is emited after all its descendents have been emitted.
|
||||
// that each node is emitted after all its descendents have been emitted.
|
||||
// so we convert the directed graph into a tree by skipping all previously visted nodes using a visited set.
|
||||
// this is done on the fly.
|
||||
// Each loop run emits a slice - it starts by find a "childless" unvisited node, backtracking upwards, and it
|
||||
|
@ -553,10 +553,10 @@ fn prepare_vtable_segments<'tcx, T>(
|
|||
// Starting point 0 stack [D]
|
||||
// Loop run #0: Stack after diving in is [D B A], A is "childless"
|
||||
// after this point, all newly visited nodes won't have a vtable that equals to a prefix of this one.
|
||||
// Loop run #0: Emiting the slice [B A] (in reverse order), B has a next-sibling node, so this slice stops here.
|
||||
// Loop run #0: Emitting the slice [B A] (in reverse order), B has a next-sibling node, so this slice stops here.
|
||||
// Loop run #0: Stack after exiting out is [D C], C is the next starting point.
|
||||
// Loop run #1: Stack after diving in is [D C], C is "childless", since its child A is skipped(already emitted).
|
||||
// Loop run #1: Emiting the slice [D C] (in reverse order). No one has a next-sibling node.
|
||||
// Loop run #1: Emitting the slice [D C] (in reverse order). No one has a next-sibling node.
|
||||
// Loop run #1: Stack after exiting out is []. Now the function exits.
|
||||
|
||||
loop {
|
||||
|
|
|
@ -719,7 +719,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
// TraitA+Kx+'a -> TraitB+Ky+'b (trait upcasting coercion).
|
||||
(&ty::Dynamic(ref data_a, r_a), &ty::Dynamic(ref data_b, r_b)) => {
|
||||
// See `assemble_candidates_for_unsizing` for more info.
|
||||
// We already checked the compatiblity of auto traits within `assemble_candidates_for_unsizing`.
|
||||
// We already checked the compatibility of auto traits within `assemble_candidates_for_unsizing`.
|
||||
let principal_a = data_a.principal().unwrap();
|
||||
source_trait_ref = principal_a.with_self_ty(tcx, source);
|
||||
upcast_trait_ref = util::supertraits(tcx, source_trait_ref).nth(idx).unwrap();
|
||||
|
@ -823,7 +823,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
// Trait+Kx+'a -> Trait+Ky+'b (auto traits and lifetime subtyping).
|
||||
(&ty::Dynamic(ref data_a, r_a), &ty::Dynamic(ref data_b, r_b)) => {
|
||||
// See `assemble_candidates_for_unsizing` for more info.
|
||||
// We already checked the compatiblity of auto traits within `assemble_candidates_for_unsizing`.
|
||||
// We already checked the compatibility of auto traits within `assemble_candidates_for_unsizing`.
|
||||
let iter = data_a
|
||||
.principal()
|
||||
.map(|b| b.map_bound(ty::ExistentialPredicate::Trait))
|
||||
|
@ -1084,7 +1084,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
| ty::Foreign(_) => {}
|
||||
|
||||
// These types are built-in, so we can fast-track by registering
|
||||
// nested predicates for their constituient type(s)
|
||||
// nested predicates for their constituent type(s)
|
||||
ty::Array(ty, _) | ty::Slice(ty) => {
|
||||
stack.push(ty);
|
||||
}
|
||||
|
|
|
@ -553,7 +553,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
match project::poly_project_and_unify_type(self, &project_obligation) {
|
||||
Ok(Ok(Some(mut subobligations))) => {
|
||||
'compute_res: {
|
||||
// If we've previously marked this projection as 'complete', thne
|
||||
// If we've previously marked this projection as 'complete', then
|
||||
// use the final cached result (either `EvaluatedToOk` or
|
||||
// `EvaluatedToOkModuloRegions`), and skip re-evaluating the
|
||||
// sub-obligations.
|
||||
|
|
|
@ -181,12 +181,12 @@ enum DtorType {
|
|||
/// "significant" / "insignificant".
|
||||
Insignificant,
|
||||
|
||||
/// Type has a `Drop` implentation.
|
||||
/// Type has a `Drop` implantation.
|
||||
Significant,
|
||||
}
|
||||
|
||||
// This is a helper function for `adt_drop_tys` and `adt_significant_drop_tys`.
|
||||
// Depending on the implentation of `adt_has_dtor`, it is used to check if the
|
||||
// Depending on the implantation of `adt_has_dtor`, it is used to check if the
|
||||
// ADT has a destructor or if the ADT only has a significant destructor. For
|
||||
// understanding significant destructor look at `adt_significant_drop_tys`.
|
||||
fn drop_tys_helper<'tcx>(
|
||||
|
@ -295,7 +295,7 @@ fn adt_drop_tys<'tcx>(
|
|||
.map(|components| tcx.intern_type_list(&components))
|
||||
}
|
||||
// If `def_id` refers to a generic ADT, the queries above and below act as if they had been handed
|
||||
// a `tcx.make_ty(def, identity_substs)` and as such it is legal to substitue the generic parameters
|
||||
// a `tcx.make_ty(def, identity_substs)` and as such it is legal to substitute the generic parameters
|
||||
// of the ADT into the outputted `ty`s.
|
||||
fn adt_significant_drop_tys(
|
||||
tcx: TyCtxt<'_>,
|
||||
|
|
|
@ -126,7 +126,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
|||
"the precise format of `Fn`-family traits' type parameters is subject to change",
|
||||
);
|
||||
// Do not suggest the other syntax if we are in trait impl:
|
||||
// the desugaring would contain an associated type constrait.
|
||||
// the desugaring would contain an associated type constraint.
|
||||
if !is_impl {
|
||||
let args = trait_segment
|
||||
.args
|
||||
|
|
|
@ -429,7 +429,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
|||
let param_counts = gen_params.own_counts();
|
||||
|
||||
// Subtracting from param count to ensure type params synthesized from `impl Trait`
|
||||
// cannot be explictly specified even with `explicit_generic_args_with_impl_trait`
|
||||
// cannot be explicitly specified even with `explicit_generic_args_with_impl_trait`
|
||||
// feature enabled.
|
||||
let synth_type_param_count = if tcx.features().explicit_generic_args_with_impl_trait {
|
||||
gen_params
|
||||
|
|
|
@ -486,11 +486,11 @@ pub struct SuspendCheckData<'a, 'tcx> {
|
|||
}
|
||||
|
||||
// Returns whether it emitted a diagnostic or not
|
||||
// Note that this fn and the proceding one are based on the code
|
||||
// Note that this fn and the proceeding one are based on the code
|
||||
// for creating must_use diagnostics
|
||||
//
|
||||
// Note that this technique was chosen over things like a `Suspend` marker trait
|
||||
// as it is simpler and has precendent in the compiler
|
||||
// as it is simpler and has precedent in the compiler
|
||||
pub fn check_must_not_suspend_ty<'tcx>(
|
||||
fcx: &FnCtxt<'_, 'tcx>,
|
||||
ty: Ty<'tcx>,
|
||||
|
|
|
@ -379,7 +379,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
}
|
||||
|
||||
/// Creates a string version of the `expr` that includes explicit adjustments.
|
||||
/// Returns the string and also a bool indicating whther this is a *precise*
|
||||
/// Returns the string and also a bool indicating whether this is a *precise*
|
||||
/// suggestion.
|
||||
fn adjust_expr(
|
||||
&self,
|
||||
|
|
|
@ -1371,7 +1371,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
// represents the case of the path being completely captured by the variable.
|
||||
//
|
||||
// eg. If `a.b` is captured and we are processing `a.b`, then we can't have the closure also
|
||||
// capture `a.b.c`, because that voilates min capture.
|
||||
// capture `a.b.c`, because that violates min capture.
|
||||
let is_completely_captured = captured_by_move_projs.iter().any(|projs| projs.is_empty());
|
||||
|
||||
assert!(!is_completely_captured || (captured_by_move_projs.len() == 1));
|
||||
|
@ -1411,7 +1411,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
ty::RawPtr(..) => unreachable!(),
|
||||
|
||||
ty::Adt(def, substs) => {
|
||||
// Multi-varaint enums are captured in entirety,
|
||||
// Multi-variant enums are captured in entirety,
|
||||
// which would've been handled in the case of single empty slice in `captured_by_move_projs`.
|
||||
assert_eq!(def.variants().len(), 1);
|
||||
|
||||
|
@ -2208,8 +2208,8 @@ fn determine_place_ancestry_relation<'tcx>(
|
|||
}
|
||||
}
|
||||
|
||||
/// Reduces the precision of the captured place when the precision doesn't yeild any benefit from
|
||||
/// borrow checking prespective, allowing us to save us on the size of the capture.
|
||||
/// Reduces the precision of the captured place when the precision doesn't yield any benefit from
|
||||
/// borrow checking perspective, allowing us to save us on the size of the capture.
|
||||
///
|
||||
///
|
||||
/// Fields that are read through a shared reference will always be read via a shared ref or a copy,
|
||||
|
|
|
@ -1469,7 +1469,7 @@ fn check_fn_or_method<'fcx, 'tcx>(
|
|||
},
|
||||
)
|
||||
}));
|
||||
// Manually call `normalize_assocaited_types_in` on the other types
|
||||
// Manually call `normalize_associated_types_in` on the other types
|
||||
// in `FnSig`. This ensures that if the types of these fields
|
||||
// ever change to include projections, we will start normalizing
|
||||
// them automatically.
|
||||
|
|
|
@ -323,7 +323,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
|
|||
.skip(self.params_offset + self.num_provided_type_or_const_args())
|
||||
.take(num_params_to_take)
|
||||
.map(|param| match param.kind {
|
||||
// This is being infered from the item's inputs, no need to set it.
|
||||
// This is being inferred from the item's inputs, no need to set it.
|
||||
ty::GenericParamDefKind::Type { .. } if is_used_in_input(param.def_id) => {
|
||||
"_".to_string()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue