mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 03:38:29 +00:00
ProjectionTy.item_def_id -> ProjectionTy.def_id
This commit is contained in:
parent
ad55e4c972
commit
a274e7e9a2
@ -1330,7 +1330,7 @@ fn replace_types<'tcx>(
|
|||||||
&& let Some(term_ty) = projection_predicate.term.ty()
|
&& let Some(term_ty) = projection_predicate.term.ty()
|
||||||
&& let ty::Param(term_param_ty) = term_ty.kind()
|
&& let ty::Param(term_param_ty) = term_ty.kind()
|
||||||
{
|
{
|
||||||
let item_def_id = projection_predicate.projection_ty.item_def_id;
|
let item_def_id = projection_predicate.projection_ty.def_id;
|
||||||
let assoc_item = cx.tcx.associated_item(item_def_id);
|
let assoc_item = cx.tcx.associated_item(item_def_id);
|
||||||
let projection = cx.tcx
|
let projection = cx.tcx
|
||||||
.mk_projection(assoc_item.def_id, cx.tcx.mk_substs_trait(new_ty, []));
|
.mk_projection(assoc_item.def_id, cx.tcx.mk_substs_trait(new_ty, []));
|
||||||
|
@ -493,7 +493,7 @@ fn has_is_empty(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
|
|||||||
.filter_by_name_unhygienic(is_empty)
|
.filter_by_name_unhygienic(is_empty)
|
||||||
.any(|item| is_is_empty(cx, item))
|
.any(|item| is_is_empty(cx, item))
|
||||||
}),
|
}),
|
||||||
ty::Projection(ref proj) => has_is_empty_impl(cx, proj.item_def_id),
|
ty::Projection(ref proj) => has_is_empty_impl(cx, proj.def_id),
|
||||||
ty::Adt(id, _) => has_is_empty_impl(cx, id.did()),
|
ty::Adt(id, _) => has_is_empty_impl(cx, id.did()),
|
||||||
ty::Array(..) | ty::Slice(..) | ty::Str => true,
|
ty::Array(..) | ty::Slice(..) | ty::Str => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
|
@ -151,7 +151,7 @@ fn iterates_same_ty<'tcx>(cx: &LateContext<'tcx>, iter_ty: Ty<'tcx>, collect_ty:
|
|||||||
&& let Some(into_iter_item_proj) = make_projection(cx.tcx, into_iter_trait, item, [collect_ty])
|
&& let Some(into_iter_item_proj) = make_projection(cx.tcx, into_iter_trait, item, [collect_ty])
|
||||||
&& let Ok(into_iter_item_ty) = cx.tcx.try_normalize_erasing_regions(
|
&& let Ok(into_iter_item_ty) = cx.tcx.try_normalize_erasing_regions(
|
||||||
cx.param_env,
|
cx.param_env,
|
||||||
cx.tcx.mk_projection(into_iter_item_proj.item_def_id, into_iter_item_proj.substs)
|
cx.tcx.mk_projection(into_iter_item_proj.def_id, into_iter_item_proj.substs)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
iter_item_ty == into_iter_item_ty
|
iter_item_ty == into_iter_item_ty
|
||||||
|
@ -685,7 +685,7 @@ fn sig_from_bounds<'tcx>(
|
|||||||
inputs = Some(i);
|
inputs = Some(i);
|
||||||
},
|
},
|
||||||
PredicateKind::Clause(ty::Clause::Projection(p))
|
PredicateKind::Clause(ty::Clause::Projection(p))
|
||||||
if Some(p.projection_ty.item_def_id) == lang_items.fn_once_output()
|
if Some(p.projection_ty.def_id) == lang_items.fn_once_output()
|
||||||
&& p.projection_ty.self_ty() == ty =>
|
&& p.projection_ty.self_ty() == ty =>
|
||||||
{
|
{
|
||||||
if output.is_some() {
|
if output.is_some() {
|
||||||
@ -708,7 +708,7 @@ fn sig_for_projection<'tcx>(cx: &LateContext<'tcx>, ty: ProjectionTy<'tcx>) -> O
|
|||||||
|
|
||||||
for (pred, _) in cx
|
for (pred, _) in cx
|
||||||
.tcx
|
.tcx
|
||||||
.bound_explicit_item_bounds(ty.item_def_id)
|
.bound_explicit_item_bounds(ty.def_id)
|
||||||
.subst_iter_copied(cx.tcx, ty.substs)
|
.subst_iter_copied(cx.tcx, ty.substs)
|
||||||
{
|
{
|
||||||
match pred.kind().skip_binder() {
|
match pred.kind().skip_binder() {
|
||||||
@ -726,7 +726,7 @@ fn sig_for_projection<'tcx>(cx: &LateContext<'tcx>, ty: ProjectionTy<'tcx>) -> O
|
|||||||
inputs = Some(i);
|
inputs = Some(i);
|
||||||
},
|
},
|
||||||
PredicateKind::Clause(ty::Clause::Projection(p))
|
PredicateKind::Clause(ty::Clause::Projection(p))
|
||||||
if Some(p.projection_ty.item_def_id) == lang_items.fn_once_output() =>
|
if Some(p.projection_ty.def_id) == lang_items.fn_once_output() =>
|
||||||
{
|
{
|
||||||
if output.is_some() {
|
if output.is_some() {
|
||||||
// Multiple different fn trait impls. Is this even allowed?
|
// Multiple different fn trait impls. Is this even allowed?
|
||||||
@ -1041,7 +1041,7 @@ pub fn make_projection<'tcx>(
|
|||||||
|
|
||||||
Some(ProjectionTy {
|
Some(ProjectionTy {
|
||||||
substs,
|
substs,
|
||||||
item_def_id: assoc_item.def_id,
|
def_id: assoc_item.def_id,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
helper(
|
helper(
|
||||||
@ -1081,7 +1081,7 @@ pub fn make_normalized_projection<'tcx>(
|
|||||||
);
|
);
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
match tcx.try_normalize_erasing_regions(param_env, tcx.mk_projection(ty.item_def_id, ty.substs)) {
|
match tcx.try_normalize_erasing_regions(param_env, tcx.mk_projection(ty.def_id, ty.substs)) {
|
||||||
Ok(ty) => Some(ty),
|
Ok(ty) => Some(ty),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
debug_assert!(false, "failed to normalize type `{ty}`: {e:#?}");
|
debug_assert!(false, "failed to normalize type `{ty}`: {e:#?}");
|
||||||
|
Loading…
Reference in New Issue
Block a user