Skip to content

Commit a274e7e

Browse files
ProjectionTy.item_def_id -> ProjectionTy.def_id
1 parent ad55e4c commit a274e7e

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

clippy_lints/src/dereference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,7 @@ fn replace_types<'tcx>(
13301330
&& let Some(term_ty) = projection_predicate.term.ty()
13311331
&& let ty::Param(term_param_ty) = term_ty.kind()
13321332
{
1333-
let item_def_id = projection_predicate.projection_ty.item_def_id;
1333+
let item_def_id = projection_predicate.projection_ty.def_id;
13341334
let assoc_item = cx.tcx.associated_item(item_def_id);
13351335
let projection = cx.tcx
13361336
.mk_projection(assoc_item.def_id, cx.tcx.mk_substs_trait(new_ty, []));

clippy_lints/src/len_zero.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ fn has_is_empty(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
493493
.filter_by_name_unhygienic(is_empty)
494494
.any(|item| is_is_empty(cx, item))
495495
}),
496-
ty::Projection(ref proj) => has_is_empty_impl(cx, proj.item_def_id),
496+
ty::Projection(ref proj) => has_is_empty_impl(cx, proj.def_id),
497497
ty::Adt(id, _) => has_is_empty_impl(cx, id.did()),
498498
ty::Array(..) | ty::Slice(..) | ty::Str => true,
499499
_ => false,

clippy_lints/src/methods/needless_collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ fn iterates_same_ty<'tcx>(cx: &LateContext<'tcx>, iter_ty: Ty<'tcx>, collect_ty:
151151
&& let Some(into_iter_item_proj) = make_projection(cx.tcx, into_iter_trait, item, [collect_ty])
152152
&& let Ok(into_iter_item_ty) = cx.tcx.try_normalize_erasing_regions(
153153
cx.param_env,
154-
cx.tcx.mk_projection(into_iter_item_proj.item_def_id, into_iter_item_proj.substs)
154+
cx.tcx.mk_projection(into_iter_item_proj.def_id, into_iter_item_proj.substs)
155155
)
156156
{
157157
iter_item_ty == into_iter_item_ty

clippy_utils/src/ty.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ fn sig_from_bounds<'tcx>(
685685
inputs = Some(i);
686686
},
687687
PredicateKind::Clause(ty::Clause::Projection(p))
688-
if Some(p.projection_ty.item_def_id) == lang_items.fn_once_output()
688+
if Some(p.projection_ty.def_id) == lang_items.fn_once_output()
689689
&& p.projection_ty.self_ty() == ty =>
690690
{
691691
if output.is_some() {
@@ -708,7 +708,7 @@ fn sig_for_projection<'tcx>(cx: &LateContext<'tcx>, ty: ProjectionTy<'tcx>) -> O
708708

709709
for (pred, _) in cx
710710
.tcx
711-
.bound_explicit_item_bounds(ty.item_def_id)
711+
.bound_explicit_item_bounds(ty.def_id)
712712
.subst_iter_copied(cx.tcx, ty.substs)
713713
{
714714
match pred.kind().skip_binder() {
@@ -726,7 +726,7 @@ fn sig_for_projection<'tcx>(cx: &LateContext<'tcx>, ty: ProjectionTy<'tcx>) -> O
726726
inputs = Some(i);
727727
},
728728
PredicateKind::Clause(ty::Clause::Projection(p))
729-
if Some(p.projection_ty.item_def_id) == lang_items.fn_once_output() =>
729+
if Some(p.projection_ty.def_id) == lang_items.fn_once_output() =>
730730
{
731731
if output.is_some() {
732732
// Multiple different fn trait impls. Is this even allowed?
@@ -1041,7 +1041,7 @@ pub fn make_projection<'tcx>(
10411041

10421042
Some(ProjectionTy {
10431043
substs,
1044-
item_def_id: assoc_item.def_id,
1044+
def_id: assoc_item.def_id,
10451045
})
10461046
}
10471047
helper(
@@ -1081,7 +1081,7 @@ pub fn make_normalized_projection<'tcx>(
10811081
);
10821082
return None;
10831083
}
1084-
match tcx.try_normalize_erasing_regions(param_env, tcx.mk_projection(ty.item_def_id, ty.substs)) {
1084+
match tcx.try_normalize_erasing_regions(param_env, tcx.mk_projection(ty.def_id, ty.substs)) {
10851085
Ok(ty) => Some(ty),
10861086
Err(e) => {
10871087
debug_assert!(false, "failed to normalize type `{ty}`: {e:#?}");

0 commit comments

Comments
 (0)