diff options
| author | Michael Goulet <michael@errs.io> | 2023-07-14 15:18:19 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-07-14 15:18:48 +0000 |
| commit | 14672eba8bec4eeec03d24d5985a4c8c172a01da (patch) | |
| tree | 0f61b13f8afb138e273d34d92dd8e58a1813ee9c /compiler/rustc_trait_selection/src | |
| parent | bacf5bcbc7dae526872cf6af3fc0064a51b1efa2 (diff) | |
| download | rust-14672eba8bec4eeec03d24d5985a4c8c172a01da.tar.gz rust-14672eba8bec4eeec03d24d5985a4c8c172a01da.zip | |
Make it clearer that we're just checking for an RPITIT
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/object_safety.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index 1a9e21c2bea..040bd4a67e2 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -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; } diff --git a/compiler/rustc_trait_selection/src/traits/object_safety.rs b/compiler/rustc_trait_selection/src/traits/object_safety.rs index c31944c162e..00646c0e1c3 100644 --- a/compiler/rustc_trait_selection/src/traits/object_safety.rs +++ b/compiler/rustc_trait_selection/src/traits/object_safety.rs @@ -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 { |
