提交 3493c62f 编写于 作者: G Guillaume Gomez

Add names to BareFnTy

上级 cce93436
...@@ -574,7 +574,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) { ...@@ -574,7 +574,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
TyTup(ref tuple_element_types) => { TyTup(ref tuple_element_types) => {
walk_list!(visitor, visit_ty, 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); visitor.visit_fn_decl(&function_declaration.decl);
walk_list!(visitor, visit_lifetime_def, &function_declaration.lifetimes); walk_list!(visitor, visit_lifetime_def, &function_declaration.lifetimes);
} }
......
...@@ -673,7 +673,15 @@ fn lower_ty(&mut self, t: &Ty) -> P<hir::Ty> { ...@@ -673,7 +673,15 @@ fn lower_ty(&mut self, t: &Ty) -> P<hir::Ty> {
unsafety: self.lower_unsafety(f.unsafety), unsafety: self.lower_unsafety(f.unsafety),
abi: f.abi, abi: f.abi,
decl: self.lower_fn_decl(&f.decl), 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::Never => hir::TyNever,
TyKind::Tup(ref tys) => { TyKind::Tup(ref tys) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册