gccrs: Handle `async` functions in traits
[official-gcc.git] / gcc / testsuite / rust / compile / macro40.rs
blobf9d048e8ab1d2e6e6761c4e0cd85537dffc1851e
1 // { dg-additional-options "-w" }
3 #[lang = "sized"]
4 pub trait Sized {}
6 macro_rules! t {
7     () => {
8         i32
9     };
12 macro_rules! s {
13     () => {
14         *const i8
15     };
18 extern "C" {
19     fn printf(s: s!(), ...);
22 fn square(arg: t!()) -> t!() {
23     let input: t!() = arg;
25     input * input
28 trait Trait {
29     fn f() -> t!();
30     fn g(arg: t!());
33 struct Wrapper {
34     inner: t!(),
37 impl Trait for Wrapper {
38     fn f() -> t!() {
39         1
40     }
42     fn g(arg: t!()) {}
45 fn id<T>(arg: T) -> T {
46     arg
49 fn main() {
50     id::<t!()>(15);