Rollup merge of #113698 - compiler-errors:rpitit-check, r=spastorino
Make it clearer that we're just checking for an RPITIT Tiny nit to use `is_impl_trait_in_trait` more, to make it clearer that we're just checking whether a def-id is an RPITIT, rather than doing something meaningful with the `opt_rpitit_info`. r? `@spastorino`
This commit is contained in:
commit
0baf4406da
9 changed files with 14 additions and 10 deletions
|
@ -435,7 +435,7 @@ fn suggest_restriction<'tcx>(
|
|||
) {
|
||||
if hir_generics.where_clause_span.from_expansion()
|
||||
|| hir_generics.where_clause_span.desugaring_kind().is_some()
|
||||
|| projection.is_some_and(|projection| tcx.opt_rpitit_info(projection.def_id).is_some())
|
||||
|| projection.is_some_and(|projection| tcx.is_impl_trait_in_trait(projection.def_id))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -393,7 +393,7 @@ fn object_safety_violation_for_assoc_item(
|
|||
ty::AssocKind::Type => {
|
||||
if !tcx.features().generic_associated_types_extended
|
||||
&& !tcx.generics_of(item.def_id).params.is_empty()
|
||||
&& item.opt_rpitit_info.is_none()
|
||||
&& !item.is_impl_trait_in_trait()
|
||||
{
|
||||
Some(ObjectSafetyViolation::GAT(item.name, item.ident(tcx).span))
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue