From: Tom Tromey Date: Fri, 25 Mar 2022 19:43:27 +0000 (-0600) Subject: Remove some dead code from the Rust value printer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=925ea601f1892c6eb344e2c916f0ef448b42b606;p=binutils-gdb.git Remove some dead code from the Rust value printer This removes a bit of dead code from the Rust value printer. This code wasn't always dead -- it fixed a real bug, and a test case was added for it. However, once val_print was removed, it became unnecessary. --- diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index 836ea37f153..fdd6e3fbdbb 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -324,14 +324,6 @@ rust_language::val_print_struct if (rust_slice_type_p (type) && strcmp (type->name (), "&str") == 0) { - /* If what we are printing here is actually a string within a - structure then VAL will be the original parent value, while TYPE - will be the type of the structure representing the string we want - to print. - However, RUST_VAL_PRINT_STR looks up the fields of the string - inside VAL, assuming that VAL is the string. - So, recreate VAL as a value representing just the string. */ - val = value_at_lazy (type, value_address (val)); rust_val_print_str (stream, val, options); return; }