diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-10-07 00:15:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-07 00:15:58 +0200 |
| commit | d26ca984c32152d97eee51b7a7a400b75d2fff68 (patch) | |
| tree | c674a93588e7d629b013f255c419f24828c5047c /src | |
| parent | 9fdaeb393a16951f6fdef087193fef576e36aba6 (diff) | |
| parent | 63e72348d192dfedfb84510a88099cd6523c187b (diff) | |
| download | rust-d26ca984c32152d97eee51b7a7a400b75d2fff68.tar.gz rust-d26ca984c32152d97eee51b7a7a400b75d2fff68.zip | |
Rollup merge of #76784 - lzutao:rd_doc, r=GuillaumeGomez
Add some docs to rustdoc::clean::inline and def_id functions Split from #76571 .
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/inline.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 31e8c32f062..7f64d20d8e7 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -290,10 +290,12 @@ pub fn build_ty(cx: &DocContext<'_>, did: DefId) -> Option<clean::Type> { } } +/// Builds all inherent implementations of an ADT (struct/union/enum) or Trait item/path/reexport. pub fn build_impls(cx: &DocContext<'_>, did: DefId, attrs: Option<Attrs<'_>>) -> Vec<clean::Item> { let tcx = cx.tcx; let mut impls = Vec::new(); + // for each implementation of an item represented by `did`, build the clean::Item for that impl for &did in tcx.inherent_impls(did).iter() { build_impl(cx, did, attrs, &mut impls); } @@ -320,6 +322,7 @@ fn merge_attrs( merged_attrs.clean(cx) } +/// Builds a specific implementation of a type. The `did` could be a type method or trait method. pub fn build_impl( cx: &DocContext<'_>, did: DefId, |
