Print Rust unsized array types a bit more nicely
authorTom Tromey <tom@tromey.com>
Sun, 21 May 2017 23:00:10 +0000 (17:00 -0600)
committerTom Tromey <tom@tromey.com>
Sun, 21 May 2017 23:02:16 +0000 (17:02 -0600)
commite6cf65f283b8be44014fad0ad0aebfbcc71fceac
tree54803ee7f0e6635475b02382e79649c2786281aa
parent56298620acb02ab589ce3ddf398788227ab20211
Print Rust unsized array types a bit more nicely

It's a bit difficult to create an unsized array type in Rust, but if
you do, right now ptype will show something like "[u8; ]".  It really
should print "[u8]", though, which is what this patch implements.

This is part of PR 21466.

Built and regtested on x86-64 Fedora 25.  I'm checking this in.

ChangeLog
2017-05-21  Tom Tromey  <tom@tromey.com>

PR rust/21466:
* rust-lang.c (rust_print_type) <TYPE_CODE_ARRAY>: Print unsized
arrays as "[T]", not "[T; ]".

testsuite/ChangeLog
2017-05-21  Tom Tromey  <tom@tromey.com>

PR rust/21466:
* gdb.rust/unsized.exp: New file.
* gdb.rust/unsized.rs: New file.
gdb/ChangeLog
gdb/rust-lang.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.rust/unsized.exp [new file with mode: 0644]
gdb/testsuite/gdb.rust/unsized.rs [new file with mode: 0644]
This page took 0.02781 seconds and 4 git commands to generate.