Skip to content

Commit

Permalink
Rollup merge of #92868 - pierwill:librustdoc-clippy, r=camelid
Browse files Browse the repository at this point in the history
librustdoc: Address some clippy lints
  • Loading branch information
matthiaskrgr authored Jan 15, 2022
2 parents c693442 + 7e055c6 commit 8f41559
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
8 changes: 3 additions & 5 deletions src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1191,11 +1191,9 @@ fn render_deref_methods(
}
}
render_assoc_items_inner(w, cx, container_item, did, what, derefs);
} else {
if let Some(prim) = target.primitive_type() {
if let Some(&did) = cache.primitive_locations.get(&prim) {
render_assoc_items_inner(w, cx, container_item, did, what, derefs);
}
} else if let Some(prim) = target.primitive_type() {
if let Some(&did) = cache.primitive_locations.get(&prim) {
render_assoc_items_inner(w, cx, container_item, did, what, derefs);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/librustdoc/html/render/print_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ pub(super) fn print_item(cx: &Context<'_>, item: &clean::Item, buf: &mut Buffer,
};

let item_vars = ItemVars {
page: page,
page,
static_root_path: page.get_static_root_path(),
typ: typ,
typ,
name: item.name.as_ref().unwrap().as_str(),
item_type: &item.type_().to_string(),
path_components: path_components,
path_components,
stability_since_raw: &stability_since_raw,
src_href: src_href.as_deref(),
};
Expand Down
1 change: 1 addition & 0 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#![feature(iter_intersperse)]
#![recursion_limit = "256"]
#![warn(rustc::internal)]
#![allow(clippy::collapsible_if, clippy::collapsible_else_if)]

#[macro_use]
extern crate tracing;
Expand Down
9 changes: 4 additions & 5 deletions src/librustdoc/passes/stripper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ impl<'a> DocFolder for Stripper<'a> {
| clean::TraitAliasItem(..)
| clean::MacroItem(..)
| clean::ForeignTypeItem => {
if i.def_id.is_local() {
if !self.access_levels.is_exported(i.def_id.expect_def_id()) {
debug!("Stripper: stripping {:?} {:?}", i.type_(), i.name);
return None;
}
if i.def_id.is_local() && !self.access_levels.is_exported(i.def_id.expect_def_id())
{
debug!("Stripper: stripping {:?} {:?}", i.type_(), i.name);
return None;
}
}

Expand Down

0 comments on commit 8f41559

Please sign in to comment.