Skip to content

Commit 3493c62

Browse files
Add names to BareFnTy
1 parent cce9343 commit 3493c62

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/librustc/hir/intravisit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
574574
TyTup(ref tuple_element_types) => {
575575
walk_list!(visitor, visit_ty, tuple_element_types);
576576
}
577-
TyBareFn(ref function_declaration) => {
577+
TyBareFn(ref function_declaration, _) => {
578578
visitor.visit_fn_decl(&function_declaration.decl);
579579
walk_list!(visitor, visit_lifetime_def, &function_declaration.lifetimes);
580580
}

src/librustc/hir/lowering.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,15 @@ impl<'a> LoweringContext<'a> {
673673
unsafety: self.lower_unsafety(f.unsafety),
674674
abi: f.abi,
675675
decl: self.lower_fn_decl(&f.decl),
676-
}))
676+
},
677+
decl.inputs.iter().map(|arg| {
678+
match arg.pat.node {
679+
PatKind::Ident(_, ident, None) => {
680+
respan(ident.span, ident.node.name)
681+
}
682+
_ => respan(arg.pat.span, keywords::Invalid.name()),
683+
}
684+
}).collect()))
677685
}
678686
TyKind::Never => hir::TyNever,
679687
TyKind::Tup(ref tys) => {

0 commit comments

Comments
 (0)