]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add a test for inherent impl type name resolve
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 18 Apr 2024 20:39:47 +0000 (22:39 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 1 Aug 2024 14:52:31 +0000 (16:52 +0200)
A previous bug with name resolution 2.0 was caused by an incorrectly
resolved inherent impl name. This test shall highlight the behavior
and prevent regression.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/testsuite/rust/compile/name_resolution25.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/compile/name_resolution25.rs b/gcc/testsuite/rust/compile/name_resolution25.rs
new file mode 100644 (file)
index 0000000..3cacac7
--- /dev/null
@@ -0,0 +1,5 @@
+// { dg-options "-frust-name-resolution-2.0" }
+
+struct Test; // { dg-warning "struct is never constructed: .Test." }
+
+impl Test {}