mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-12 18:07:40 +00:00
Move Res check into should_ignore_res
This commit is contained in:
parent
f45961b60d
commit
31bb3c0cd1
@ -41,7 +41,7 @@ use thin_vec::ThinVec;
|
|||||||
|
|
||||||
use crate::core::{self, DocContext, ImplTraitParam};
|
use crate::core::{self, DocContext, ImplTraitParam};
|
||||||
use crate::formats::item_type::ItemType;
|
use crate::formats::item_type::ItemType;
|
||||||
use crate::visit_ast::Module as DocModule;
|
use crate::visit_ast::{should_ignore_res, Module as DocModule};
|
||||||
|
|
||||||
use utils::*;
|
use utils::*;
|
||||||
|
|
||||||
@ -2809,7 +2809,7 @@ fn clean_use_statement_inner<'tcx>(
|
|||||||
cx: &mut DocContext<'tcx>,
|
cx: &mut DocContext<'tcx>,
|
||||||
inlined_names: &mut FxHashSet<(ItemType, Symbol)>,
|
inlined_names: &mut FxHashSet<(ItemType, Symbol)>,
|
||||||
) -> Vec<Item> {
|
) -> Vec<Item> {
|
||||||
if let Res::Def(DefKind::Ctor(..), _) | Res::SelfCtor(..) = path.res {
|
if should_ignore_res(path.res) {
|
||||||
return Vec::new();
|
return Vec::new();
|
||||||
}
|
}
|
||||||
// We need this comparison because some imports (for std types for example)
|
// We need this comparison because some imports (for std types for example)
|
||||||
|
@ -100,6 +100,11 @@ pub(crate) fn inherits_doc_hidden(
|
|||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub(crate) fn should_ignore_res(res: Res) -> bool {
|
||||||
|
matches!(res, Res::Def(DefKind::Ctor(..), _) | Res::SelfCtor(..))
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) struct RustdocVisitor<'a, 'tcx> {
|
pub(crate) struct RustdocVisitor<'a, 'tcx> {
|
||||||
cx: &'a mut core::DocContext<'tcx>,
|
cx: &'a mut core::DocContext<'tcx>,
|
||||||
view_item_stack: LocalDefIdSet,
|
view_item_stack: LocalDefIdSet,
|
||||||
@ -466,7 +471,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
|
|||||||
for &res in &path.res {
|
for &res in &path.res {
|
||||||
// Struct and variant constructors and proc macro stubs always show up alongside
|
// Struct and variant constructors and proc macro stubs always show up alongside
|
||||||
// their definitions, we've already processed them so just discard these.
|
// their definitions, we've already processed them so just discard these.
|
||||||
if let Res::Def(DefKind::Ctor(..), _) | Res::SelfCtor(..) = res {
|
if should_ignore_res(res) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user