about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJubilee <46493976+workingjubilee@users.noreply.github.com>2024-06-06 21:10:11 -0700
committerGitHub <noreply@github.com>2024-06-06 21:10:11 -0700
commit9436304871dc3ec411f14cbed68f418d2ed48a90 (patch)
treef351c88a3a1461dd302e0ac8b88d9ddc5c585982
parentb1ab8d59f48edbad630204279f3106f63448248a (diff)
parentcddf291a254fd36a51af235f29c129772656d69f (diff)
downloadrust-9436304871dc3ec411f14cbed68f418d2ed48a90.tar.gz
rust-9436304871dc3ec411f14cbed68f418d2ed48a90.zip
Rollup merge of #126103 - veera-sivarajan:improve-docs-hir-impl, r=fmease
Improve Docs for `hir::Impl` and `hir::ImplItem`

Based on https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/.E2.9C.94.20Difference.20between.20.60hir.3A.3AImplItem.60.20and.20.60hir.3A.3AImpl.60.3F/near/442650915

r​? fmease
-rw-r--r--compiler/rustc_hir/src/hir.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs
index 770dfcb98c9..29bc87eae7c 100644
--- a/compiler/rustc_hir/src/hir.rs
+++ b/compiler/rustc_hir/src/hir.rs
@@ -2345,7 +2345,9 @@ impl ImplItemId {
     }
 }
 
-/// Represents anything within an `impl` block.
+/// Represents an associated item within an impl block.
+///
+/// Refer to [`Impl`] for an impl block declaration.
 #[derive(Debug, Clone, Copy, HashStable_Generic)]
 pub struct ImplItem<'hir> {
     pub ident: Ident,
@@ -3327,6 +3329,10 @@ pub enum ItemKind<'hir> {
     Impl(&'hir Impl<'hir>),
 }
 
+/// Represents an impl block declaration.
+///
+/// E.g., `impl $Type { .. }` or `impl $Trait for $Type { .. }`
+/// Refer to [`ImplItem`] for an associated item within an impl block.
 #[derive(Debug, Clone, Copy, HashStable_Generic)]
 pub struct Impl<'hir> {
     pub safety: Safety,