Skip to content

Commit 5a813b6

Browse files
committed
Fix missing parentheses Fn notation error
1 parent 74e8046 commit 5a813b6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/librustc_typeck/astconv.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,9 +1151,16 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
11511151
.as_ref()
11521152
.and_then(|args| args.args.get(0))
11531153
.and_then(|arg| match arg {
1154-
hir::GenericArg::Type(ty) => {
1155-
sess.source_map().span_to_snippet(ty.span).ok()
1154+
hir::GenericArg::Type(ty) => match ty.kind {
1155+
hir::TyKind::Tup(t) => t
1156+
.iter()
1157+
.map(|e| sess.source_map().span_to_snippet(e.span))
1158+
.collect::<Result<Vec<_>, _>>()
1159+
.map(|a| a.join(", ")),
1160+
_ => sess.source_map().span_to_snippet(ty.span),
11561161
}
1162+
.map(|s| format!("({})", s))
1163+
.ok(),
11571164
_ => None,
11581165
})
11591166
.unwrap_or_else(|| "()".to_string()),

0 commit comments

Comments
 (0)