Skip to content
4 changes: 2 additions & 2 deletions src/librustc/hir/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,12 +591,12 @@ impl<'a> State<'a> {
self.s.word(";")?;
self.end()?; // end the outer cbox
}
hir::ItemKind::Fn(ref decl, header, ref typarams, body) => {
hir::ItemKind::Fn(ref decl, header, ref param_names, body) => {
self.head("")?;
self.print_fn(decl,
header,
Some(item.ident.name),
typarams,
param_names,
&item.vis,
&[],
Some(body))?;
Expand Down
16 changes: 11 additions & 5 deletions src/librustdoc/clean/auto_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
let new_ty = match &poly_trait.trait_ {
&Type::ResolvedPath {
ref path,
ref typarams,
ref param_names,
ref did,
ref is_generic,
} => {
Expand All @@ -444,7 +444,13 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
.expect("segments were empty");

let (old_input, old_output) = match last_segment.args {
GenericArgs::AngleBracketed { types, .. } => (types, None),
GenericArgs::AngleBracketed { args, .. } => {
let types = args.iter().filter_map(|arg| match arg {
GenericArg::Type(ty) => Some(ty.clone()),
_ => None,
}).collect();
(types, None)
}
GenericArgs::Parenthesized { inputs, output, .. } => {
(inputs, output)
}
Expand All @@ -469,7 +475,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {

Type::ResolvedPath {
path: new_path,
typarams: typarams.clone(),
param_names: param_names.clone(),
did: did.clone(),
is_generic: *is_generic,
}
Expand Down Expand Up @@ -669,7 +675,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
match **trait_ {
Type::ResolvedPath {
path: ref trait_path,
ref typarams,
ref param_names,
ref did,
ref is_generic,
} => {
Expand Down Expand Up @@ -724,7 +730,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
PolyTrait {
trait_: Type::ResolvedPath {
path: new_trait_path,
typarams: typarams.clone(),
param_names: param_names.clone(),
did: did.clone(),
is_generic: *is_generic,
},
Expand Down
Loading