public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [FYI] Fix gdb.rust/simple.rs for more recent compilers
@ 2018-11-19 17:55 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2018-11-19 17:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

gdb.rust/simple.exp will fail when run with a recent version of rustc.
This patch fixes the test case so that it will continue to run.

Tested on x86-64 Fedora 28.

I also temporarily backed out the rust-lang.c from
commit 098b2108a2b61531c0bc8ea16854f773083a95d7, and verified that
this updated test still would have provoked the original bug.

gdb/testsuite/ChangeLog
2018-11-19  Tom Tromey  <tom@tromey.com>

	* gdb.rust/simple.rs: Don't initialize empty_enum_value.
---
 gdb/testsuite/ChangeLog          | 4 ++++
 gdb/testsuite/gdb.rust/simple.rs | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 9acaa79e2b2..e7693a07f54 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2018-11-19  Tom Tromey  <tom@tromey.com>
+
+	* gdb.rust/simple.rs: Don't initialize empty_enum_value.
+
 2018-11-19  Pedro Alves  <palves@redhat.com>
 
 	* gdb.base/warning.exp: Don't override INTERNAL_FLAGS.  Use
diff --git a/gdb/testsuite/gdb.rust/simple.rs b/gdb/testsuite/gdb.rust/simple.rs
index 00a25e0828d..79d463c1989 100644
--- a/gdb/testsuite/gdb.rust/simple.rs
+++ b/gdb/testsuite/gdb.rust/simple.rs
@@ -170,7 +170,7 @@ fn main () {
     let u = Union { f2: 255 };
     let simplelayout = SimpleLayout { f1: 8, f2: 9 };
 
-    let empty_enum_value: EmptyEnum = unsafe { ::std::mem::zeroed() };
+    let empty_enum_value: EmptyEnum;
 
     println!("{}, {}", x.0, x.1);        // set breakpoint here
     println!("{}", diff2(92, 45));
-- 
2.17.2

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-11-19 17:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-19 17:55 [FYI] Fix gdb.rust/simple.rs for more recent compilers Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).