[COMMITTED,019/101] gccrs: Add a regression test for super trait on auto trait

Message ID 20240130121026.807464-22-arthur.cohen@embecosm.com
State Committed
Commit 84e06bb631424cba3ee47f522c9629b104019ec9
Headers
Series [COMMITTED,001/101] gccrs: Add visibility to trait item |

Commit Message

Arthur Cohen Jan. 30, 2024, 12:06 p.m. UTC
  From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Add a new regression test to highlight the error behavior with a super
trait on an auto trait.

gcc/testsuite/ChangeLog:

	* rust/compile/auto_trait_super_trait.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
---
 gcc/testsuite/rust/compile/auto_trait_super_trait.rs | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 gcc/testsuite/rust/compile/auto_trait_super_trait.rs
  

Patch

diff --git a/gcc/testsuite/rust/compile/auto_trait_super_trait.rs b/gcc/testsuite/rust/compile/auto_trait_super_trait.rs
new file mode 100644
index 00000000000..1080afb5124
--- /dev/null
+++ b/gcc/testsuite/rust/compile/auto_trait_super_trait.rs
@@ -0,0 +1,4 @@ 
+trait Cold {}
+
+auto trait IsCool: Cold {}
+// { dg-error "auto traits cannot have super traits .E0568." "" { target *-*-* } .-1 }