Revert explicit lifetimes

This commit is contained in:
Jack Huey 2020-12-16 19:14:21 -05:00
parent 30187c81f6
commit 84f82d348c
3 changed files with 160 additions and 168 deletions

View File

@ -314,12 +314,12 @@ pub struct GenericArgs<'hir> {
pub parenthesized: bool, pub parenthesized: bool,
} }
impl<'tcx> GenericArgs<'tcx> { impl GenericArgs<'_> {
pub const fn none() -> Self { pub const fn none() -> Self {
Self { args: &[], bindings: &[], parenthesized: false } Self { args: &[], bindings: &[], parenthesized: false }
} }
pub fn inputs(&self) -> &[Ty<'tcx>] { pub fn inputs(&self) -> &[Ty<'_>] {
if self.parenthesized { if self.parenthesized {
for arg in self.args { for arg in self.args {
match arg { match arg {

View File

@ -48,42 +48,42 @@ crate use self::types::Type::*;
crate use self::types::Visibility::{Inherited, Public}; crate use self::types::Visibility::{Inherited, Public};
crate use self::types::*; crate use self::types::*;
crate trait Clean<'tcx, T> { crate trait Clean<T> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> T; fn clean(&self, cx: &mut DocContext<'_>) -> T;
} }
impl<'tcx, T: Clean<'tcx, U>, U> Clean<'tcx, Vec<U>> for [T] { impl<T: Clean<U>, U> Clean<Vec<U>> for [T] {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Vec<U> { fn clean(&self, cx: &mut DocContext<'_>) -> Vec<U> {
self.iter().map(|x| x.clean(cx)).collect() self.iter().map(|x| x.clean(cx)).collect()
} }
} }
impl<'tcx, T: Clean<'tcx, U>, U, V: Idx> Clean<'tcx, IndexVec<V, U>> for IndexVec<V, T> { impl<T: Clean<U>, U, V: Idx> Clean<IndexVec<V, U>> for IndexVec<V, T> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> IndexVec<V, U> { fn clean(&self, cx: &mut DocContext<'_>) -> IndexVec<V, U> {
self.iter().map(|x| x.clean(cx)).collect() self.iter().map(|x| x.clean(cx)).collect()
} }
} }
impl<'tcx, T: Clean<'tcx, U>, U> Clean<'tcx, U> for &T { impl<T: Clean<U>, U> Clean<U> for &T {
fn clean(&self, cx: &mut DocContext<'tcx>) -> U { fn clean(&self, cx: &mut DocContext<'_>) -> U {
(**self).clean(cx) (**self).clean(cx)
} }
} }
impl<'tcx, T: Clean<'tcx, U>, U> Clean<'tcx, U> for Rc<T> { impl<T: Clean<U>, U> Clean<U> for Rc<T> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> U { fn clean(&self, cx: &mut DocContext<'_>) -> U {
(**self).clean(cx) (**self).clean(cx)
} }
} }
impl<'tcx, T: Clean<'tcx, U>, U> Clean<'tcx, Option<U>> for Option<T> { impl<T: Clean<U>, U> Clean<Option<U>> for Option<T> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Option<U> { fn clean(&self, cx: &mut DocContext<'_>) -> Option<U> {
self.as_ref().map(|v| v.clean(cx)) self.as_ref().map(|v| v.clean(cx))
} }
} }
impl<'tcx> Clean<'tcx, ExternalCrate> for CrateNum { impl Clean<ExternalCrate> for CrateNum {
fn clean(&self, cx: &mut DocContext<'tcx>) -> ExternalCrate { fn clean(&self, cx: &mut DocContext<'_>) -> ExternalCrate {
let tcx = cx.tcx; let tcx = cx.tcx;
let root = DefId { krate: *self, index: CRATE_DEF_INDEX }; let root = DefId { krate: *self, index: CRATE_DEF_INDEX };
let krate_span = tcx.def_span(root); let krate_span = tcx.def_span(root);
@ -204,8 +204,8 @@ impl<'tcx> Clean<'tcx, ExternalCrate> for CrateNum {
} }
} }
impl<'tcx> Clean<'tcx, Item> for doctree::Module<'tcx> { impl Clean<Item> for doctree::Module<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item { fn clean(&self, cx: &mut DocContext<'_>) -> Item {
let mut items: Vec<Item> = vec![]; let mut items: Vec<Item> = vec![];
items.extend(self.foreigns.iter().map(|x| x.clean(cx))); items.extend(self.foreigns.iter().map(|x| x.clean(cx)));
items.extend(self.mods.iter().map(|x| x.clean(cx))); items.extend(self.mods.iter().map(|x| x.clean(cx)));
@ -237,14 +237,14 @@ impl<'tcx> Clean<'tcx, Item> for doctree::Module<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, Attributes> for [ast::Attribute] { impl Clean<Attributes> for [ast::Attribute] {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Attributes { fn clean(&self, cx: &mut DocContext<'_>) -> Attributes {
Attributes::from_ast(cx.sess().diagnostic(), self, None) Attributes::from_ast(cx.sess().diagnostic(), self, None)
} }
} }
impl<'tcx> Clean<'tcx, GenericBound> for hir::GenericBound<'tcx> { impl Clean<GenericBound> for hir::GenericBound<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> GenericBound { fn clean(&self, cx: &mut DocContext<'_>) -> GenericBound {
match *self { match *self {
hir::GenericBound::Outlives(lt) => GenericBound::Outlives(lt.clean(cx)), hir::GenericBound::Outlives(lt) => GenericBound::Outlives(lt.clean(cx)),
hir::GenericBound::LangItemTrait(lang_item, span, _, generic_args) => { hir::GenericBound::LangItemTrait(lang_item, span, _, generic_args) => {
@ -270,8 +270,8 @@ impl<'tcx> Clean<'tcx, GenericBound> for hir::GenericBound<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, Type> for (ty::TraitRef<'tcx>, &[TypeBinding]) { impl Clean<Type> for (ty::TraitRef<'_>, &[TypeBinding]) {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Type { fn clean(&self, cx: &mut DocContext<'_>) -> Type {
let (trait_ref, bounds) = *self; let (trait_ref, bounds) = *self;
inline::record_extern_fqn(cx, trait_ref.def_id, TypeKind::Trait); inline::record_extern_fqn(cx, trait_ref.def_id, TypeKind::Trait);
let path = external_path( let path = external_path(
@ -289,8 +289,8 @@ impl<'tcx> Clean<'tcx, Type> for (ty::TraitRef<'tcx>, &[TypeBinding]) {
} }
} }
impl<'tcx> Clean<'tcx, GenericBound> for ty::TraitRef<'tcx> { impl<'tcx> Clean<GenericBound> for ty::TraitRef<'tcx> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> GenericBound { fn clean(&self, cx: &mut DocContext<'_>) -> GenericBound {
GenericBound::TraitBound( GenericBound::TraitBound(
PolyTrait { trait_: (*self, &[][..]).clean(cx), generic_params: vec![] }, PolyTrait { trait_: (*self, &[][..]).clean(cx), generic_params: vec![] },
hir::TraitBoundModifier::None, hir::TraitBoundModifier::None,
@ -298,8 +298,8 @@ impl<'tcx> Clean<'tcx, GenericBound> for ty::TraitRef<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, GenericBound> for (ty::PolyTraitRef<'tcx>, &[TypeBinding]) { impl Clean<GenericBound> for (ty::PolyTraitRef<'_>, &[TypeBinding]) {
fn clean(&self, cx: &mut DocContext<'tcx>) -> GenericBound { fn clean(&self, cx: &mut DocContext<'_>) -> GenericBound {
let (poly_trait_ref, bounds) = *self; let (poly_trait_ref, bounds) = *self;
let poly_trait_ref = poly_trait_ref.lift_to_tcx(cx.tcx).unwrap(); let poly_trait_ref = poly_trait_ref.lift_to_tcx(cx.tcx).unwrap();
@ -326,14 +326,14 @@ impl<'tcx> Clean<'tcx, GenericBound> for (ty::PolyTraitRef<'tcx>, &[TypeBinding]
} }
} }
impl<'tcx> Clean<'tcx, GenericBound> for ty::PolyTraitRef<'tcx> { impl<'tcx> Clean<GenericBound> for ty::PolyTraitRef<'tcx> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> GenericBound { fn clean(&self, cx: &mut DocContext<'_>) -> GenericBound {
(*self, &[][..]).clean(cx) (*self, &[][..]).clean(cx)
} }
} }
impl<'tcx> Clean<'tcx, Option<Vec<GenericBound>>> for InternalSubsts<'tcx> { impl<'tcx> Clean<Option<Vec<GenericBound>>> for InternalSubsts<'tcx> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Option<Vec<GenericBound>> { fn clean(&self, cx: &mut DocContext<'_>) -> Option<Vec<GenericBound>> {
let mut v = Vec::new(); let mut v = Vec::new();
v.extend(self.regions().filter_map(|r| r.clean(cx)).map(GenericBound::Outlives)); v.extend(self.regions().filter_map(|r| r.clean(cx)).map(GenericBound::Outlives));
v.extend(self.types().map(|t| { v.extend(self.types().map(|t| {
@ -346,8 +346,8 @@ impl<'tcx> Clean<'tcx, Option<Vec<GenericBound>>> for InternalSubsts<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, Lifetime> for hir::Lifetime { impl Clean<Lifetime> for hir::Lifetime {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Lifetime { fn clean(&self, cx: &mut DocContext<'_>) -> Lifetime {
let def = cx.tcx.named_region(self.hir_id); let def = cx.tcx.named_region(self.hir_id);
match def { match def {
Some( Some(
@ -365,8 +365,8 @@ impl<'tcx> Clean<'tcx, Lifetime> for hir::Lifetime {
} }
} }
impl<'tcx> Clean<'tcx, Lifetime> for hir::GenericParam<'tcx> { impl Clean<Lifetime> for hir::GenericParam<'_> {
fn clean(&self, _: &mut DocContext<'tcx>) -> Lifetime { fn clean(&self, _: &mut DocContext<'_>) -> Lifetime {
match self.kind { match self.kind {
hir::GenericParamKind::Lifetime { .. } => { hir::GenericParamKind::Lifetime { .. } => {
if !self.bounds.is_empty() { if !self.bounds.is_empty() {
@ -389,8 +389,8 @@ impl<'tcx> Clean<'tcx, Lifetime> for hir::GenericParam<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, Constant> for hir::ConstArg { impl Clean<Constant> for hir::ConstArg {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Constant { fn clean(&self, cx: &mut DocContext<'_>) -> Constant {
Constant { Constant {
type_: cx type_: cx
.tcx .tcx
@ -401,14 +401,14 @@ impl<'tcx> Clean<'tcx, Constant> for hir::ConstArg {
} }
} }
impl<'tcx> Clean<'tcx, Lifetime> for ty::GenericParamDef { impl Clean<Lifetime> for ty::GenericParamDef {
fn clean(&self, _cx: &mut DocContext<'tcx>) -> Lifetime { fn clean(&self, _cx: &mut DocContext<'_>) -> Lifetime {
Lifetime(self.name) Lifetime(self.name)
} }
} }
impl<'tcx> Clean<'tcx, Option<Lifetime>> for ty::RegionKind { impl Clean<Option<Lifetime>> for ty::RegionKind {
fn clean(&self, _cx: &mut DocContext<'tcx>) -> Option<Lifetime> { fn clean(&self, _cx: &mut DocContext<'_>) -> Option<Lifetime> {
match *self { match *self {
ty::ReStatic => Some(Lifetime::statik()), ty::ReStatic => Some(Lifetime::statik()),
ty::ReLateBound(_, ty::BoundRegion { kind: ty::BrNamed(_, name) }) => { ty::ReLateBound(_, ty::BoundRegion { kind: ty::BrNamed(_, name) }) => {
@ -429,8 +429,8 @@ impl<'tcx> Clean<'tcx, Option<Lifetime>> for ty::RegionKind {
} }
} }
impl<'tcx> Clean<'tcx, WherePredicate> for hir::WherePredicate<'tcx> { impl Clean<WherePredicate> for hir::WherePredicate<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> WherePredicate { fn clean(&self, cx: &mut DocContext<'_>) -> WherePredicate {
match *self { match *self {
hir::WherePredicate::BoundPredicate(ref wbp) => WherePredicate::BoundPredicate { hir::WherePredicate::BoundPredicate(ref wbp) => WherePredicate::BoundPredicate {
ty: wbp.bounded_ty.clean(cx), ty: wbp.bounded_ty.clean(cx),
@ -449,8 +449,8 @@ impl<'tcx> Clean<'tcx, WherePredicate> for hir::WherePredicate<'tcx> {
} }
} }
impl<'a> Clean<'a, Option<WherePredicate>> for ty::Predicate<'a> { impl<'a> Clean<Option<WherePredicate>> for ty::Predicate<'a> {
fn clean(&self, cx: &mut DocContext<'a>) -> Option<WherePredicate> { fn clean(&self, cx: &mut DocContext<'_>) -> Option<WherePredicate> {
let bound_predicate = self.kind(); let bound_predicate = self.kind();
match bound_predicate.skip_binder() { match bound_predicate.skip_binder() {
ty::PredicateKind::Trait(pred, _) => Some(bound_predicate.rebind(pred).clean(cx)), ty::PredicateKind::Trait(pred, _) => Some(bound_predicate.rebind(pred).clean(cx)),
@ -469,8 +469,8 @@ impl<'a> Clean<'a, Option<WherePredicate>> for ty::Predicate<'a> {
} }
} }
impl<'tcx> Clean<'tcx, WherePredicate> for ty::PolyTraitPredicate<'tcx> { impl<'a> Clean<WherePredicate> for ty::PolyTraitPredicate<'a> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> WherePredicate { fn clean(&self, cx: &mut DocContext<'_>) -> WherePredicate {
let poly_trait_ref = self.map_bound(|pred| pred.trait_ref); let poly_trait_ref = self.map_bound(|pred| pred.trait_ref);
WherePredicate::BoundPredicate { WherePredicate::BoundPredicate {
ty: poly_trait_ref.skip_binder().self_ty().clean(cx), ty: poly_trait_ref.skip_binder().self_ty().clean(cx),
@ -479,10 +479,10 @@ impl<'tcx> Clean<'tcx, WherePredicate> for ty::PolyTraitPredicate<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, Option<WherePredicate>> impl<'tcx> Clean<Option<WherePredicate>>
for ty::OutlivesPredicate<ty::Region<'tcx>, ty::Region<'tcx>> for ty::OutlivesPredicate<ty::Region<'tcx>, ty::Region<'tcx>>
{ {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Option<WherePredicate> { fn clean(&self, cx: &mut DocContext<'_>) -> Option<WherePredicate> {
let ty::OutlivesPredicate(a, b) = self; let ty::OutlivesPredicate(a, b) = self;
if let (ty::ReEmpty(_), ty::ReEmpty(_)) = (a, b) { if let (ty::ReEmpty(_), ty::ReEmpty(_)) = (a, b) {
@ -496,10 +496,8 @@ impl<'tcx> Clean<'tcx, Option<WherePredicate>>
} }
} }
impl<'tcx> Clean<'tcx, Option<WherePredicate>> impl<'tcx> Clean<Option<WherePredicate>> for ty::OutlivesPredicate<Ty<'tcx>, ty::Region<'tcx>> {
for ty::OutlivesPredicate<Ty<'tcx>, ty::Region<'tcx>> fn clean(&self, cx: &mut DocContext<'_>) -> Option<WherePredicate> {
{
fn clean(&self, cx: &mut DocContext<'tcx>) -> Option<WherePredicate> {
let ty::OutlivesPredicate(ty, lt) = self; let ty::OutlivesPredicate(ty, lt) = self;
if let ty::ReEmpty(_) = lt { if let ty::ReEmpty(_) = lt {
@ -513,15 +511,15 @@ impl<'tcx> Clean<'tcx, Option<WherePredicate>>
} }
} }
impl<'tcx> Clean<'tcx, WherePredicate> for ty::ProjectionPredicate<'tcx> { impl<'tcx> Clean<WherePredicate> for ty::ProjectionPredicate<'tcx> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> WherePredicate { fn clean(&self, cx: &mut DocContext<'_>) -> WherePredicate {
let ty::ProjectionPredicate { projection_ty, ty } = self; let ty::ProjectionPredicate { projection_ty, ty } = self;
WherePredicate::EqPredicate { lhs: projection_ty.clean(cx), rhs: ty.clean(cx) } WherePredicate::EqPredicate { lhs: projection_ty.clean(cx), rhs: ty.clean(cx) }
} }
} }
impl<'tcx> Clean<'tcx, Type> for ty::ProjectionTy<'tcx> { impl<'tcx> Clean<Type> for ty::ProjectionTy<'tcx> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Type { fn clean(&self, cx: &mut DocContext<'_>) -> Type {
let lifted = self.lift_to_tcx(cx.tcx).unwrap(); let lifted = self.lift_to_tcx(cx.tcx).unwrap();
let trait_ = match lifted.trait_ref(cx.tcx).clean(cx) { let trait_ = match lifted.trait_ref(cx.tcx).clean(cx) {
GenericBound::TraitBound(t, _) => t.trait_, GenericBound::TraitBound(t, _) => t.trait_,
@ -535,8 +533,8 @@ impl<'tcx> Clean<'tcx, Type> for ty::ProjectionTy<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, GenericParamDef> for ty::GenericParamDef { impl Clean<GenericParamDef> for ty::GenericParamDef {
fn clean(&self, cx: &mut DocContext<'tcx>) -> GenericParamDef { fn clean(&self, cx: &mut DocContext<'_>) -> GenericParamDef {
let (name, kind) = match self.kind { let (name, kind) = match self.kind {
ty::GenericParamDefKind::Lifetime => (self.name, GenericParamDefKind::Lifetime), ty::GenericParamDefKind::Lifetime => (self.name, GenericParamDefKind::Lifetime),
ty::GenericParamDefKind::Type { has_default, synthetic, .. } => { ty::GenericParamDefKind::Type { has_default, synthetic, .. } => {
@ -565,8 +563,8 @@ impl<'tcx> Clean<'tcx, GenericParamDef> for ty::GenericParamDef {
} }
} }
impl<'tcx> Clean<'tcx, GenericParamDef> for hir::GenericParam<'tcx> { impl Clean<GenericParamDef> for hir::GenericParam<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> GenericParamDef { fn clean(&self, cx: &mut DocContext<'_>) -> GenericParamDef {
let (name, kind) = match self.kind { let (name, kind) = match self.kind {
hir::GenericParamKind::Lifetime { .. } => { hir::GenericParamKind::Lifetime { .. } => {
let name = if !self.bounds.is_empty() { let name = if !self.bounds.is_empty() {
@ -608,8 +606,8 @@ impl<'tcx> Clean<'tcx, GenericParamDef> for hir::GenericParam<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, Generics> for hir::Generics<'tcx> { impl Clean<Generics> for hir::Generics<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Generics { fn clean(&self, cx: &mut DocContext<'_>) -> Generics {
// Synthetic type-parameters are inserted after normal ones. // Synthetic type-parameters are inserted after normal ones.
// In order for normal parameters to be able to refer to synthetic ones, // In order for normal parameters to be able to refer to synthetic ones,
// scans them first. // scans them first.
@ -688,8 +686,8 @@ impl<'tcx> Clean<'tcx, Generics> for hir::Generics<'tcx> {
} }
} }
impl<'a, 'tcx> Clean<'tcx, Generics> for (&'a ty::Generics, ty::GenericPredicates<'tcx>) { impl<'a, 'tcx> Clean<Generics> for (&'a ty::Generics, ty::GenericPredicates<'tcx>) {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Generics { fn clean(&self, cx: &mut DocContext<'_>) -> Generics {
use self::WherePredicate as WP; use self::WherePredicate as WP;
use std::collections::BTreeMap; use std::collections::BTreeMap;
@ -853,13 +851,13 @@ impl<'a, 'tcx> Clean<'tcx, Generics> for (&'a ty::Generics, ty::GenericPredicate
} }
} }
fn clean_fn_or_proc_macro<'a, 'tcx>( fn clean_fn_or_proc_macro(
item: &hir::Item<'tcx>, item: &hir::Item<'_>,
sig: &'a hir::FnSig<'tcx>, sig: &'a hir::FnSig<'a>,
generics: &'a hir::Generics<'tcx>, generics: &'a hir::Generics<'a>,
body_id: hir::BodyId, body_id: hir::BodyId,
name: &mut Symbol, name: &mut Symbol,
cx: &mut DocContext<'tcx>, cx: &mut DocContext<'_>,
) -> ItemKind { ) -> ItemKind {
let attrs = cx.tcx.hir().attrs(item.hir_id()); let attrs = cx.tcx.hir().attrs(item.hir_id());
let macro_kind = attrs.iter().find_map(|a| { let macro_kind = attrs.iter().find_map(|a| {
@ -913,18 +911,16 @@ fn clean_fn_or_proc_macro<'a, 'tcx>(
} }
} }
impl<'a, 'tcx> Clean<'tcx, Function> impl<'a> Clean<Function> for (&'a hir::FnSig<'a>, &'a hir::Generics<'a>, hir::BodyId) {
for (&'a hir::FnSig<'tcx>, &'a hir::Generics<'tcx>, hir::BodyId) fn clean(&self, cx: &mut DocContext<'_>) -> Function {
{
fn clean(&self, cx: &mut DocContext<'tcx>) -> Function {
let (generics, decl) = let (generics, decl) =
enter_impl_trait(cx, |cx| (self.1.clean(cx), (&*self.0.decl, self.2).clean(cx))); enter_impl_trait(cx, |cx| (self.1.clean(cx), (&*self.0.decl, self.2).clean(cx)));
Function { decl, generics, header: self.0.header } Function { decl, generics, header: self.0.header }
} }
} }
impl<'a, 'tcx> Clean<'tcx, Arguments> for (&'a [hir::Ty<'tcx>], &'a [Ident]) { impl<'a> Clean<Arguments> for (&'a [hir::Ty<'a>], &'a [Ident]) {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Arguments { fn clean(&self, cx: &mut DocContext<'_>) -> Arguments {
Arguments { Arguments {
values: self values: self
.0 .0
@ -942,8 +938,8 @@ impl<'a, 'tcx> Clean<'tcx, Arguments> for (&'a [hir::Ty<'tcx>], &'a [Ident]) {
} }
} }
impl<'a, 'tcx> Clean<'tcx, Arguments> for (&'a [hir::Ty<'tcx>], hir::BodyId) { impl<'a> Clean<Arguments> for (&'a [hir::Ty<'a>], hir::BodyId) {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Arguments { fn clean(&self, cx: &mut DocContext<'_>) -> Arguments {
let body = cx.tcx.hir().body(self.1); let body = cx.tcx.hir().body(self.1);
Arguments { Arguments {
@ -952,7 +948,7 @@ impl<'a, 'tcx> Clean<'tcx, Arguments> for (&'a [hir::Ty<'tcx>], hir::BodyId) {
.iter() .iter()
.enumerate() .enumerate()
.map(|(i, ty)| Argument { .map(|(i, ty)| Argument {
name: Symbol::intern(&rustc_hir_pretty::param_to_string(&body.params[i])), name: name_from_pat(&body.params[i].pat),
type_: ty.clean(cx), type_: ty.clean(cx),
}) })
.collect(), .collect(),
@ -960,13 +956,13 @@ impl<'a, 'tcx> Clean<'tcx, Arguments> for (&'a [hir::Ty<'tcx>], hir::BodyId) {
} }
} }
impl<'a, 'tcx, A: Copy> Clean<'tcx, FnDecl> for (&'a hir::FnDecl<'tcx>, A) impl<'a, A: Copy> Clean<FnDecl> for (&'a hir::FnDecl<'a>, A)
where where
(&'a [hir::Ty<'a>], A): Clean<'tcx, Arguments>, (&'a [hir::Ty<'a>], A): Clean<Arguments>,
{ {
fn clean(&self, cx: &mut DocContext<'tcx>) -> FnDecl { fn clean(&self, cx: &mut DocContext<'_>) -> FnDecl {
FnDecl { FnDecl {
inputs: (&self.0.inputs[..], self.1).clean(cx), inputs: (self.0.inputs, self.1).clean(cx),
output: self.0.output.clean(cx), output: self.0.output.clean(cx),
c_variadic: self.0.c_variadic, c_variadic: self.0.c_variadic,
attrs: Attributes::default(), attrs: Attributes::default(),
@ -974,8 +970,8 @@ where
} }
} }
impl<'tcx> Clean<'tcx, FnDecl> for (DefId, ty::PolyFnSig<'tcx>) { impl<'tcx> Clean<FnDecl> for (DefId, ty::PolyFnSig<'tcx>) {
fn clean(&self, cx: &mut DocContext<'tcx>) -> FnDecl { fn clean(&self, cx: &mut DocContext<'_>) -> FnDecl {
let (did, sig) = *self; let (did, sig) = *self;
let mut names = if did.is_local() { &[] } else { cx.tcx.fn_arg_names(did) }.iter(); let mut names = if did.is_local() { &[] } else { cx.tcx.fn_arg_names(did) }.iter();
@ -998,8 +994,8 @@ impl<'tcx> Clean<'tcx, FnDecl> for (DefId, ty::PolyFnSig<'tcx>) {
} }
} }
impl<'tcx> Clean<'tcx, FnRetTy> for hir::FnRetTy<'tcx> { impl Clean<FnRetTy> for hir::FnRetTy<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> FnRetTy { fn clean(&self, cx: &mut DocContext<'_>) -> FnRetTy {
match *self { match *self {
Self::Return(ref typ) => Return(typ.clean(cx)), Self::Return(ref typ) => Return(typ.clean(cx)),
Self::DefaultReturn(..) => DefaultReturn, Self::DefaultReturn(..) => DefaultReturn,
@ -1007,7 +1003,7 @@ impl<'tcx> Clean<'tcx, FnRetTy> for hir::FnRetTy<'tcx> {
} }
} }
impl Clean<'_, bool> for hir::IsAuto { impl Clean<bool> for hir::IsAuto {
fn clean(&self, _: &mut DocContext<'_>) -> bool { fn clean(&self, _: &mut DocContext<'_>) -> bool {
match *self { match *self {
hir::IsAuto::Yes => true, hir::IsAuto::Yes => true,
@ -1016,15 +1012,15 @@ impl Clean<'_, bool> for hir::IsAuto {
} }
} }
impl<'tcx> Clean<'tcx, Type> for hir::TraitRef<'tcx> { impl Clean<Type> for hir::TraitRef<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Type { fn clean(&self, cx: &mut DocContext<'_>) -> Type {
let path = self.path.clean(cx); let path = self.path.clean(cx);
resolve_type(cx, path, self.hir_ref_id) resolve_type(cx, path, self.hir_ref_id)
} }
} }
impl<'tcx> Clean<'tcx, PolyTrait> for hir::PolyTraitRef<'tcx> { impl Clean<PolyTrait> for hir::PolyTraitRef<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> PolyTrait { fn clean(&self, cx: &mut DocContext<'_>) -> PolyTrait {
PolyTrait { PolyTrait {
trait_: self.trait_ref.clean(cx), trait_: self.trait_ref.clean(cx),
generic_params: self.bound_generic_params.clean(cx), generic_params: self.bound_generic_params.clean(cx),
@ -1032,14 +1028,14 @@ impl<'tcx> Clean<'tcx, PolyTrait> for hir::PolyTraitRef<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, TypeKind> for hir::def::DefKind { impl Clean<TypeKind> for hir::def::DefKind {
fn clean(&self, _: &mut DocContext<'tcx>) -> TypeKind { fn clean(&self, _: &mut DocContext<'_>) -> TypeKind {
(*self).into() (*self).into()
} }
} }
impl<'tcx> Clean<'tcx, Item> for hir::TraitItem<'tcx> { impl Clean<Item> for hir::TraitItem<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item { fn clean(&self, cx: &mut DocContext<'_>) -> Item {
let local_did = self.def_id.to_def_id(); let local_did = self.def_id.to_def_id();
cx.with_param_env(local_did, |cx| { cx.with_param_env(local_did, |cx| {
let inner = match self.kind { let inner = match self.kind {
@ -1079,8 +1075,8 @@ impl<'tcx> Clean<'tcx, Item> for hir::TraitItem<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, Item> for hir::ImplItem<'tcx> { impl Clean<Item> for hir::ImplItem<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item { fn clean(&self, cx: &mut DocContext<'_>) -> Item {
let local_did = self.def_id.to_def_id(); let local_did = self.def_id.to_def_id();
cx.with_param_env(local_did, |cx| { cx.with_param_env(local_did, |cx| {
let inner = match self.kind { let inner = match self.kind {
@ -1128,8 +1124,8 @@ impl<'tcx> Clean<'tcx, Item> for hir::ImplItem<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, Item> for ty::AssocItem { impl Clean<Item> for ty::AssocItem {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item { fn clean(&self, cx: &mut DocContext<'_>) -> Item {
let tcx = cx.tcx; let tcx = cx.tcx;
let kind = match self.kind { let kind = match self.kind {
ty::AssocKind::Const => { ty::AssocKind::Const => {
@ -1280,7 +1276,7 @@ impl<'tcx> Clean<'tcx, Item> for ty::AssocItem {
} }
} }
fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type { fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type {
use rustc_hir::GenericParamCount; use rustc_hir::GenericParamCount;
let hir::Ty { hir_id, span, ref kind } = *hir_ty; let hir::Ty { hir_id, span, ref kind } = *hir_ty;
let qpath = match kind { let qpath = match kind {
@ -1432,8 +1428,8 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
} }
} }
impl<'tcx> Clean<'tcx, Type> for hir::Ty<'tcx> { impl Clean<Type> for hir::Ty<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Type { fn clean(&self, cx: &mut DocContext<'_>) -> Type {
use rustc_hir::*; use rustc_hir::*;
match self.kind { match self.kind {
@ -1535,8 +1531,8 @@ fn normalize(cx: &mut DocContext<'tcx>, ty: Ty<'_>) -> Option<Ty<'tcx>> {
} }
} }
impl<'tcx> Clean<'tcx, Type> for Ty<'tcx> { impl<'tcx> Clean<Type> for Ty<'tcx> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Type { fn clean(&self, cx: &mut DocContext<'_>) -> Type {
debug!("cleaning type: {:?}", self); debug!("cleaning type: {:?}", self);
let ty = normalize(cx, self).unwrap_or(self); let ty = normalize(cx, self).unwrap_or(self);
match *ty.kind() { match *ty.kind() {
@ -1743,8 +1739,8 @@ impl<'tcx> Clean<'tcx, Type> for Ty<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, Constant> for ty::Const<'tcx> { impl<'tcx> Clean<Constant> for ty::Const<'tcx> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Constant { fn clean(&self, cx: &mut DocContext<'_>) -> Constant {
// FIXME: instead of storing the stringified expression, store `self` directly instead. // FIXME: instead of storing the stringified expression, store `self` directly instead.
Constant { Constant {
type_: self.ty.clean(cx), type_: self.ty.clean(cx),
@ -1753,8 +1749,8 @@ impl<'tcx> Clean<'tcx, Constant> for ty::Const<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, Item> for hir::FieldDef<'tcx> { impl Clean<Item> for hir::FieldDef<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item { fn clean(&self, cx: &mut DocContext<'_>) -> Item {
let what_rustc_thinks = Item::from_hir_id_and_parts( let what_rustc_thinks = Item::from_hir_id_and_parts(
self.hir_id, self.hir_id,
Some(self.ident.name), Some(self.ident.name),
@ -1766,8 +1762,8 @@ impl<'tcx> Clean<'tcx, Item> for hir::FieldDef<'tcx> {
} }
} }
impl Clean<'tcx, Item> for ty::FieldDef { impl Clean<Item> for ty::FieldDef {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item { fn clean(&self, cx: &mut DocContext<'_>) -> Item {
let what_rustc_thinks = Item::from_def_id_and_parts( let what_rustc_thinks = Item::from_def_id_and_parts(
self.did, self.did,
Some(self.ident.name), Some(self.ident.name),
@ -1779,8 +1775,8 @@ impl Clean<'tcx, Item> for ty::FieldDef {
} }
} }
impl<'tcx> Clean<'tcx, Visibility> for hir::Visibility<'tcx> { impl Clean<Visibility> for hir::Visibility<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Visibility { fn clean(&self, cx: &mut DocContext<'_>) -> Visibility {
match self.node { match self.node {
hir::VisibilityKind::Public => Visibility::Public, hir::VisibilityKind::Public => Visibility::Public,
hir::VisibilityKind::Inherited => Visibility::Inherited, hir::VisibilityKind::Inherited => Visibility::Inherited,
@ -1797,8 +1793,8 @@ impl<'tcx> Clean<'tcx, Visibility> for hir::Visibility<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, Visibility> for ty::Visibility { impl Clean<Visibility> for ty::Visibility {
fn clean(&self, _cx: &mut DocContext<'tcx>) -> Visibility { fn clean(&self, _cx: &mut DocContext<'_>) -> Visibility {
match *self { match *self {
ty::Visibility::Public => Visibility::Public, ty::Visibility::Public => Visibility::Public,
// NOTE: this is not quite right: `ty` uses `Invisible` to mean 'private', // NOTE: this is not quite right: `ty` uses `Invisible` to mean 'private',
@ -1812,8 +1808,8 @@ impl<'tcx> Clean<'tcx, Visibility> for ty::Visibility {
} }
} }
impl<'tcx> Clean<'tcx, VariantStruct> for rustc_hir::VariantData<'tcx> { impl Clean<VariantStruct> for rustc_hir::VariantData<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> VariantStruct { fn clean(&self, cx: &mut DocContext<'_>) -> VariantStruct {
VariantStruct { VariantStruct {
struct_type: CtorKind::from_hir(self), struct_type: CtorKind::from_hir(self),
fields: self.fields().iter().map(|x| x.clean(cx)).collect(), fields: self.fields().iter().map(|x| x.clean(cx)).collect(),
@ -1822,8 +1818,8 @@ impl<'tcx> Clean<'tcx, VariantStruct> for rustc_hir::VariantData<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, Item> for ty::VariantDef { impl Clean<Item> for ty::VariantDef {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item { fn clean(&self, cx: &mut DocContext<'_>) -> Item {
let kind = match self.ctor_kind { let kind = match self.ctor_kind {
CtorKind::Const => Variant::CLike, CtorKind::Const => Variant::CLike,
CtorKind::Fn => Variant::Tuple( CtorKind::Fn => Variant::Tuple(
@ -1853,8 +1849,8 @@ impl<'tcx> Clean<'tcx, Item> for ty::VariantDef {
} }
} }
impl<'tcx> Clean<'tcx, Variant> for hir::VariantData<'tcx> { impl Clean<Variant> for hir::VariantData<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Variant { fn clean(&self, cx: &mut DocContext<'_>) -> Variant {
match self { match self {
hir::VariantData::Struct(..) => Variant::Struct(self.clean(cx)), hir::VariantData::Struct(..) => Variant::Struct(self.clean(cx)),
hir::VariantData::Tuple(..) => { hir::VariantData::Tuple(..) => {
@ -1865,14 +1861,14 @@ impl<'tcx> Clean<'tcx, Variant> for hir::VariantData<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, Span> for rustc_span::Span { impl Clean<Span> for rustc_span::Span {
fn clean(&self, _cx: &mut DocContext<'tcx>) -> Span { fn clean(&self, _cx: &mut DocContext<'_>) -> Span {
Span::from_rustc_span(*self) Span::from_rustc_span(*self)
} }
} }
impl<'tcx> Clean<'tcx, Path> for hir::Path<'tcx> { impl Clean<Path> for hir::Path<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Path { fn clean(&self, cx: &mut DocContext<'_>) -> Path {
Path { Path {
global: self.is_global(), global: self.is_global(),
res: self.res, res: self.res,
@ -1881,8 +1877,8 @@ impl<'tcx> Clean<'tcx, Path> for hir::Path<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, GenericArgs> for hir::GenericArgs<'tcx> { impl Clean<GenericArgs> for hir::GenericArgs<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> GenericArgs { fn clean(&self, cx: &mut DocContext<'_>) -> GenericArgs {
if self.parenthesized { if self.parenthesized {
let output = self.bindings[0].ty().clean(cx); let output = self.bindings[0].ty().clean(cx);
GenericArgs::Parenthesized { GenericArgs::Parenthesized {
@ -1909,28 +1905,28 @@ impl<'tcx> Clean<'tcx, GenericArgs> for hir::GenericArgs<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, PathSegment> for hir::PathSegment<'tcx> { impl Clean<PathSegment> for hir::PathSegment<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> PathSegment { fn clean(&self, cx: &mut DocContext<'_>) -> PathSegment {
PathSegment { name: self.ident.name, args: self.args().clean(cx) } PathSegment { name: self.ident.name, args: self.args().clean(cx) }
} }
} }
impl<'tcx> Clean<'tcx, String> for Ident { impl Clean<String> for Ident {
#[inline] #[inline]
fn clean(&self, cx: &mut DocContext<'tcx>) -> String { fn clean(&self, cx: &mut DocContext<'_>) -> String {
self.name.clean(cx) self.name.clean(cx)
} }
} }
impl<'tcx> Clean<'tcx, String> for Symbol { impl Clean<String> for Symbol {
#[inline] #[inline]
fn clean(&self, _: &mut DocContext<'tcx>) -> String { fn clean(&self, _: &mut DocContext<'_>) -> String {
self.to_string() self.to_string()
} }
} }
impl<'tcx> Clean<'tcx, BareFunctionDecl> for hir::BareFnTy<'tcx> { impl Clean<BareFunctionDecl> for hir::BareFnTy<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> BareFunctionDecl { fn clean(&self, cx: &mut DocContext<'_>) -> BareFunctionDecl {
let (generic_params, decl) = enter_impl_trait(cx, |cx| { let (generic_params, decl) = enter_impl_trait(cx, |cx| {
(self.generic_params.clean(cx), (&*self.decl, self.param_names).clean(cx)) (self.generic_params.clean(cx), (&*self.decl, self.param_names).clean(cx))
}); });
@ -1938,8 +1934,8 @@ impl<'tcx> Clean<'tcx, BareFunctionDecl> for hir::BareFnTy<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, Vec<Item>> for (&hir::Item<'tcx>, Option<Symbol>) { impl Clean<Vec<Item>> for (&hir::Item<'_>, Option<Symbol>) {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Vec<Item> { fn clean(&self, cx: &mut DocContext<'_>) -> Vec<Item> {
use hir::ItemKind; use hir::ItemKind;
let (item, renamed) = self; let (item, renamed) = self;
@ -2022,8 +2018,8 @@ impl<'tcx> Clean<'tcx, Vec<Item>> for (&hir::Item<'tcx>, Option<Symbol>) {
} }
} }
impl<'tcx> Clean<'tcx, Item> for hir::Variant<'tcx> { impl Clean<Item> for hir::Variant<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item { fn clean(&self, cx: &mut DocContext<'_>) -> Item {
let kind = VariantItem(self.data.clean(cx)); let kind = VariantItem(self.data.clean(cx));
let what_rustc_thinks = let what_rustc_thinks =
Item::from_hir_id_and_parts(self.id, Some(self.ident.name), kind, cx); Item::from_hir_id_and_parts(self.id, Some(self.ident.name), kind, cx);
@ -2032,9 +2028,9 @@ impl<'tcx> Clean<'tcx, Item> for hir::Variant<'tcx> {
} }
} }
impl<'tcx> Clean<'tcx, bool> for ty::ImplPolarity { impl Clean<bool> for ty::ImplPolarity {
/// Returns whether the impl has negative polarity. /// Returns whether the impl has negative polarity.
fn clean(&self, _: &mut DocContext<'tcx>) -> bool { fn clean(&self, _: &mut DocContext<'_>) -> bool {
match self { match self {
&ty::ImplPolarity::Positive | &ty::ImplPolarity::Positive |
// FIXME: do we want to do something else here? // FIXME: do we want to do something else here?
@ -2044,11 +2040,7 @@ impl<'tcx> Clean<'tcx, bool> for ty::ImplPolarity {
} }
} }
fn clean_impl<'tcx>( fn clean_impl(impl_: &hir::Impl<'_>, hir_id: hir::HirId, cx: &mut DocContext<'_>) -> Vec<Item> {
impl_: &hir::Impl<'tcx>,
hir_id: hir::HirId,
cx: &mut DocContext<'tcx>,
) -> Vec<Item> {
let tcx = cx.tcx; let tcx = cx.tcx;
let mut ret = Vec::new(); let mut ret = Vec::new();
let trait_ = impl_.of_trait.clean(cx); let trait_ = impl_.of_trait.clean(cx);
@ -2093,11 +2085,11 @@ fn clean_impl<'tcx>(
ret ret
} }
fn clean_extern_crate<'tcx>( fn clean_extern_crate(
krate: &hir::Item<'tcx>, krate: &hir::Item<'_>,
name: Symbol, name: Symbol,
orig_name: Option<Symbol>, orig_name: Option<Symbol>,
cx: &mut DocContext<'tcx>, cx: &mut DocContext<'_>,
) -> Vec<Item> { ) -> Vec<Item> {
// this is the ID of the `extern crate` statement // this is the ID of the `extern crate` statement
let cnum = cx.tcx.extern_mod_stmt_cnum(krate.def_id).unwrap_or(LOCAL_CRATE); let cnum = cx.tcx.extern_mod_stmt_cnum(krate.def_id).unwrap_or(LOCAL_CRATE);
@ -2140,12 +2132,12 @@ fn clean_extern_crate<'tcx>(
}] }]
} }
fn clean_use_statement<'tcx>( fn clean_use_statement(
import: &hir::Item<'tcx>, import: &hir::Item<'_>,
name: Symbol, name: Symbol,
path: &hir::Path<'tcx>, path: &hir::Path<'_>,
kind: hir::UseKind, kind: hir::UseKind,
cx: &mut DocContext<'tcx>, cx: &mut DocContext<'_>,
) -> Vec<Item> { ) -> Vec<Item> {
// We need this comparison because some imports (for std types for example) // We need this comparison because some imports (for std types for example)
// are "inserted" as well but directly by the compiler and they should not be // are "inserted" as well but directly by the compiler and they should not be
@ -2235,8 +2227,8 @@ fn clean_use_statement<'tcx>(
vec![Item::from_def_id_and_parts(import.def_id.to_def_id(), None, ImportItem(inner), cx)] vec![Item::from_def_id_and_parts(import.def_id.to_def_id(), None, ImportItem(inner), cx)]
} }
impl<'tcx> Clean<'tcx, Item> for (&hir::ForeignItem<'tcx>, Option<Symbol>) { impl Clean<Item> for (&hir::ForeignItem<'_>, Option<Symbol>) {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item { fn clean(&self, cx: &mut DocContext<'_>) -> Item {
let (item, renamed) = self; let (item, renamed) = self;
cx.with_param_env(item.def_id.to_def_id(), |cx| { cx.with_param_env(item.def_id.to_def_id(), |cx| {
let kind = match item.kind { let kind = match item.kind {
@ -2272,8 +2264,8 @@ impl<'tcx> Clean<'tcx, Item> for (&hir::ForeignItem<'tcx>, Option<Symbol>) {
} }
} }
impl<'tcx> Clean<'tcx, Item> for (&hir::MacroDef<'tcx>, Option<Symbol>) { impl Clean<Item> for (&hir::MacroDef<'_>, Option<Symbol>) {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item { fn clean(&self, cx: &mut DocContext<'_>) -> Item {
let (item, renamed) = self; let (item, renamed) = self;
let name = renamed.unwrap_or(item.ident.name); let name = renamed.unwrap_or(item.ident.name);
let tts = item.ast.body.inner_tokens().trees().collect::<Vec<_>>(); let tts = item.ast.body.inner_tokens().trees().collect::<Vec<_>>();
@ -2321,14 +2313,14 @@ impl<'tcx> Clean<'tcx, Item> for (&hir::MacroDef<'tcx>, Option<Symbol>) {
} }
} }
impl<'tcx> Clean<'tcx, TypeBinding> for hir::TypeBinding<'tcx> { impl Clean<TypeBinding> for hir::TypeBinding<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> TypeBinding { fn clean(&self, cx: &mut DocContext<'_>) -> TypeBinding {
TypeBinding { name: self.ident.name, kind: self.kind.clean(cx) } TypeBinding { name: self.ident.name, kind: self.kind.clean(cx) }
} }
} }
impl<'tcx> Clean<'tcx, TypeBindingKind> for hir::TypeBindingKind<'tcx> { impl Clean<TypeBindingKind> for hir::TypeBindingKind<'_> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> TypeBindingKind { fn clean(&self, cx: &mut DocContext<'_>) -> TypeBindingKind {
match *self { match *self {
hir::TypeBindingKind::Equality { ref ty } => { hir::TypeBindingKind::Equality { ref ty } => {
TypeBindingKind::Equality { ty: ty.clean(cx) } TypeBindingKind::Equality { ty: ty.clean(cx) }

View File

@ -84,12 +84,12 @@ crate fn krate(cx: &mut DocContext<'_>) -> Crate {
} }
} }
fn external_generic_args<'tcx>( fn external_generic_args(
cx: &mut DocContext<'tcx>, cx: &mut DocContext<'_>,
trait_did: Option<DefId>, trait_did: Option<DefId>,
has_self: bool, has_self: bool,
bindings: Vec<TypeBinding>, bindings: Vec<TypeBinding>,
substs: SubstsRef<'tcx>, substs: SubstsRef<'_>,
) -> GenericArgs { ) -> GenericArgs {
let mut skip_self = has_self; let mut skip_self = has_self;
let mut ty_kind = None; let mut ty_kind = None;
@ -136,13 +136,13 @@ fn external_generic_args<'tcx>(
// trait_did should be set to a trait's DefId if called on a TraitRef, in order to sugar // trait_did should be set to a trait's DefId if called on a TraitRef, in order to sugar
// from Fn<(A, B,), C> to Fn(A, B) -> C // from Fn<(A, B,), C> to Fn(A, B) -> C
pub(super) fn external_path<'tcx>( pub(super) fn external_path(
cx: &mut DocContext<'tcx>, cx: &mut DocContext<'_>,
name: Symbol, name: Symbol,
trait_did: Option<DefId>, trait_did: Option<DefId>,
has_self: bool, has_self: bool,
bindings: Vec<TypeBinding>, bindings: Vec<TypeBinding>,
substs: SubstsRef<'tcx>, substs: SubstsRef<'_>,
) -> Path { ) -> Path {
Path { Path {
global: false, global: false,