aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2025-04-04 15:35:15 +0200
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2025-04-24 16:53:44 +0000
commit7c7d476b27c8230aca6698c6c699b3724e20ade6 (patch)
treeddfd86b8249a97c630e08c7dab8a4f6add079463
parent7df713d5998e45e51cb97d5ce8d1f939e97a7b20 (diff)
downloadgcc-7c7d476b27c8230aca6698c6c699b3724e20ade6.zip
gcc-7c7d476b27c8230aca6698c6c699b3724e20ade6.tar.gz
gcc-7c7d476b27c8230aca6698c6c699b3724e20ade6.tar.bz2
Add fn_once and Sized lang items to the test
gcc/testsuite/ChangeLog: * rust/compile/multiple_bindings1.rs: Add missing lang items. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
-rw-r--r--gcc/testsuite/rust/compile/multiple_bindings1.rs29
1 files changed, 19 insertions, 10 deletions
diff --git a/gcc/testsuite/rust/compile/multiple_bindings1.rs b/gcc/testsuite/rust/compile/multiple_bindings1.rs
index e73dc2a..8a2e18c 100644
--- a/gcc/testsuite/rust/compile/multiple_bindings1.rs
+++ b/gcc/testsuite/rust/compile/multiple_bindings1.rs
@@ -1,29 +1,38 @@
+#[lang = "sized"]
+pub trait Sized {}
+
+#[lang = "fn_once"]
+trait FnOnce<Args> {
+ type Output;
+
+ fn call_once(self, args: Args) -> Self::Output;
+}
+
fn f1(i: i32, i: i32) {}
// { dg-error "identifier .i. is bound more than once in the same parameter list .E0415." "" { target *-*-* } .-1 }
trait Foo {
- fn f2(i: i32, i: i32) {}
- // { dg-error "identifier .i. is bound more than once in the same parameter list .E0415." "" { target *-*-* } .-1 }
+ fn f2(i: i32, i: i32) {}
+ // { dg-error "identifier .i. is bound more than once in the same parameter list .E0415." "" { target *-*-* } .-1 }
}
trait Bar {
- fn f3(i: i32, j: i32) {}
+ fn f3(i: i32, j: i32) {}
}
struct S;
impl S {
- fn f4(i: i32, i: i32) {}
- // { dg-error "identifier .i. is bound more than once in the same parameter list .E0415." "" { target *-*-* } .-1 }
+ fn f4(i: i32, i: i32) {}
+ // { dg-error "identifier .i. is bound more than once in the same parameter list .E0415." "" { target *-*-* } .-1 }
}
impl Bar for S {
- fn f3(i: i32, i: i32) {}
- // { dg-error "identifier .i. is bound more than once in the same parameter list .E0415." "" { target *-*-* } .-1 }
+ fn f3(i: i32, i: i32) {}
+ // { dg-error "identifier .i. is bound more than once in the same parameter list .E0415." "" { target *-*-* } .-1 }
}
fn main() {
- let _ = |i, i| {};
- // { dg-error "identifier .i. is bound more than once in the same parameter list .E0415." "" { target *-*-* } .-1 }
+ let _ = |i, i| {};
+ // { dg-error "identifier .i. is bound more than once in the same parameter list .E0415." "" { target *-*-* } .-1 }
}
-