We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 74e8046 commit 5a813b6Copy full SHA for 5a813b6
src/librustc_typeck/astconv.rs
@@ -1151,9 +1151,16 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1151
.as_ref()
1152
.and_then(|args| args.args.get(0))
1153
.and_then(|arg| match arg {
1154
- hir::GenericArg::Type(ty) => {
1155
- sess.source_map().span_to_snippet(ty.span).ok()
+ hir::GenericArg::Type(ty) => match ty.kind {
+ 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),
1161
}
1162
+ .map(|s| format!("({})", s))
1163
+ .ok(),
1164
_ => None,
1165
})
1166
.unwrap_or_else(|| "()".to_string()),
0 commit comments