Skip to content

Commit b3c0bde

Browse files
Fix some var names
1 parent bccde89 commit b3c0bde

File tree

13 files changed

+34
-34
lines changed

13 files changed

+34
-34
lines changed

compiler/rustc_borrowck/src/diagnostics/region_name.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,8 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
606606
hir_args: &'hir hir::GenericArgs<'hir>,
607607
search_stack: &mut Vec<(Ty<'tcx>, &'hir hir::Ty<'hir>)>,
608608
) -> Option<&'hir hir::Lifetime> {
609-
for (kind, hir_arg) in iter::zip(args, hir_args.args) {
610-
match (kind.kind(), hir_arg) {
609+
for (arg, hir_arg) in iter::zip(args, hir_args.args) {
610+
match (arg.kind(), hir_arg) {
611611
(GenericArgKind::Lifetime(r), hir::GenericArg::Lifetime(lt)) => {
612612
if r.as_var() == needle_fr {
613613
return Some(lt);
@@ -631,7 +631,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
631631
) => {
632632
self.dcx().span_delayed_bug(
633633
hir_arg.span(),
634-
format!("unmatched arg and hir arg: found {kind:?} vs {hir_arg:?}"),
634+
format!("unmatched arg and hir arg: found {arg:?} vs {hir_arg:?}"),
635635
);
636636
}
637637
}

compiler/rustc_hir_analysis/src/outlives/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ fn inferred_outlives_crate(tcx: TyCtxt<'_>, (): ()) -> CratePredicatesMap<'_> {
6969
.map(|(&def_id, set)| {
7070
let predicates =
7171
&*tcx.arena.alloc_from_iter(set.as_ref().skip_binder().iter().filter_map(
72-
|(ty::OutlivesPredicate(kind1, region2), &span)| {
73-
match kind1.kind() {
72+
|(ty::OutlivesPredicate(arg1, region2), &span)| {
73+
match arg1.kind() {
7474
GenericArgKind::Type(ty1) => Some((
7575
ty::ClauseKind::TypeOutlives(ty::OutlivesPredicate(ty1, *region2))
7676
.upcast(tcx),

compiler/rustc_hir_analysis/src/outlives/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub(crate) type RequiredPredicates<'tcx> =
1414
/// outlives_component and add it to `required_predicates`
1515
pub(crate) fn insert_outlives_predicate<'tcx>(
1616
tcx: TyCtxt<'tcx>,
17-
kind: GenericArg<'tcx>,
17+
arg: GenericArg<'tcx>,
1818
outlived_region: Region<'tcx>,
1919
span: Span,
2020
required_predicates: &mut RequiredPredicates<'tcx>,
@@ -25,7 +25,7 @@ pub(crate) fn insert_outlives_predicate<'tcx>(
2525
return;
2626
}
2727

28-
match kind.kind() {
28+
match arg.kind() {
2929
GenericArgKind::Type(ty) => {
3030
// `T: 'outlived_region` for some type `T`
3131
// But T could be a lot of things:
@@ -135,7 +135,7 @@ pub(crate) fn insert_outlives_predicate<'tcx>(
135135
if !is_free_region(r) {
136136
return;
137137
}
138-
required_predicates.entry(ty::OutlivesPredicate(kind, outlived_region)).or_insert(span);
138+
required_predicates.entry(ty::OutlivesPredicate(arg, outlived_region)).or_insert(span);
139139
}
140140

141141
GenericArgKind::Const(_) => {

compiler/rustc_hir_analysis/src/variance/constraints.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
200200
// Trait are always invariant so we can take advantage of that.
201201
let variance_i = self.invariant(variance);
202202

203-
for k in args {
204-
match k.kind() {
203+
for arg in args {
204+
match arg.kind() {
205205
GenericArgKind::Lifetime(lt) => {
206206
self.add_constraints_from_region(current, lt, variance_i)
207207
}
@@ -373,7 +373,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
373373
(None, Some(self.tcx().variances_of(def_id)))
374374
};
375375

376-
for (i, k) in args.iter().enumerate() {
376+
for (i, arg) in args.iter().enumerate() {
377377
let variance_decl = if let Some(InferredIndex(start)) = local {
378378
// Parameter on an item defined within current crate:
379379
// variance not yet inferred, so return a symbolic
@@ -389,7 +389,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
389389
"add_constraints_from_args: variance_decl={:?} variance_i={:?}",
390390
variance_decl, variance_i
391391
);
392-
match k.kind() {
392+
match arg.kind() {
393393
GenericArgKind::Lifetime(lt) => {
394394
self.add_constraints_from_region(current, lt, variance_i)
395395
}

compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,23 +357,23 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
357357
&self,
358358
error: &mut traits::FulfillmentError<'tcx>,
359359
def_id: DefId,
360-
param: ty::GenericArg<'tcx>,
360+
arg: ty::GenericArg<'tcx>,
361361
qpath: &hir::QPath<'tcx>,
362362
) -> bool {
363363
match qpath {
364364
hir::QPath::Resolved(self_ty, path) => {
365365
for segment in path.segments.iter().rev() {
366366
if let Res::Def(kind, def_id) = segment.res
367367
&& !matches!(kind, DefKind::Mod | DefKind::ForeignMod)
368-
&& self.point_at_generic_if_possible(error, def_id, param, segment)
368+
&& self.point_at_generic_if_possible(error, def_id, arg, segment)
369369
{
370370
return true;
371371
}
372372
}
373373
// Handle `Self` param specifically, since it's separated in
374374
// the path representation
375375
if let Some(self_ty) = self_ty
376-
&& let ty::GenericArgKind::Type(ty) = param.kind()
376+
&& let ty::GenericArgKind::Type(ty) = arg.kind()
377377
&& ty == self.tcx.types.self_param
378378
{
379379
error.obligation.cause.span = self_ty
@@ -384,12 +384,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
384384
}
385385
}
386386
hir::QPath::TypeRelative(self_ty, segment) => {
387-
if self.point_at_generic_if_possible(error, def_id, param, segment) {
387+
if self.point_at_generic_if_possible(error, def_id, arg, segment) {
388388
return true;
389389
}
390390
// Handle `Self` param specifically, since it's separated in
391391
// the path representation
392-
if let ty::GenericArgKind::Type(ty) = param.kind()
392+
if let ty::GenericArgKind::Type(ty) = arg.kind()
393393
&& ty == self.tcx.types.self_param
394394
{
395395
error.obligation.cause.span = self_ty

compiler/rustc_infer/src/infer/outlives/obligations.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,8 @@ where
466466
opt_variances: Option<&[ty::Variance]>,
467467
) {
468468
let constraint = origin.to_constraint_category();
469-
for (index, k) in args.iter().enumerate() {
470-
match k.kind() {
469+
for (index, arg) in args.iter().enumerate() {
470+
match arg.kind() {
471471
GenericArgKind::Lifetime(lt) => {
472472
let variance = if let Some(variances) = opt_variances {
473473
variances[index]

compiler/rustc_middle/src/ty/generic_args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ impl<'tcx> GenericArgs<'tcx> {
527527
/// Returns generic arguments that are not lifetimes.
528528
#[inline]
529529
pub fn non_erasable_generics(&self) -> impl DoubleEndedIterator<Item = GenericArgKind<'tcx>> {
530-
self.iter().filter_map(|k| match k.kind() {
530+
self.iter().filter_map(|arg| match arg.kind() {
531531
ty::GenericArgKind::Lifetime(_) => None,
532532
generic => Some(generic),
533533
})

compiler/rustc_middle/src/ty/opaque_types.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReverseMapper<'tcx> {
120120
}
121121
}
122122

123-
match self.map.get(&r.into()).map(|k| k.kind()) {
123+
match self.map.get(&r.into()).map(|arg| arg.kind()) {
124124
Some(GenericArgKind::Lifetime(r1)) => r1,
125125
Some(u) => panic!("region mapped to unexpected kind: {u:?}"),
126126
None if self.do_not_error => self.tcx.lifetimes.re_static,
@@ -162,7 +162,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReverseMapper<'tcx> {
162162

163163
ty::Param(param) => {
164164
// Look it up in the generic parameters list.
165-
match self.map.get(&ty.into()).map(|k| k.kind()) {
165+
match self.map.get(&ty.into()).map(|arg| arg.kind()) {
166166
// Found it in the generic parameters list; replace with the parameter from the
167167
// opaque type.
168168
Some(GenericArgKind::Type(t1)) => t1,
@@ -195,7 +195,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReverseMapper<'tcx> {
195195
match ct.kind() {
196196
ty::ConstKind::Param(..) => {
197197
// Look it up in the generic parameters list.
198-
match self.map.get(&ct.into()).map(|k| k.kind()) {
198+
match self.map.get(&ct.into()).map(|arg| arg.kind()) {
199199
// Found it in the generic parameters list, replace with the parameter from the
200200
// opaque type.
201201
Some(GenericArgKind::Const(c1)) => c1,

compiler/rustc_middle/src/ty/typeck_results.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,8 @@ impl<'tcx> IsIdentity for CanonicalUserType<'tcx> {
777777
return false;
778778
}
779779

780-
iter::zip(user_args.args, BoundVar::ZERO..).all(|(kind, cvar)| {
781-
match kind.kind() {
780+
iter::zip(user_args.args, BoundVar::ZERO..).all(|(arg, cvar)| {
781+
match arg.kind() {
782782
GenericArgKind::Type(ty) => match ty.kind() {
783783
ty::Bound(debruijn, b) => {
784784
// We only allow a `ty::INNERMOST` index in generic parameters.

compiler/rustc_middle/src/ty/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ impl<'tcx> TyCtxt<'tcx> {
516516
let item_args = ty::GenericArgs::identity_for_item(self, def.did());
517517

518518
let result = iter::zip(item_args, impl_args)
519-
.filter(|&(_, k)| {
520-
match k.kind() {
519+
.filter(|&(_, arg)| {
520+
match arg.kind() {
521521
GenericArgKind::Lifetime(region) => match region.kind() {
522522
ty::ReEarlyParam(ebr) => {
523523
!impl_generics.region_param(ebr, self).pure_wrt_drop

compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,8 +740,8 @@ where
740740

741741
/// Returns a ty infer or a const infer depending on whether `kind` is a `Ty` or `Const`.
742742
/// If `kind` is an integer inference variable this will still return a ty infer var.
743-
pub(super) fn next_term_infer_of_kind(&mut self, kind: I::Term) -> I::Term {
744-
match kind.kind() {
743+
pub(super) fn next_term_infer_of_kind(&mut self, term: I::Term) -> I::Term {
744+
match term.kind() {
745745
ty::TermKind::Ty(_) => self.next_ty_infer().into(),
746746
ty::TermKind::Const(_) => self.next_const_infer().into(),
747747
}

compiler/rustc_type_ir/src/binder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ impl<'a, I: Interner> TypeFolder<I> for ArgFolder<'a, I> {
676676
// the specialized routine `ty::replace_late_regions()`.
677677
match r.kind() {
678678
ty::ReEarlyParam(data) => {
679-
let rk = self.args.get(data.index() as usize).map(|k| k.kind());
679+
let rk = self.args.get(data.index() as usize).map(|arg| arg.kind());
680680
match rk {
681681
Some(ty::GenericArgKind::Lifetime(lt)) => self.shift_region_through_binders(lt),
682682
Some(other) => self.region_param_expected(data, r, other),
@@ -716,7 +716,7 @@ impl<'a, I: Interner> TypeFolder<I> for ArgFolder<'a, I> {
716716
impl<'a, I: Interner> ArgFolder<'a, I> {
717717
fn ty_for_param(&self, p: I::ParamTy, source_ty: I::Ty) -> I::Ty {
718718
// Look up the type in the args. It really should be in there.
719-
let opt_ty = self.args.get(p.index() as usize).map(|k| k.kind());
719+
let opt_ty = self.args.get(p.index() as usize).map(|arg| arg.kind());
720720
let ty = match opt_ty {
721721
Some(ty::GenericArgKind::Type(ty)) => ty,
722722
Some(kind) => self.type_param_expected(p, source_ty, kind),
@@ -753,7 +753,7 @@ impl<'a, I: Interner> ArgFolder<'a, I> {
753753

754754
fn const_for_param(&self, p: I::ParamConst, source_ct: I::Const) -> I::Const {
755755
// Look up the const in the args. It really should be in there.
756-
let opt_ct = self.args.get(p.index() as usize).map(|k| k.kind());
756+
let opt_ct = self.args.get(p.index() as usize).map(|arg| arg.kind());
757757
let ct = match opt_ct {
758758
Some(ty::GenericArgKind::Const(ct)) => ct,
759759
Some(kind) => self.const_param_expected(p, source_ct, kind),

compiler/rustc_type_ir/src/flags.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,8 @@ impl<I: Interner> FlagComputation<I> {
479479
}
480480

481481
fn add_args(&mut self, args: &[I::GenericArg]) {
482-
for kind in args {
483-
match kind.kind() {
482+
for arg in args {
483+
match arg.kind() {
484484
ty::GenericArgKind::Type(ty) => self.add_ty(ty),
485485
ty::GenericArgKind::Lifetime(lt) => self.add_region(lt),
486486
ty::GenericArgKind::Const(ct) => self.add_const(ct),

0 commit comments

Comments
 (0)