public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] gccrs: Add test to show multiple candidates for methods is working
@ 2023-04-06 21:33 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2023-04-06 21:33 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ea9ae4044000496714d3f0c58f3dba21487247ac

commit ea9ae4044000496714d3f0c58f3dba21487247ac
Author: Philip Herron <herron.philip@googlemail.com>
Date:   Wed Mar 29 17:02:17 2023 +0100

    gccrs: Add test to show multiple candidates for methods is working
    
    Fixes #925
    
    gcc/testsuite/ChangeLog:
    
            * rust/compile/issue-925.rs: New test.
    
    Signed-off-by: Philip Herron <herron.philip@googlemail.com>

Diff:
---
 gcc/testsuite/rust/compile/issue-925.rs | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gcc/testsuite/rust/compile/issue-925.rs b/gcc/testsuite/rust/compile/issue-925.rs
new file mode 100644
index 00000000000..f6c071958f4
--- /dev/null
+++ b/gcc/testsuite/rust/compile/issue-925.rs
@@ -0,0 +1,23 @@
+struct S;
+trait A {
+    fn foo(&self);
+}
+
+trait B: A {
+    fn foo(&self);
+}
+
+impl A for S {
+    fn foo(&self) {}
+}
+
+impl B for S {
+    fn foo(&self) {}
+}
+
+fn test() {
+    let a = S;
+    a.foo();
+    // { dg-error "multiple candidates found for method .foo." "" { target *-*-* } .-1 }
+    // { dg-error "failed to type resolve expression" "" { target *-*-* } .-2 }
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-06 21:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06 21:33 [gcc/devel/rust/master] gccrs: Add test to show multiple candidates for methods is working Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).