6719: Use items can also have doc comments r=matklad a=Veykril

Prior to this change modules show more docs than they have cause they inherit the docs from documented use items inside of them.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
bors[bot]
2020-12-07 18:48:35 +00:00
committed by GitHub
5 changed files with 23 additions and 23 deletions

View File

@@ -477,3 +477,4 @@ impl ast::DocCommentsOwner for ast::Const {}
impl ast::DocCommentsOwner for ast::TypeAlias {}
impl ast::DocCommentsOwner for ast::Impl {}
impl ast::DocCommentsOwner for ast::MacroCall {}
impl ast::DocCommentsOwner for ast::Use {}

View File

@@ -148,7 +148,7 @@ fn n_attached_trivias<'a>(
) -> usize {
match kind {
MACRO_CALL | CONST | TYPE_ALIAS | STRUCT | ENUM | VARIANT | FN | TRAIT | MODULE
| RECORD_FIELD | STATIC => {
| RECORD_FIELD | STATIC | USE => {
let mut res = 0;
let mut trivias = trivias.enumerate().peekable();