Skip to content

Commit 2185d3f

Browse files
Improve Docs for hir::Impl and hir::ImplItem
1 parent e1ac0fa commit 2185d3f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/rustc_hir/src/hir.rs

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

2348-
/// Represents anything within an `impl` block.
2348+
/// Represents an associated item within an impl block.
2349+
/// Refer to [`Impl`] for an impl block declaration.
23492350
#[derive(Debug, Clone, Copy, HashStable_Generic)]
23502351
pub struct ImplItem<'hir> {
23512352
pub ident: Ident,
@@ -3327,6 +3328,9 @@ pub enum ItemKind<'hir> {
33273328
Impl(&'hir Impl<'hir>),
33283329
}
33293330

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

0 commit comments

Comments
 (0)