about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src/implied_bounds.rs
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2024-02-27 15:00:22 +0100
committerlcnr <rust@lcnr.de>2024-02-27 15:00:22 +0100
commit93bc7a428cdf64a822274f7c5647ad46f8ecf122 (patch)
treed56317f7493a07db050e294e2fc14a37b1c1768a /compiler/rustc_ty_utils/src/implied_bounds.rs
parent91cae1dcdcf1a31bd8a92e4a63793d65cfe289bb (diff)
downloadrust-93bc7a428cdf64a822274f7c5647ad46f8ecf122.tar.gz
rust-93bc7a428cdf64a822274f7c5647ad46f8ecf122.zip
wf-check RPITs
Diffstat (limited to 'compiler/rustc_ty_utils/src/implied_bounds.rs')
-rw-r--r--compiler/rustc_ty_utils/src/implied_bounds.rs13
1 files changed, 1 insertions, 12 deletions
diff --git a/compiler/rustc_ty_utils/src/implied_bounds.rs b/compiler/rustc_ty_utils/src/implied_bounds.rs
index 3f9bd509b08..191671bcc1e 100644
--- a/compiler/rustc_ty_utils/src/implied_bounds.rs
+++ b/compiler/rustc_ty_utils/src/implied_bounds.rs
@@ -121,18 +121,7 @@ fn assumed_wf_types<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &'tcx [(Ty<'
             }
         }
         DefKind::AssocConst | DefKind::AssocTy => tcx.assumed_wf_types(tcx.local_parent(def_id)),
-        DefKind::OpaqueTy => match tcx.def_kind(tcx.local_parent(def_id)) {
-            DefKind::TyAlias => ty::List::empty(),
-            DefKind::AssocTy => tcx.assumed_wf_types(tcx.local_parent(def_id)),
-            // Nested opaque types only occur in associated types:
-            // ` type Opaque<T> = impl Trait<&'static T, AssocTy = impl Nested>; `
-            // assumed_wf_types should include those of `Opaque<T>`, `Opaque<T>` itself
-            // and `&'static T`.
-            DefKind::OpaqueTy => bug!("unimplemented implied bounds for nested opaque types"),
-            def_kind => {
-                bug!("unimplemented implied bounds for opaque types with parent {def_kind:?}")
-            }
-        },
+        DefKind::OpaqueTy => bug!("implied bounds are not defined for opaques"),
         DefKind::Mod
         | DefKind::Struct
         | DefKind::Union