summaryrefslogtreecommitdiffstats
path: root/src/librustdoc/passes/stripper.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/passes/stripper.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/passes/stripper.rs')
-rw-r--r--src/librustdoc/passes/stripper.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/librustdoc/passes/stripper.rs b/src/librustdoc/passes/stripper.rs
index b35618415..df955421b 100644
--- a/src/librustdoc/passes/stripper.rs
+++ b/src/librustdoc/passes/stripper.rs
@@ -208,24 +208,25 @@ impl<'a> DocFolder for ImplStripper<'a, '_> {
// Because we don't inline in `maybe_inline_local` if the output format is JSON,
// we need to make a special check for JSON output: we want to keep it unless it has
// a `#[doc(hidden)]` attribute if the `for_` type is exported.
- if let Some(did) = imp.for_.def_id(self.cache) &&
- !imp.for_.is_assoc_ty() && !self.should_keep_impl(&i, did)
+ if let Some(did) = imp.for_.def_id(self.cache)
+ && !imp.for_.is_assoc_ty()
+ && !self.should_keep_impl(&i, did)
{
debug!("ImplStripper: impl item for stripped type; removing");
return None;
}
- if let Some(did) = imp.trait_.as_ref().map(|t| t.def_id()) &&
- !self.should_keep_impl(&i, did) {
+ if let Some(did) = imp.trait_.as_ref().map(|t| t.def_id())
+ && !self.should_keep_impl(&i, did)
+ {
debug!("ImplStripper: impl item for stripped trait; removing");
return None;
}
if let Some(generics) = imp.trait_.as_ref().and_then(|t| t.generics()) {
for typaram in generics {
- if let Some(did) = typaram.def_id(self.cache) && !self.should_keep_impl(&i, did)
+ if let Some(did) = typaram.def_id(self.cache)
+ && !self.should_keep_impl(&i, did)
{
- debug!(
- "ImplStripper: stripped item in trait's generics; removing impl"
- );
+ debug!("ImplStripper: stripped item in trait's generics; removing impl");
return None;
}
}