From: Philip Herron <[email protected]>
This was already fixed in: bb01719f0e1 but we require fn_once lang item
to be defined as we are working on libcore support still.
Fixes Rust-GCC#3711
gcc/testsuite/ChangeLog:
* rust/compile/issue-3711.rs: New test.
Signed-off-by: Philip Herron <[email protected]>
---
gcc/testsuite/rust/compile/issue-3711.rs | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 gcc/testsuite/rust/compile/issue-3711.rs
diff --git a/gcc/testsuite/rust/compile/issue-3711.rs
b/gcc/testsuite/rust/compile/issue-3711.rs
new file mode 100644
index 00000000000..a3f9c39b4c5
--- /dev/null
+++ b/gcc/testsuite/rust/compile/issue-3711.rs
@@ -0,0 +1,17 @@
+#[lang = "sized"]
+pub trait Sized {}
+
+#[lang = "fn_once"]
+pub trait FnOnce<Args> {
+ #[lang = "fn_once_output"]
+ type Output;
+
+ extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
+}
+
+fn returns_closure() -> _ {
+ // { dg-error "the type placeholder ._. is not allowed within types on
item signatures .E0121." "" { target *-*-* } .-1 }
+ || 0
+}
+
+fn main() {}
--
2.49.0