about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-09-18 11:48:52 +1000
committerGitHub <noreply@github.com>2025-09-18 11:48:52 +1000
commit06cbfd67062205d4aa07866b4ad68355919fe2a8 (patch)
treecf0cd20aaf59e03f4ee1caa7672254d973f1de7a /src
parentd1ed8d43114603816efc36d5546231225761ce3d (diff)
parent9ecca51bbe151c4ce0e374c46d1a0bfd1ec63d49 (diff)
downloadrust-06cbfd67062205d4aa07866b4ad68355919fe2a8.tar.gz
rust-06cbfd67062205d4aa07866b4ad68355919fe2a8.zip
Rollup merge of #146694 - camsteffen:impl-subject, r=compiler-errors
Remove ImplSubject

It only has one usage in rustdoc.
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/render/mod.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index b4ef47d1e26..6d684449b6d 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -2454,11 +2454,11 @@ fn get_id_for_impl(tcx: TyCtxt<'_>, impl_id: ItemId) -> String {
             (ty, Some(ty::TraitRef::new(tcx, trait_, [ty])))
         }
         ItemId::Blanket { impl_id, .. } | ItemId::DefId(impl_id) => {
-            match tcx.impl_subject(impl_id).skip_binder() {
-                ty::ImplSubject::Trait(trait_ref) => {
-                    (trait_ref.args[0].expect_ty(), Some(trait_ref))
-                }
-                ty::ImplSubject::Inherent(ty) => (ty, None),
+            if let Some(trait_ref) = tcx.impl_trait_ref(impl_id) {
+                let trait_ref = trait_ref.skip_binder();
+                (trait_ref.self_ty(), Some(trait_ref))
+            } else {
+                (tcx.type_of(impl_id).skip_binder(), None)
             }
         }
     };