Add names to BareFnTy

This commit is contained in:
Guillaume Gomez 2017-09-27 00:43:22 +02:00
parent cce93436d3
commit 3493c62ff2
2 changed files with 10 additions and 2 deletions

View File

@ -574,7 +574,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
TyTup(ref tuple_element_types) => {
walk_list!(visitor, visit_ty, tuple_element_types);
}
TyBareFn(ref function_declaration) => {
TyBareFn(ref function_declaration, _) => {
visitor.visit_fn_decl(&function_declaration.decl);
walk_list!(visitor, visit_lifetime_def, &function_declaration.lifetimes);
}

View File

@ -673,7 +673,15 @@ impl<'a> LoweringContext<'a> {
unsafety: self.lower_unsafety(f.unsafety),
abi: f.abi,
decl: self.lower_fn_decl(&f.decl),
}))
},
decl.inputs.iter().map(|arg| {
match arg.pat.node {
PatKind::Ident(_, ident, None) => {
respan(ident.span, ident.node.name)
}
_ => respan(arg.pat.span, keywords::Invalid.name()),
}
}).collect()))
}
TyKind::Never => hir::TyNever,
TyKind::Tup(ref tys) => {