Rename projection_def_id to item_def_id
This commit is contained in:
parent
33c245b9e9
commit
ec68498317
7 changed files with 9 additions and 9 deletions
|
@ -203,7 +203,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
|
|||
// corresponding `Projection` clause
|
||||
for def_ids in associated_types.values_mut() {
|
||||
for (projection_bound, span) in &projection_bounds {
|
||||
let def_id = projection_bound.projection_def_id();
|
||||
let def_id = projection_bound.item_def_id();
|
||||
def_ids.swap_remove(&def_id);
|
||||
if tcx.generics_require_sized_self(def_id) {
|
||||
tcx.emit_node_span_lint(
|
||||
|
@ -413,7 +413,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
|
|||
late_bound_in_projection_term,
|
||||
late_bound_in_term,
|
||||
|br_name| {
|
||||
let item_name = tcx.item_name(pred.projection_def_id());
|
||||
let item_name = tcx.item_name(pred.item_def_id());
|
||||
struct_span_code_err!(
|
||||
self.dcx(),
|
||||
span,
|
||||
|
|
|
@ -454,7 +454,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
closure_kind: hir::ClosureKind,
|
||||
projection: ty::PolyProjectionPredicate<'tcx>,
|
||||
) -> Option<ExpectedSig<'tcx>> {
|
||||
let def_id = projection.projection_def_id();
|
||||
let def_id = projection.item_def_id();
|
||||
|
||||
// For now, we only do signature deduction based off of the `Fn` and `AsyncFn` traits,
|
||||
// for closures and async closures, respectively.
|
||||
|
|
|
@ -1020,7 +1020,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
|
|||
|
||||
self.insert_trait_and_projection(
|
||||
trait_ref,
|
||||
Some((proj.projection_def_id(), proj.term())),
|
||||
Some((proj.item_def_id(), proj.term())),
|
||||
&mut traits,
|
||||
&mut fn_traits,
|
||||
);
|
||||
|
|
|
@ -144,7 +144,7 @@ where
|
|||
then: impl FnOnce(&mut EvalCtxt<'_, D>) -> QueryResult<I>,
|
||||
) -> Result<Candidate<I>, NoSolution> {
|
||||
if let Some(projection_pred) = assumption.as_projection_clause() {
|
||||
if projection_pred.projection_def_id() == goal.predicate.def_id() {
|
||||
if projection_pred.item_def_id() == goal.predicate.def_id() {
|
||||
let cx = ecx.cx();
|
||||
if !DeepRejectCtxt::relate_rigid_rigid(ecx.cx()).args_may_unify(
|
||||
goal.predicate.alias.args,
|
||||
|
|
|
@ -744,7 +744,7 @@ fn assemble_candidates_from_trait_def<'cx, 'tcx>(
|
|||
let Some(clause) = clause.as_projection_clause() else {
|
||||
return ControlFlow::Continue(());
|
||||
};
|
||||
if clause.projection_def_id() != obligation.predicate.def_id {
|
||||
if clause.item_def_id() != obligation.predicate.def_id {
|
||||
return ControlFlow::Continue(());
|
||||
}
|
||||
|
||||
|
@ -847,7 +847,7 @@ fn assemble_candidates_from_predicates<'cx, 'tcx>(
|
|||
let bound_predicate = predicate.kind();
|
||||
if let ty::ClauseKind::Projection(data) = predicate.kind().skip_binder() {
|
||||
let data = bound_predicate.rebind(data);
|
||||
if data.projection_def_id() != obligation.predicate.def_id {
|
||||
if data.item_def_id() != obligation.predicate.def_id {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -1737,7 +1737,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
env_predicate: PolyProjectionPredicate<'tcx>,
|
||||
potentially_unnormalized_candidates: bool,
|
||||
) -> ProjectionMatchesProjection {
|
||||
debug_assert_eq!(obligation.predicate.def_id, env_predicate.projection_def_id());
|
||||
debug_assert_eq!(obligation.predicate.def_id, env_predicate.item_def_id());
|
||||
|
||||
let mut nested_obligations = PredicateObligations::new();
|
||||
let infer_predicate = self.infcx.instantiate_binder_with_fresh_vars(
|
||||
|
|
|
@ -692,7 +692,7 @@ impl<I: Interner> ty::Binder<I, ProjectionPredicate<I>> {
|
|||
///
|
||||
/// Note that this is not the `DefId` of the `TraitRef` containing this
|
||||
/// associated type, which is in `tcx.associated_item(projection_def_id()).container`.
|
||||
pub fn projection_def_id(&self) -> I::DefId {
|
||||
pub fn item_def_id(&self) -> I::DefId {
|
||||
// Ok to skip binder since trait `DefId` does not care about regions.
|
||||
self.skip_binder().projection_term.def_id
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue