-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#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 <[email protected]>
- Loading branch information
1 parent
0d0530b
commit 665d301
Showing
2 changed files
with
26 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |