Skip to content

Commit 1ae96b4

Browse files
Rename unpack to kind
1 parent 5af801b commit 1ae96b4

File tree

79 files changed

+164
-164
lines changed

Some content is hidden

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

79 files changed

+164
-164
lines changed

compiler/rustc_borrowck/src/diagnostics/region_name.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
607607
search_stack: &mut Vec<(Ty<'tcx>, &'hir hir::Ty<'hir>)>,
608608
) -> Option<&'hir hir::Lifetime> {
609609
for (kind, hir_arg) in iter::zip(args, hir_args.args) {
610-
match (kind.unpack(), hir_arg) {
610+
match (kind.kind(), hir_arg) {
611611
(GenericArgKind::Lifetime(r), hir::GenericArg::Lifetime(lt)) => {
612612
if r.as_var() == needle_fr {
613613
return Some(lt);
@@ -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
@@ -216,7 +216,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
216216
let pred = bound_predicate.rebind(pred);
217217
// A `Self` within the original bound will be instantiated with a
218218
// `trait_object_dummy_self`, so check for that.
219-
let references_self = match pred.skip_binder().term.unpack() {
219+
let references_self = match pred.skip_binder().term.kind() {
220220
ty::TermKind::Ty(ty) => ty.walk().any(|arg| arg == dummy_self.into()),
221221
// FIXME(associated_const_equality): We should walk the const instead of not doing anything
222222
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
@@ -607,7 +607,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
607607
if !infer_args && has_default {
608608
// No type parameter provided, but a default exists.
609609
if let Some(prev) =
610-
preceding_args.iter().find_map(|arg| match arg.unpack() {
610+
preceding_args.iter().find_map(|arg| match arg.kind() {
611611
GenericArgKind::Type(ty) => ty.error_reported().err(),
612612
_ => None,
613613
})

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fn inferred_outlives_crate(tcx: TyCtxt<'_>, (): ()) -> CratePredicatesMap<'_> {
7070
let predicates =
7171
&*tcx.arena.alloc_from_iter(set.as_ref().skip_binder().iter().filter_map(
7272
|(ty::OutlivesPredicate(kind1, region2), &span)| {
73-
match kind1.unpack() {
73+
match kind1.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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub(crate) fn insert_outlives_predicate<'tcx>(
2525
return;
2626
}
2727

28-
match kind.unpack() {
28+
match kind.kind() {
2929
GenericArgKind::Type(ty) => {
3030
// `T: 'outlived_region` for some type `T`
3131
// But T could be a lot of things:

compiler/rustc_hir_analysis/src/variance/constraints.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
201201
let variance_i = self.invariant(variance);
202202

203203
for k in args {
204-
match k.unpack() {
204+
match k.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
}
@@ -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 k.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: 8 additions & 8 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
{
@@ -373,7 +373,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
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) = param.kind()
377377
&& ty == self.tcx.types.self_param
378378
{
379379
error.obligation.cause.span = self_ty
@@ -389,7 +389,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
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) = param.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
@@ -2230,7 +2230,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
22302230
let infer_args = self.tcx.mk_args_from_iter(args.into_iter().map(|arg| {
22312231
if !arg.is_suggestable(self.tcx, true) {
22322232
has_unsuggestable_args = true;
2233-
match arg.unpack() {
2233+
match arg.kind() {
22342234
GenericArgKind::Lifetime(_) => self
22352235
.next_region_var(RegionVariableOrigin::MiscVariable(DUMMY_SP))
22362236
.into(),
@@ -2847,7 +2847,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
28472847
let [first] = ***args else {
28482848
return;
28492849
};
2850-
let ty::GenericArgKind::Type(ty) = first.unpack() else {
2850+
let ty::GenericArgKind::Type(ty) = first.kind() else {
28512851
return;
28522852
};
28532853
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
},

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ impl<'tcx> InferCtxt<'tcx> {
250250
let result_value = query_response.instantiate_projected(self.tcx, &result_args, |v| {
251251
v.var_values[BoundVar::new(index)]
252252
});
253-
match (original_value.unpack(), result_value.unpack()) {
253+
match (original_value.kind(), result_value.kind()) {
254254
(GenericArgKind::Lifetime(re1), GenericArgKind::Lifetime(re2))
255255
if re1.is_erased() && re2.is_erased() =>
256256
{
@@ -407,7 +407,7 @@ impl<'tcx> InferCtxt<'tcx> {
407407
// [(?A, Vec<?0>), ('static, '?1), (?B, ?0)]
408408
for (original_value, result_value) in iter::zip(&original_values.var_values, result_values)
409409
{
410-
match result_value.unpack() {
410+
match result_value.kind() {
411411
GenericArgKind::Type(result_value) => {
412412
// e.g., here `result_value` might be `?0` in the example above...
413413
if let ty::Bound(debruijn, b) = *result_value.kind() {
@@ -548,7 +548,7 @@ impl<'tcx> InferCtxt<'tcx> {
548548
) -> Obligation<'tcx, ty::Predicate<'tcx>> {
549549
let ty::OutlivesPredicate(k1, r2) = predicate;
550550

551-
let atom = match k1.unpack() {
551+
let atom = match k1.kind() {
552552
GenericArgKind::Lifetime(r1) => ty::PredicateKind::Clause(
553553
ty::ClauseKind::RegionOutlives(ty::OutlivesPredicate(r1, r2)),
554554
),
@@ -579,7 +579,7 @@ impl<'tcx> InferCtxt<'tcx> {
579579
for (index, value1) in variables1.var_values.iter().enumerate() {
580580
let value2 = variables2(BoundVar::new(index));
581581

582-
match (value1.unpack(), value2.unpack()) {
582+
match (value1.kind(), value2.kind()) {
583583
(GenericArgKind::Type(v1), GenericArgKind::Type(v2)) => {
584584
obligations.extend(
585585
self.at(cause, param_env)

compiler/rustc_infer/src/infer/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@ impl<'tcx> TyOrConstInferVar {
13851385
/// for types other than `ty::Infer(_)` (or `InferTy::Fresh*`) and
13861386
/// for constants other than `ty::ConstKind::Infer(_)` (or `InferConst::Fresh`).
13871387
pub fn maybe_from_generic_arg(arg: GenericArg<'tcx>) -> Option<Self> {
1388-
match arg.unpack() {
1388+
match arg.kind() {
13891389
GenericArgKind::Type(ty) => Self::maybe_from_ty(ty),
13901390
GenericArgKind::Const(ct) => Self::maybe_from_const(ct),
13911391
GenericArgKind::Lifetime(_) => None,
@@ -1396,7 +1396,7 @@ impl<'tcx> TyOrConstInferVar {
13961396
/// for types other than `ty::Infer(_)` (or `InferTy::Fresh*`) and
13971397
/// for constants other than `ty::ConstKind::Infer(_)` (or `InferConst::Fresh`).
13981398
pub fn maybe_from_term(term: Term<'tcx>) -> Option<Self> {
1399-
match term.unpack() {
1399+
match term.kind() {
14001400
TermKind::Ty(ty) => Self::maybe_from_ty(ty),
14011401
TermKind::Const(ct) => Self::maybe_from_const(ct),
14021402
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ where
467467
) {
468468
let constraint = origin.to_constraint_category();
469469
for (index, k) in args.iter().enumerate() {
470-
match k.unpack() {
470+
match k.kind() {
471471
GenericArgKind::Lifetime(lt) => {
472472
let variance = if let Some(variances) = opt_variances {
473473
variances[index]

0 commit comments

Comments
 (0)