Skip to content

Commit ec68498

Browse files
Rename projection_def_id to item_def_id
1 parent 33c245b commit ec68498

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
203203
// corresponding `Projection` clause
204204
for def_ids in associated_types.values_mut() {
205205
for (projection_bound, span) in &projection_bounds {
206-
let def_id = projection_bound.projection_def_id();
206+
let def_id = projection_bound.item_def_id();
207207
def_ids.swap_remove(&def_id);
208208
if tcx.generics_require_sized_self(def_id) {
209209
tcx.emit_node_span_lint(
@@ -413,7 +413,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
413413
late_bound_in_projection_term,
414414
late_bound_in_term,
415415
|br_name| {
416-
let item_name = tcx.item_name(pred.projection_def_id());
416+
let item_name = tcx.item_name(pred.item_def_id());
417417
struct_span_code_err!(
418418
self.dcx(),
419419
span,

compiler/rustc_hir_typeck/src/closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
454454
closure_kind: hir::ClosureKind,
455455
projection: ty::PolyProjectionPredicate<'tcx>,
456456
) -> Option<ExpectedSig<'tcx>> {
457-
let def_id = projection.projection_def_id();
457+
let def_id = projection.item_def_id();
458458

459459
// For now, we only do signature deduction based off of the `Fn` and `AsyncFn` traits,
460460
// for closures and async closures, respectively.

compiler/rustc_middle/src/ty/print/pretty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
10201020

10211021
self.insert_trait_and_projection(
10221022
trait_ref,
1023-
Some((proj.projection_def_id(), proj.term())),
1023+
Some((proj.item_def_id(), proj.term())),
10241024
&mut traits,
10251025
&mut fn_traits,
10261026
);

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ where
144144
then: impl FnOnce(&mut EvalCtxt<'_, D>) -> QueryResult<I>,
145145
) -> Result<Candidate<I>, NoSolution> {
146146
if let Some(projection_pred) = assumption.as_projection_clause() {
147-
if projection_pred.projection_def_id() == goal.predicate.def_id() {
147+
if projection_pred.item_def_id() == goal.predicate.def_id() {
148148
let cx = ecx.cx();
149149
if !DeepRejectCtxt::relate_rigid_rigid(ecx.cx()).args_may_unify(
150150
goal.predicate.alias.args,

compiler/rustc_trait_selection/src/traits/project.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ fn assemble_candidates_from_trait_def<'cx, 'tcx>(
744744
let Some(clause) = clause.as_projection_clause() else {
745745
return ControlFlow::Continue(());
746746
};
747-
if clause.projection_def_id() != obligation.predicate.def_id {
747+
if clause.item_def_id() != obligation.predicate.def_id {
748748
return ControlFlow::Continue(());
749749
}
750750

@@ -847,7 +847,7 @@ fn assemble_candidates_from_predicates<'cx, 'tcx>(
847847
let bound_predicate = predicate.kind();
848848
if let ty::ClauseKind::Projection(data) = predicate.kind().skip_binder() {
849849
let data = bound_predicate.rebind(data);
850-
if data.projection_def_id() != obligation.predicate.def_id {
850+
if data.item_def_id() != obligation.predicate.def_id {
851851
continue;
852852
}
853853

compiler/rustc_trait_selection/src/traits/select/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
17371737
env_predicate: PolyProjectionPredicate<'tcx>,
17381738
potentially_unnormalized_candidates: bool,
17391739
) -> ProjectionMatchesProjection {
1740-
debug_assert_eq!(obligation.predicate.def_id, env_predicate.projection_def_id());
1740+
debug_assert_eq!(obligation.predicate.def_id, env_predicate.item_def_id());
17411741

17421742
let mut nested_obligations = PredicateObligations::new();
17431743
let infer_predicate = self.infcx.instantiate_binder_with_fresh_vars(

compiler/rustc_type_ir/src/predicate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ impl<I: Interner> ty::Binder<I, ProjectionPredicate<I>> {
692692
///
693693
/// Note that this is not the `DefId` of the `TraitRef` containing this
694694
/// associated type, which is in `tcx.associated_item(projection_def_id()).container`.
695-
pub fn projection_def_id(&self) -> I::DefId {
695+
pub fn item_def_id(&self) -> I::DefId {
696696
// Ok to skip binder since trait `DefId` does not care about regions.
697697
self.skip_binder().projection_term.def_id
698698
}

0 commit comments

Comments
 (0)