summaryrefslogtreecommitdiffstats
path: root/src/librustdoc/clean/inline.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
commit9918693037dce8aa4bb6f08741b6812923486c18 (patch)
tree21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /src/librustdoc/clean/inline.rs
parentReleasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff)
downloadrustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz
rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/librustdoc/clean/inline.rs')
-rw-r--r--src/librustdoc/clean/inline.rs20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs
index 974ba1e3b..014bcb1a8 100644
--- a/src/librustdoc/clean/inline.rs
+++ b/src/librustdoc/clean/inline.rs
@@ -374,15 +374,17 @@ pub(crate) fn build_impl(
// Only inline impl if the implemented trait is
// reachable in rustdoc generated documentation
- if !did.is_local() && let Some(traitref) = associated_trait {
+ if !did.is_local()
+ && let Some(traitref) = associated_trait
+ {
let did = traitref.def_id;
if !cx.cache.effective_visibilities.is_directly_public(tcx, did) {
return;
}
- if let Some(stab) = tcx.lookup_stability(did) &&
- stab.is_unstable() &&
- stab.feature == sym::rustc_private
+ if let Some(stab) = tcx.lookup_stability(did)
+ && stab.is_unstable()
+ && stab.feature == sym::rustc_private
{
return;
}
@@ -514,7 +516,10 @@ pub(crate) fn build_impl(
}
while let Some(ty) = stack.pop() {
- if let Some(did) = ty.def_id(&cx.cache) && !document_hidden && tcx.is_doc_hidden(did) {
+ if let Some(did) = ty.def_id(&cx.cache)
+ && !document_hidden
+ && tcx.is_doc_hidden(did)
+ {
return;
}
if let Some(generics) = ty.generics() {
@@ -580,7 +585,8 @@ fn build_module_items(
let res = item.res.expect_non_local();
if let Some(def_id) = res.opt_def_id()
&& let Some(allowed_def_ids) = allowed_def_ids
- && !allowed_def_ids.contains(&def_id) {
+ && !allowed_def_ids.contains(&def_id)
+ {
continue;
}
if let Some(def_id) = res.mod_def_id() {
@@ -634,7 +640,7 @@ fn build_module_items(
pub(crate) fn print_inlined_const(tcx: TyCtxt<'_>, did: DefId) -> String {
if let Some(did) = did.as_local() {
- let hir_id = tcx.hir().local_def_id_to_hir_id(did);
+ let hir_id = tcx.local_def_id_to_hir_id(did);
rustc_hir_pretty::id_to_string(&tcx.hir(), hir_id)
} else {
tcx.rendered_const(did).clone()