Skip to content

Commit aec8c9d

Browse files
authored
Unrolled build for #141495
Rollup merge of #141495 - compiler-errors:rename-unpack, r=fmease Rename `{GenericArg,Term}::unpack()` to `kind()` A well-deserved rename IMO. r? `@oli-obk` or `@lcnr` (or anyone) cc `@rust-lang/types,` but I'd be surprised if this is controversial.
2 parents c583fa6 + 5f3ae06 commit aec8c9d

File tree

83 files changed

+185
-185
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+185
-185
lines changed

compiler/rustc_borrowck/src/diagnostics/region_name.rs

Lines changed: 4 additions & 4 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.unpack(), 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
}
@@ -997,7 +997,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
997997
) -> bool {
998998
let tcx = self.infcx.tcx;
999999
ty.walk().any(|arg| {
1000-
if let ty::GenericArgKind::Type(ty) = arg.unpack()
1000+
if let ty::GenericArgKind::Type(ty) = arg.kind()
10011001
&& let ty::Param(_) = ty.kind()
10021002
{
10031003
clauses.iter().any(|pred| {

compiler/rustc_borrowck/src/type_check/constraint_conversion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
148148

149149
let mut next_outlives_predicates = vec![];
150150
for (ty::OutlivesPredicate(k1, r2), constraint_category) in outlives_predicates {
151-
match k1.unpack() {
151+
match k1.kind() {
152152
GenericArgKind::Lifetime(r1) => {
153153
let r1_vid = self.to_region_vid(r1);
154154
let r2_vid = self.to_region_vid(r2);

compiler/rustc_borrowck/src/type_check/opaque_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ fn register_member_constraints<'tcx>(
221221
.iter()
222222
.enumerate()
223223
.filter(|(i, _)| variances[*i] == ty::Invariant)
224-
.filter_map(|(_, arg)| match arg.unpack() {
224+
.filter_map(|(_, arg)| match arg.kind() {
225225
GenericArgKind::Lifetime(r) => Some(typeck.to_region_vid(r)),
226226
GenericArgKind::Type(_) | GenericArgKind::Const(_) => None,
227227
})

compiler/rustc_codegen_ssa/src/meth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn dyn_trait_in_self<'tcx>(
7777
ty: Ty<'tcx>,
7878
) -> Option<ty::ExistentialTraitRef<'tcx>> {
7979
for arg in ty.peel_refs().walk() {
80-
if let GenericArgKind::Type(ty) = arg.unpack()
80+
if let GenericArgKind::Type(ty) = arg.kind()
8181
&& let ty::Dynamic(data, _, _) = ty.kind()
8282
{
8383
// FIXME(arbitrary_self_types): This is likely broken for receivers which

compiler/rustc_const_eval/src/check_consts/ops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ fn build_error_for_const_call<'tcx>(
281281
let mut sugg = None;
282282

283283
if ccx.tcx.is_lang_item(trait_id, LangItem::PartialEq) {
284-
match (args[0].unpack(), args[1].unpack()) {
284+
match (args[0].kind(), args[1].kind()) {
285285
(GenericArgKind::Type(self_ty), GenericArgKind::Type(rhs_ty))
286286
if self_ty == rhs_ty
287287
&& self_ty.is_ref()

compiler/rustc_const_eval/src/util/type_name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl<'tcx> Printer<'tcx> for AbsolutePathPrinter<'tcx> {
125125
) -> Result<(), PrintError> {
126126
print_prefix(self)?;
127127
let args =
128-
args.iter().cloned().filter(|arg| !matches!(arg.unpack(), GenericArgKind::Lifetime(_)));
128+
args.iter().cloned().filter(|arg| !matches!(arg.kind(), GenericArgKind::Lifetime(_)));
129129
if args.clone().next().is_some() {
130130
self.generic_delimiters(|cx| cx.comma_sep(args))
131131
} else {

compiler/rustc_hir_analysis/src/check/check.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ fn check_type_alias_type_params_are_used<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalD
15751575

15761576
let mut params_used = DenseBitSet::new_empty(generics.own_params.len());
15771577
for leaf in ty.walk() {
1578-
if let GenericArgKind::Type(leaf_ty) = leaf.unpack()
1578+
if let GenericArgKind::Type(leaf_ty) = leaf.kind()
15791579
&& let ty::Param(param) = leaf_ty.kind()
15801580
{
15811581
debug!("found use of ty param {:?}", param);
@@ -1700,7 +1700,7 @@ fn opaque_type_cycle_error(tcx: TyCtxt<'_>, opaque_def_id: LocalDefId) -> ErrorG
17001700

17011701
let mut label_match = |ty: Ty<'_>, span| {
17021702
for arg in ty.walk() {
1703-
if let ty::GenericArgKind::Type(ty) = arg.unpack()
1703+
if let ty::GenericArgKind::Type(ty) = arg.kind()
17041704
&& let ty::Alias(
17051705
ty::Opaque,
17061706
ty::AliasTy { def_id: captured_def_id, .. },

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ fn check_region_late_boundedness<'tcx>(
12311231
for (id_arg, arg) in
12321232
std::iter::zip(ty::GenericArgs::identity_for_item(tcx, impl_m.def_id), impl_m_args)
12331233
{
1234-
if let ty::GenericArgKind::Lifetime(r) = arg.unpack()
1234+
if let ty::GenericArgKind::Lifetime(r) = arg.kind()
12351235
&& let ty::ReVar(vid) = r.kind()
12361236
&& let r = infcx
12371237
.inner
@@ -1256,7 +1256,7 @@ fn check_region_late_boundedness<'tcx>(
12561256
for (id_arg, arg) in
12571257
std::iter::zip(ty::GenericArgs::identity_for_item(tcx, trait_m.def_id), trait_m_args)
12581258
{
1259-
if let ty::GenericArgKind::Lifetime(r) = arg.unpack()
1259+
if let ty::GenericArgKind::Lifetime(r) = arg.kind()
12601260
&& let ty::ReVar(vid) = r.kind()
12611261
&& let r = infcx
12621262
.inner

compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ fn report_mismatched_rpitit_captures<'tcx>(
427427
};
428428

429429
trait_captured_args
430-
.sort_by_cached_key(|arg| !matches!(arg.unpack(), ty::GenericArgKind::Lifetime(_)));
430+
.sort_by_cached_key(|arg| !matches!(arg.kind(), ty::GenericArgKind::Lifetime(_)));
431431
let suggestion = format!("use<{}>", trait_captured_args.iter().join(", "));
432432

433433
tcx.emit_node_span_lint(

compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for GATArgsCollector<'tcx> {
819819
match t.kind() {
820820
ty::Alias(ty::Projection, p) if p.def_id == self.gat => {
821821
for (idx, arg) in p.args.iter().enumerate() {
822-
match arg.unpack() {
822+
match arg.kind() {
823823
GenericArgKind::Lifetime(lt) if !lt.is_bound() => {
824824
self.regions.insert((lt, idx));
825825
}
@@ -1517,7 +1517,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
15171517
} else {
15181518
// If we've got a generic const parameter we still want to check its
15191519
// type is correct in case both it and the param type are fully concrete.
1520-
let GenericArgKind::Const(ct) = default.unpack() else {
1520+
let GenericArgKind::Const(ct) = default.kind() else {
15211521
continue;
15221522
};
15231523

compiler/rustc_hir_analysis/src/collect/item_bounds.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ fn remap_gat_vars_and_recurse_into_nested_projections<'tcx>(
151151
let mut mapping = FxIndexMap::default();
152152
let generics = tcx.generics_of(assoc_item_def_id);
153153
for (param, var) in std::iter::zip(&generics.own_params, gat_vars) {
154-
let existing = match var.unpack() {
154+
let existing = match var.kind() {
155155
ty::GenericArgKind::Lifetime(re) => {
156156
if let ty::RegionKind::ReBound(ty::INNERMOST, bv) = re.kind() {
157157
mapping.insert(bv.var, tcx.mk_param_from_def(param))

compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
215215
let pred = bound_predicate.rebind(pred);
216216
// A `Self` within the original bound will be instantiated with a
217217
// `trait_object_dummy_self`, so check for that.
218-
let references_self = match pred.skip_binder().term.unpack() {
218+
let references_self = match pred.skip_binder().term.kind() {
219219
ty::TermKind::Ty(ty) => ty.walk().any(|arg| arg == dummy_self.into()),
220220
// FIXME(associated_const_equality): We should walk the const instead of not doing anything
221221
ty::TermKind::Const(_) => false,

compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
611611
if !infer_args && has_default {
612612
// No type parameter provided, but a default exists.
613613
if let Some(prev) =
614-
preceding_args.iter().find_map(|arg| match arg.unpack() {
614+
preceding_args.iter().find_map(|arg| match arg.kind() {
615615
GenericArgKind::Type(ty) => ty.error_reported().err(),
616616
_ => None,
617617
})

compiler/rustc_hir_analysis/src/outlives/implicit_infer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ fn insert_required_predicates_to_be_wf<'tcx>(
119119
explicit_map: &mut ExplicitPredicatesMap<'tcx>,
120120
) {
121121
for arg in ty.walk() {
122-
let leaf_ty = match arg.unpack() {
122+
let leaf_ty = match arg.kind() {
123123
GenericArgKind::Type(ty) => ty,
124124

125125
// No predicates from lifetimes or constants, except potentially
@@ -299,7 +299,7 @@ fn check_explicit_predicates<'tcx>(
299299
// binding) and thus infer an outlives requirement that `X:
300300
// 'b`.
301301
if let Some(self_ty) = ignored_self_ty
302-
&& let GenericArgKind::Type(ty) = outlives_predicate.0.unpack()
302+
&& let GenericArgKind::Type(ty) = outlives_predicate.0.kind()
303303
&& ty.walk().any(|arg| arg == self_ty.into())
304304
{
305305
debug!("skipping self ty = {ty:?}");

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.unpack() {
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.unpack() {
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: 5 additions & 5 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.unpack() {
203+
for arg in args {
204+
match arg.kind() {
205205
GenericArgKind::Lifetime(lt) => {
206206
self.add_constraints_from_region(current, lt, variance_i)
207207
}
@@ -294,7 +294,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
294294
}
295295

296296
for projection in data.projection_bounds() {
297-
match projection.skip_binder().term.unpack() {
297+
match projection.skip_binder().term.kind() {
298298
ty::TermKind::Ty(ty) => {
299299
self.add_constraints_from_ty(current, ty, self.invariant);
300300
}
@@ -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.unpack() {
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: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
8080
let find_param_matching = |matches: &dyn Fn(ty::ParamTerm) -> bool| {
8181
predicate_args.iter().find_map(|arg| {
8282
arg.walk().find_map(|arg| {
83-
if let ty::GenericArgKind::Type(ty) = arg.unpack()
83+
if let ty::GenericArgKind::Type(ty) = arg.kind()
8484
&& let ty::Param(param_ty) = *ty.kind()
8585
&& matches(ty::ParamTerm::Ty(param_ty))
8686
{
8787
Some(arg)
88-
} else if let ty::GenericArgKind::Const(ct) = arg.unpack()
88+
} else if let ty::GenericArgKind::Const(ct) = arg.kind()
8989
&& let ty::ConstKind::Param(param_ct) = ct.kind()
9090
&& matches(ty::ParamTerm::Const(param_ct))
9191
{
@@ -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.unpack()
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.unpack()
392+
if let ty::GenericArgKind::Type(ty) = arg.kind()
393393
&& ty == self.tcx.types.self_param
394394
{
395395
error.obligation.cause.span = self_ty
@@ -424,10 +424,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
424424
// the args list does not, then we should chop off all of the lifetimes,
425425
// since they're all elided.
426426
let segment_args = segment.args().args;
427-
if matches!(own_args[0].unpack(), ty::GenericArgKind::Lifetime(_))
427+
if matches!(own_args[0].kind(), ty::GenericArgKind::Lifetime(_))
428428
&& segment_args.first().is_some_and(|arg| arg.is_ty_or_const())
429429
&& let Some(offset) = own_args.iter().position(|arg| {
430-
matches!(arg.unpack(), ty::GenericArgKind::Type(_) | ty::GenericArgKind::Const(_))
430+
matches!(arg.kind(), ty::GenericArgKind::Type(_) | ty::GenericArgKind::Const(_))
431431
})
432432
&& let Some(new_index) = index.checked_sub(offset)
433433
{
@@ -750,7 +750,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
750750
return Ok(expr);
751751
}
752752

753-
let ty::GenericArgKind::Type(in_ty) = in_ty.unpack() else {
753+
let ty::GenericArgKind::Type(in_ty) = in_ty.kind() else {
754754
return Err(expr);
755755
};
756756

@@ -1045,7 +1045,7 @@ fn find_param_in_ty<'tcx>(
10451045
if arg == param_to_point_at {
10461046
return true;
10471047
}
1048-
if let ty::GenericArgKind::Type(ty) = arg.unpack()
1048+
if let ty::GenericArgKind::Type(ty) = arg.kind()
10491049
&& let ty::Alias(ty::Projection | ty::Inherent, ..) = ty.kind()
10501050
{
10511051
// This logic may seem a bit strange, but typically when

compiler/rustc_hir_typeck/src/method/suggest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2226,7 +2226,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
22262226
let infer_args = self.tcx.mk_args_from_iter(args.into_iter().map(|arg| {
22272227
if !arg.is_suggestable(self.tcx, true) {
22282228
has_unsuggestable_args = true;
2229-
match arg.unpack() {
2229+
match arg.kind() {
22302230
GenericArgKind::Lifetime(_) => self
22312231
.next_region_var(RegionVariableOrigin::MiscVariable(DUMMY_SP))
22322232
.into(),
@@ -2843,7 +2843,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
28432843
let [first] = ***args else {
28442844
return;
28452845
};
2846-
let ty::GenericArgKind::Type(ty) = first.unpack() else {
2846+
let ty::GenericArgKind::Type(ty) = first.kind() else {
28472847
return;
28482848
};
28492849
let Ok(pick) = self.lookup_probe_for_diagnostic(

compiler/rustc_infer/src/infer/at.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ impl<'tcx> ToTrace<'tcx> for ty::GenericArg<'tcx> {
347347
fn to_trace(cause: &ObligationCause<'tcx>, a: Self, b: Self) -> TypeTrace<'tcx> {
348348
TypeTrace {
349349
cause: cause.clone(),
350-
values: match (a.unpack(), b.unpack()) {
350+
values: match (a.kind(), b.kind()) {
351351
(GenericArgKind::Lifetime(a), GenericArgKind::Lifetime(b)) => {
352352
ValuePairs::Regions(ExpectedFound::new(a, b))
353353
}

compiler/rustc_infer/src/infer/canonical/instantiate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ where
6161
value
6262
} else {
6363
let delegate = FnMutDelegate {
64-
regions: &mut |br: ty::BoundRegion| match var_values[br.var].unpack() {
64+
regions: &mut |br: ty::BoundRegion| match var_values[br.var].kind() {
6565
GenericArgKind::Lifetime(l) => l,
6666
r => bug!("{:?} is a region but value is {:?}", br, r),
6767
},
68-
types: &mut |bound_ty: ty::BoundTy| match var_values[bound_ty.var].unpack() {
68+
types: &mut |bound_ty: ty::BoundTy| match var_values[bound_ty.var].kind() {
6969
GenericArgKind::Type(ty) => ty,
7070
r => bug!("{:?} is a type but value is {:?}", bound_ty, r),
7171
},
72-
consts: &mut |bound_ct: ty::BoundVar| match var_values[bound_ct].unpack() {
72+
consts: &mut |bound_ct: ty::BoundVar| match var_values[bound_ct].kind() {
7373
GenericArgKind::Const(ct) => ct,
7474
c => bug!("{:?} is a const but value is {:?}", bound_ct, c),
7575
},

0 commit comments

Comments
 (0)