https://gcc.gnu.org/g:701094f4908d9b31e9c712c04f02c443576cf903
commit 701094f4908d9b31e9c712c04f02c443576cf903 Author: Philip Herron <herron.phi...@googlemail.com> Date: Thu Apr 17 16:04:55 2025 +0100 gccrs: Add test case to show issue is fixed 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 <herron.phi...@googlemail.com> Diff: --- gcc/testsuite/rust/compile/issue-3711.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gcc/testsuite/rust/compile/issue-3711.rs b/gcc/testsuite/rust/compile/issue-3711.rs new file mode 100644 index 000000000000..a3f9c39b4c58 --- /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() {}