Skip to content

Commit f27ecd5

Browse files
committed
Merge pull request #19979 from Munksgaard/19978
Add a check for uninferred type parameter Reviewed-by: alexcrichton
2 parents 3843318 + 3bb91aa commit f27ecd5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc/util/ppaux.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,11 @@ pub fn parameterized<'tcx>(cx: &ctxt<'tcx>,
532532
if cx.lang_items.fn_trait_kind(did).is_some() {
533533
format!("{}({}){}",
534534
base,
535-
strs[0][1 .. strs[0].len() - (strs[0].ends_with(",)") as uint+1)],
535+
if strs[0].starts_with("(") && strs[0].ends_with(",)") {
536+
strs[0][1 .. strs[0].len() - 2] // Remove '(' and ',)'
537+
} else {
538+
strs[0][]
539+
},
536540
if &*strs[1] == "()" { String::new() } else { format!(" -> {}", strs[1]) })
537541
} else if strs.len() > 0 {
538542
format!("{}<{}>", base, strs.connect(", "))

0 commit comments

Comments
 (0)