about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/collect/generics_of.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-10-02 22:21:37 -0400
committerMichael Goulet <michael@errs.io>2024-10-02 22:48:26 -0400
commit7cd466a03606313dad4fa22fd5cf444204138fc8 (patch)
tree8270c6fe4ce68514de3e85960007ad8aa3f5ec1f /compiler/rustc_hir_analysis/src/collect/generics_of.rs
parentcb7e3695e8e7ea04377f60977b65ba324273b63d (diff)
downloadrust-7cd466a03606313dad4fa22fd5cf444204138fc8.tar.gz
rust-7cd466a03606313dad4fa22fd5cf444204138fc8.zip
Move in_trait into OpaqueTyOrigin
Diffstat (limited to 'compiler/rustc_hir_analysis/src/collect/generics_of.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/collect/generics_of.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_hir_analysis/src/collect/generics_of.rs b/compiler/rustc_hir_analysis/src/collect/generics_of.rs
index 73e98c67cdc..8ff9640a874 100644
--- a/compiler/rustc_hir_analysis/src/collect/generics_of.rs
+++ b/compiler/rustc_hir_analysis/src/collect/generics_of.rs
@@ -210,12 +210,11 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics {
         Node::Item(item) => match item.kind {
             ItemKind::OpaqueTy(&hir::OpaqueTy {
                 origin:
-                    hir::OpaqueTyOrigin::FnReturn { parent: fn_def_id }
-                    | hir::OpaqueTyOrigin::AsyncFn { parent: fn_def_id },
-                in_trait,
+                    hir::OpaqueTyOrigin::FnReturn { parent: fn_def_id, in_trait_or_impl }
+                    | hir::OpaqueTyOrigin::AsyncFn { parent: fn_def_id, in_trait_or_impl },
                 ..
             }) => {
-                if in_trait {
+                if in_trait_or_impl.is_some() {
                     assert_matches!(tcx.def_kind(fn_def_id), DefKind::AssocFn);
                 } else {
                     assert_matches!(tcx.def_kind(fn_def_id), DefKind::AssocFn | DefKind::Fn);