We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3843318 + 3bb91aa commit f27ecd5Copy full SHA for f27ecd5
src/librustc/util/ppaux.rs
@@ -532,7 +532,11 @@ pub fn parameterized<'tcx>(cx: &ctxt<'tcx>,
532
if cx.lang_items.fn_trait_kind(did).is_some() {
533
format!("{}({}){}",
534
base,
535
- strs[0][1 .. strs[0].len() - (strs[0].ends_with(",)") as uint+1)],
+ 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
+ },
540
if &*strs[1] == "()" { String::new() } else { format!(" -> {}", strs[1]) })
541
} else if strs.len() > 0 {
542
format!("{}<{}>", base, strs.connect(", "))
0 commit comments