diff options
author | Liam Naddell <liam.naddell@mail.utoronto.ca> | 2024-07-19 14:19:26 -0400 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-03-17 16:35:53 +0100 |
commit | c7cdae718c24e7a3f68d7090cc9947df5d848fb8 (patch) | |
tree | 9abb862956383a122a64c30dead38d70779f7727 /gcc/testsuite/rust/compile | |
parent | 9afadf56ca5ea97e73135891ef7a772a866ac630 (diff) | |
download | gcc-c7cdae718c24e7a3f68d7090cc9947df5d848fb8.zip gcc-c7cdae718c24e7a3f68d7090cc9947df5d848fb8.tar.gz gcc-c7cdae718c24e7a3f68d7090cc9947df5d848fb8.tar.bz2 |
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 <liam.naddell@mail.utoronto.ca>
Diffstat (limited to 'gcc/testsuite/rust/compile')
-rw-r--r-- | gcc/testsuite/rust/compile/issue-2987.rs | 17 |
1 files changed, 17 insertions, 0 deletions
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; |