Skip to content

Commit 5416901

Browse files
committed
librustc: use type parameters less vigorously when giving the IR type names
1 parent 1e4e55a commit 5416901

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustc/middle/trans/type_of.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,12 @@ pub fn llvm_type_name(cx: &CrateContext,
455455

456456
let base = ty::item_path_str(cx.tcx(), did);
457457
let strings: Vec<String> = tps.iter().map(|t| t.repr(cx.tcx())).collect();
458-
let tstr = format!("{}<{}>", base, strings);
458+
let tstr = if strings.is_empty() {
459+
base
460+
} else {
461+
format!("{}<{}>", base, strings)
462+
};
463+
459464
if did.krate == 0 {
460465
format!("{}.{}", name, tstr)
461466
} else {

0 commit comments

Comments
 (0)