]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add a regression test for super trait on auto trait
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Mon, 20 Nov 2023 13:16:41 +0000 (14:16 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 30 Jan 2024 11:36:44 +0000 (12:36 +0100)
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 [new file with mode: 0644]

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 (file)
index 0000000..1080afb
--- /dev/null
@@ -0,0 +1,4 @@
+trait Cold {}
+
+auto trait IsCool: Cold {}
+// { dg-error "auto traits cannot have super traits .E0568." "" { target *-*-* } .-1 }