Skip to content

Commit 26c4c1e

Browse files
committed
Rename impl_trait_in_trait_parent to impl_trait_in_trait_parent_fn
1 parent e4b9f86 commit 26c4c1e

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed

compiler/rustc_hir_analysis/src/check/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ fn check_item_type(tcx: TyCtxt<'_>, id: hir::ItemId) {
557557
check_opaque(tcx, id);
558558
}
559559
DefKind::ImplTraitPlaceholder => {
560-
let parent = tcx.impl_trait_in_trait_parent(id.owner_id.to_def_id());
560+
let parent = tcx.impl_trait_in_trait_parent_fn(id.owner_id.to_def_id());
561561
// Only check the validity of this opaque type if the function has a default body
562562
if let hir::Node::TraitItem(hir::TraitItem {
563563
kind: hir::TraitItemKind::Fn(_, hir::TraitFn::Provided(_)),

compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,7 @@ fn check_return_position_impl_trait_in_trait_bounds<'tcx>(
15501550
if let ty::GenericArgKind::Type(ty) = arg.unpack()
15511551
&& let ty::Alias(ty::Opaque, proj) = ty.kind()
15521552
&& tcx.def_kind(proj.def_id) == DefKind::ImplTraitPlaceholder
1553-
&& tcx.impl_trait_in_trait_parent(proj.def_id) == fn_def_id.to_def_id()
1553+
&& tcx.impl_trait_in_trait_parent_fn(proj.def_id) == fn_def_id.to_def_id()
15541554
{
15551555
let span = tcx.def_span(proj.def_id);
15561556
let bounds = wfcx.tcx().explicit_item_bounds(proj.def_id);

compiler/rustc_metadata/src/rmeta/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ fn should_encode_type(tcx: TyCtxt<'_>, def_id: LocalDefId, def_kind: DefKind) ->
10281028
| DefKind::InlineConst => true,
10291029

10301030
DefKind::ImplTraitPlaceholder => {
1031-
let parent_def_id = tcx.impl_trait_in_trait_parent(def_id.to_def_id());
1031+
let parent_def_id = tcx.impl_trait_in_trait_parent_fn(def_id.to_def_id());
10321032
let assoc_item = tcx.associated_item(parent_def_id);
10331033
match assoc_item.container {
10341034
// Always encode an RPIT in an impl fn, since it always has a body

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2552,7 +2552,7 @@ impl<'tcx> TyCtxt<'tcx> {
25522552
matches!(self.trait_of_item(def_id), Some(trait_id) if self.has_attr(trait_id, sym::const_trait))
25532553
}
25542554

2555-
pub fn impl_trait_in_trait_parent(self, mut def_id: DefId) -> DefId {
2555+
pub fn impl_trait_in_trait_parent_fn(self, mut def_id: DefId) -> DefId {
25562556
while let def_kind = self.def_kind(def_id) && def_kind != DefKind::AssocFn {
25572557
debug_assert_eq!(def_kind, DefKind::ImplTraitPlaceholder);
25582558
def_id = self.parent(def_id);

compiler/rustc_middle/src/ty/sty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ impl<'tcx> AliasTy<'tcx> {
12881288
match tcx.def_kind(self.def_id) {
12891289
DefKind::AssocTy | DefKind::AssocConst => tcx.parent(self.def_id),
12901290
DefKind::ImplTraitPlaceholder => {
1291-
tcx.parent(tcx.impl_trait_in_trait_parent(self.def_id))
1291+
tcx.parent(tcx.impl_trait_in_trait_parent_fn(self.def_id))
12921292
}
12931293
kind => bug!("expected a projection AliasTy; found {kind:?}"),
12941294
}

compiler/rustc_privacy/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ where
132132
projection.trait_ref_and_own_substs(tcx)
133133
} else {
134134
// HACK(RPITIT): Remove this when RPITITs are lowered to regular assoc tys
135-
let def_id = tcx.impl_trait_in_trait_parent(projection.def_id);
135+
let def_id = tcx.impl_trait_in_trait_parent_fn(projection.def_id);
136136
let trait_generics = tcx.generics_of(def_id);
137137
(
138138
tcx.mk_trait_ref(def_id, projection.substs.truncate_to(tcx, trait_generics)),

compiler/rustc_trait_selection/src/traits/project.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,7 @@ fn assemble_candidate_for_impl_trait_in_trait<'cx, 'tcx>(
12951295
) {
12961296
let tcx = selcx.tcx();
12971297
if tcx.def_kind(obligation.predicate.def_id) == DefKind::ImplTraitPlaceholder {
1298-
let trait_fn_def_id = tcx.impl_trait_in_trait_parent(obligation.predicate.def_id);
1298+
let trait_fn_def_id = tcx.impl_trait_in_trait_parent_fn(obligation.predicate.def_id);
12991299

13001300
let trait_def_id = tcx.parent(trait_fn_def_id);
13011301
let trait_substs =
@@ -2193,7 +2193,7 @@ fn confirm_impl_trait_in_trait_candidate<'tcx>(
21932193
let tcx = selcx.tcx();
21942194
let mut obligations = data.nested;
21952195

2196-
let trait_fn_def_id = tcx.impl_trait_in_trait_parent(obligation.predicate.def_id);
2196+
let trait_fn_def_id = tcx.impl_trait_in_trait_parent_fn(obligation.predicate.def_id);
21972197
let leaf_def = match specialization_graph::assoc_def(tcx, data.impl_def_id, trait_fn_def_id) {
21982198
Ok(assoc_ty) => assoc_ty,
21992199
Err(guar) => return Progress::error(tcx, guar),

compiler/rustc_ty_utils/src/assoc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ fn associated_item_for_impl_trait_in_trait(
244244
tcx: TyCtxt<'_>,
245245
opaque_ty_def_id: LocalDefId,
246246
) -> LocalDefId {
247-
let fn_def_id = tcx.impl_trait_in_trait_parent(opaque_ty_def_id.to_def_id());
247+
let fn_def_id = tcx.impl_trait_in_trait_parent_fn(opaque_ty_def_id.to_def_id());
248248
let trait_def_id = tcx.parent(fn_def_id);
249249
assert_eq!(tcx.def_kind(trait_def_id), DefKind::Trait);
250250

compiler/rustc_ty_utils/src/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ImplTraitInTraitFinder<'_, 'tcx> {
269269
fn visit_ty(&mut self, ty: Ty<'tcx>) -> std::ops::ControlFlow<Self::BreakTy> {
270270
if let ty::Alias(ty::Projection, alias_ty) = *ty.kind()
271271
&& self.tcx.def_kind(alias_ty.def_id) == DefKind::ImplTraitPlaceholder
272-
&& self.tcx.impl_trait_in_trait_parent(alias_ty.def_id) == self.fn_def_id
272+
&& self.tcx.impl_trait_in_trait_parent_fn(alias_ty.def_id) == self.fn_def_id
273273
&& self.seen.insert(alias_ty.def_id)
274274
{
275275
// We have entered some binders as we've walked into the

0 commit comments

Comments
 (0)