]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add fn_once and Sized lang items to the test
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Fri, 4 Apr 2025 13:35:15 +0000 (15:35 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 28 Apr 2025 14:18:55 +0000 (16:18 +0200)
gcc/testsuite/ChangeLog:

* rust/compile/multiple_bindings1.rs: Add missing lang items.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/testsuite/rust/compile/multiple_bindings1.rs

index e73dc2ae7d94ffb7c98aa253a4197e2323da1eb6..8a2e18c27b1b67fc32735059bf972a90d714b5ad 100644 (file)
@@ -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 }
 }
-