Skip to content

Commit 37d09a6

Browse files
committed
Resolve review comments
1 parent ecda335 commit 37d09a6

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,16 +1699,16 @@ impl<'a, 'tcx> Clean<Generics> for (&'a ty::Generics,
16991699
// Bounds in the type_params and lifetimes fields are repeated in the
17001700
// predicates field (see rustc_typeck::collect::ty_generics), so remove
17011701
// them.
1702-
let stripped_typarams = gens.params.iter().enumerate()
1703-
.filter_map(|(i, param)| match param.kind {
1702+
let stripped_typarams = gens.params.iter()
1703+
.filter_map(|param| match param.kind {
17041704
ty::GenericParamDefKind::Lifetime => None,
17051705
ty::GenericParamDefKind::Type { synthetic, .. } => {
17061706
if param.name.as_symbol() == kw::SelfUpper {
17071707
assert_eq!(param.index, 0);
17081708
return None;
17091709
}
17101710
if synthetic == Some(hir::SyntheticTyParamKind::ImplTrait) {
1711-
impl_trait.insert((i as u32).into(), vec![]);
1711+
impl_trait.insert(param.index.into(), vec![]);
17121712
return None;
17131713
}
17141714
Some(param.clean(cx))

src/test/rustdoc/inline_cross/impl_trait.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,11 @@
33
extern crate impl_trait_aux;
44

55
// @has impl_trait/fn.func.html
6-
// @has - '//pre[@class="rust fn"]' '(_x: impl '
7-
// @has - '//pre[@class="rust fn"]' 'Clone'
8-
// @has - '//pre[@class="rust fn"]' 'Into'
9-
// @has - '//pre[@class="rust fn"]' "'a"
6+
// @has - '//pre[@class="rust fn"]' "pub fn func<'a>(_x: impl Clone + Into<Vec<u8>> + 'a)"
107
// @!has - '//pre[@class="rust fn"]' 'where'
118
pub use impl_trait_aux::func;
129

1310
// @has impl_trait/struct.Foo.html
14-
// @has - '//code[@id="method.v"]' '(_x: impl '
15-
// @has - '//code[@id="method.v"]' 'Clone'
16-
// @has - '//code[@id="method.v"]' 'Into'
17-
// @has - '//code[@id="method.v"]' "'a"
11+
// @has - '//code[@id="method.v"]' "pub fn method<'a>(_x: impl Clone + Into<Vec<u8>> + 'a)"
1812
// @!has - '//code[@id="method.v"]' 'where'
1913
pub use impl_trait_aux::Foo;

0 commit comments

Comments
 (0)