diff options
author | Philip Herron <herron.philip@googlemail.com> | 2025-04-17 16:04:55 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2025-04-18 09:42:18 +0000 |
commit | 701094f4908d9b31e9c712c04f02c443576cf903 (patch) | |
tree | 11f8529d266cfe1c891b3385ecd1d388a076ff44 | |
parent | d85328baf00510fce8b5d3843f731023e12944b1 (diff) | |
download | gcc-701094f4908d9b31e9c712c04f02c443576cf903.zip gcc-701094f4908d9b31e9c712c04f02c443576cf903.tar.gz gcc-701094f4908d9b31e9c712c04f02c443576cf903.tar.bz2 |
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.philip@googlemail.com>
-rw-r--r-- | gcc/testsuite/rust/compile/issue-3711.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/issue-3711.rs b/gcc/testsuite/rust/compile/issue-3711.rs new file mode 100644 index 0000000..a3f9c39 --- /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() {} |