Skip to content

Commit

Permalink
Rollup merge of #79126 - jyn514:auto, r=GuillaumeGomez
Browse files Browse the repository at this point in the history
Remove duplicate `Trait::auto` field

It was exactly the same as `is_auto`.

I found this while working on #78082, but it's not required for that PR.

r? `@GuillaumeGomez`
  • Loading branch information
m-ou-se authored Nov 17, 2020
2 parents 3d63f25 + 5903163 commit ca38bd4
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/librustdoc/clean/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,13 @@ crate fn build_external_trait(cx: &DocContext<'_>, did: DefId) -> clean::Trait {
let trait_items =
cx.tcx.associated_items(did).in_definition_order().map(|item| item.clean(cx)).collect();

let auto_trait = cx.tcx.trait_def(did).has_auto_impl;
let predicates = cx.tcx.predicates_of(did);
let generics = (cx.tcx.generics_of(did), predicates).clean(cx);
let generics = filter_non_trait_generics(did, generics);
let (generics, supertrait_bounds) = separate_supertrait_bounds(generics);
let is_spotlight = load_attrs(cx, did).clean(cx).has_doc_flag(sym::spotlight);
let is_auto = cx.tcx.trait_is_auto(did);
clean::Trait {
auto: auto_trait,
unsafety: cx.tcx.trait_def(did).unsafety,
generics,
items: trait_items,
Expand Down
1 change: 0 additions & 1 deletion src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@ impl Clean<Item> for doctree::Trait<'_> {
stability: cx.stability(self.id),
deprecation: cx.deprecation(self.id).clean(cx),
kind: TraitItem(Trait {
auto: self.is_auto.clean(cx),
unsafety: self.unsafety,
items: self.items.iter().map(|ti| ti.clean(cx)).collect(),
generics: self.generics.clean(cx),
Expand Down
1 change: 0 additions & 1 deletion src/librustdoc/clean/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,6 @@ impl GetDefId for FnRetTy {

#[derive(Clone, Debug)]
crate struct Trait {
crate auto: bool,
crate unsafety: hir::Unsafety,
crate items: Vec<Item>,
crate generics: Generics,
Expand Down
6 changes: 3 additions & 3 deletions src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2761,7 +2761,7 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait,
}
write_loading_content(w, "</div>");

if t.auto {
if t.is_auto {
write_small_section_header(
w,
"synthetic-implementors",
Expand Down Expand Up @@ -2792,7 +2792,7 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait,
);
write_loading_content(w, "</div>");

if t.auto {
if t.is_auto {
write_small_section_header(
w,
"synthetic-implementors",
Expand Down Expand Up @@ -4457,7 +4457,7 @@ fn sidebar_trait(buf: &mut Buffer, it: &clean::Item, t: &clean::Trait) {
sidebar.push_str(&sidebar_assoc_items(it));

sidebar.push_str("<a class=\"sidebar-title\" href=\"#implementors\">Implementors</a>");
if t.auto {
if t.is_auto {
sidebar.push_str(
"<a class=\"sidebar-title\" \
href=\"#synthetic-implementors\">Auto Implementors</a>",
Expand Down

0 comments on commit ca38bd4

Please sign in to comment.