Skip to content

Commit 9436304

Browse files
Rollup merge of rust-lang#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
2 parents b1ab8d5 + cddf291 commit 9436304

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: compiler/rustc_hir/src/hir.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -2345,7 +2345,9 @@ impl ImplItemId {
23452345
}
23462346
}
23472347

2348-
/// Represents anything within an `impl` block.
2348+
/// Represents an associated item within an impl block.
2349+
///
2350+
/// Refer to [`Impl`] for an impl block declaration.
23492351
#[derive(Debug, Clone, Copy, HashStable_Generic)]
23502352
pub struct ImplItem<'hir> {
23512353
pub ident: Ident,
@@ -3327,6 +3329,10 @@ pub enum ItemKind<'hir> {
33273329
Impl(&'hir Impl<'hir>),
33283330
}
33293331

3332+
/// Represents an impl block declaration.
3333+
///
3334+
/// E.g., `impl $Type { .. }` or `impl $Trait for $Type { .. }`
3335+
/// Refer to [`ImplItem`] for an associated item within an impl block.
33303336
#[derive(Debug, Clone, Copy, HashStable_Generic)]
33313337
pub struct Impl<'hir> {
33323338
pub safety: Safety,

0 commit comments

Comments
 (0)