Skip to content

Commit 346a442

Browse files
committed
use same param name across methods
1 parent de69a3b commit 346a442

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/librustdoc/html/format.rs

+10-7
Original file line numberDiff line numberDiff line change
@@ -561,14 +561,14 @@ impl<'a> fmt::Display for HRef<'a> {
561561
}
562562
}
563563

564-
fn fmt_type(t: &clean::Type, f: &mut fmt::Formatter, full_path: bool) -> fmt::Result {
564+
fn fmt_type(t: &clean::Type, f: &mut fmt::Formatter, use_absolute: bool) -> fmt::Result {
565565
match *t {
566566
clean::Generic(ref name) => {
567567
f.write_str(name)
568568
}
569569
clean::ResolvedPath{ did, ref typarams, ref path, is_generic } => {
570570
// Paths like T::Output and Self::Output should be rendered with all segments
571-
resolved_path(f, did, path, is_generic, full_path)?;
571+
resolved_path(f, did, path, is_generic, use_absolute)?;
572572
tybounds(f, typarams)
573573
}
574574
clean::Infer => write!(f, "_"),
@@ -727,7 +727,7 @@ fn fmt_type(t: &clean::Type, f: &mut fmt::Formatter, full_path: bool) -> fmt::Re
727727
write!(f, "{}::", self_type)?;
728728
}
729729
let path = clean::Path::singleton(name.clone());
730-
resolved_path(f, did, &path, true, full_path)?;
730+
resolved_path(f, did, &path, true, use_absolute)?;
731731

732732
// FIXME: `typarams` are not rendered, and this seems bad?
733733
drop(typarams);
@@ -752,7 +752,10 @@ impl fmt::Display for clean::Type {
752752
}
753753
}
754754

755-
fn fmt_impl(i: &clean::Impl, f: &mut fmt::Formatter, link_trait: bool, full: bool) -> fmt::Result {
755+
fn fmt_impl(i: &clean::Impl,
756+
f: &mut fmt::Formatter,
757+
link_trait: bool,
758+
use_absolute: bool) -> fmt::Result {
756759
let mut plain = String::new();
757760

758761
if f.alternate() {
@@ -786,7 +789,7 @@ fn fmt_impl(i: &clean::Impl, f: &mut fmt::Formatter, link_trait: bool, full: boo
786789
plain.push_str(" for ");
787790
}
788791

789-
fmt_type(&i.for_, f, full)?;
792+
fmt_type(&i.for_, f, use_absolute)?;
790793
plain.push_str(&format!("{:#}", i.for_));
791794

792795
fmt::Display::fmt(&WhereClause(&i.generics, plain.len() + 1), f)?;
@@ -802,8 +805,8 @@ impl fmt::Display for clean::Impl {
802805
// The difference from above is that trait is not hyperlinked.
803806
pub fn fmt_impl_for_trait_page(i: &clean::Impl,
804807
f: &mut fmt::Formatter,
805-
disambiguate: bool) -> fmt::Result {
806-
fmt_impl(i, f, false, disambiguate)
808+
use_absolute: bool) -> fmt::Result {
809+
fmt_impl(i, f, false, use_absolute)
807810
}
808811

809812
impl fmt::Display for clean::Arguments {

src/librustdoc/html/render.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2122,14 +2122,14 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
21222122
write!(w, "<li><code>")?;
21232123
// If there's already another implementor that has the same abbridged name, use the
21242124
// full path, for example in `std::iter::ExactSizeIterator`
2125-
let dissambiguate = if let clean::Type::ResolvedPath {
2125+
let use_absolute = if let clean::Type::ResolvedPath {
21262126
ref path, ..
21272127
} = implementor.impl_.for_ {
21282128
implementor_count[path.last_name()] > 1
21292129
} else {
21302130
false
21312131
};
2132-
fmt_impl_for_trait_page(&implementor.impl_, w, dissambiguate)?;
2132+
fmt_impl_for_trait_page(&implementor.impl_, w, use_absolute)?;
21332133
writeln!(w, "</code></li>")?;
21342134
}
21352135
}

0 commit comments

Comments
 (0)