1
Fork 0

* Fix some typo

* Improve documentation
* Add a test to ensure that spotlighted traits from dependencies are taken into account as expected
This commit is contained in:
Guillaume Gomez 2021-02-14 14:47:55 +01:00
parent b5c8eea55d
commit 3c59e64abf
3 changed files with 31 additions and 10 deletions

View file

@ -245,16 +245,12 @@ impl<'a, 'tcx> DocFolder for CacheBuilder<'a, 'tcx> {
}
}
let tcx = self.tcx;
// Propagate a trait method's documentation to all implementors of the
// trait.
if let clean::TraitItem(ref t) = *item.kind {
self.cache.traits.entry(item.def_id).or_insert_with(|| clean::TraitWithExtraInfo {
trait_: t.clone(),
is_spotlight: clean::utils::has_doc_flag(
tcx.get_attrs(item.def_id),
sym::spotlight,
),
is_spotlight: item.attrs.has_doc_flag(sym::spotlight),
});
}