From 921d8f549f9e35d3f83c7b1a381146a7dc1246f4 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Mon, 27 Jun 2016 21:16:59 +0530 Subject: Print void types correctly in Rust Rust prefers to not specify the return type of a function when it is unit (`()`). The type is also referred to as "void" in debuginfo but not in actual usage, so we should never be printing "void" when the language is Rust. 2016-06-27 Manish Goregaokar gdb/ChangeLog: * rust-lang.c (rust_print_type): Print unit types as "()" * rust-lang.c (rust_print_type): Omit return type for functions returning unit gdb/testsuite/ChangeLog: * gdb.rust/simple.rs: Add test for returning unit in a function * gdb.rust/simple.exp: Add expectation for functions returning unit --- gdb/testsuite/gdb.rust/simple.exp | 1 + 1 file changed, 1 insertion(+) (limited to 'gdb/testsuite/gdb.rust/simple.exp') diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp index 88f1c89..4622f75 100644 --- a/gdb/testsuite/gdb.rust/simple.exp +++ b/gdb/testsuite/gdb.rust/simple.exp @@ -149,6 +149,7 @@ gdb_test "print self::diff2(8, 9)" " = -1" gdb_test "print ::diff2(23, -23)" " = 46" gdb_test "ptype diff2" "fn \\(i32, i32\\) -> i32" +gdb_test "ptype empty" "fn \\(\\)" gdb_test "print (diff2 as fn(i32, i32) -> i32)(19, -2)" " = 21" -- cgit v1.1