From c7cdae718c24e7a3f68d7090cc9947df5d848fb8 Mon Sep 17 00:00:00 2001 From: Liam Naddell Date: Fri, 19 Jul 2024 14:19:26 -0400 Subject: gccrs: [gccrs#2987] Patch ICE when deriving Clone and Copy gcc/rust/ChangeLog: * expand/rust-expand-visitor.cc: Fix ICE caused by unique_ptr UB and buggy iterator use gcc/testsuite/ChangeLog: * rust/compile/issue-2987.rs: Add test for deriving Clone and Copy at the same time Signed-off-by: Liam Naddell --- gcc/testsuite/rust/compile/issue-2987.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 gcc/testsuite/rust/compile/issue-2987.rs (limited to 'gcc/testsuite/rust/compile') diff --git a/gcc/testsuite/rust/compile/issue-2987.rs b/gcc/testsuite/rust/compile/issue-2987.rs new file mode 100644 index 0000000..1ab5fdc --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-2987.rs @@ -0,0 +1,17 @@ +// { dg-options "-w" } Currently there are a lot of warnings produced from inside clone/copy +// builtins + +#[lang = "copy"] +trait Copy {} + +#[lang = "clone"] +trait Clone { + fn clone(&self) -> Self; +} + +#[derive(Copy)] +#[derive(Clone)] +struct Empty; + +#[derive(Copy,Clone)] +struct Empty2; -- cgit v1.1