Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 16af814

Browse files
authoredMay 27, 2025
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 88b12f3 + 5f3ae06 commit 16af814

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);

0 commit comments

Comments
 (0)