repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
gccrs: Handle `async` functions in traits
[official-gcc.git]
/
gcc
/
testsuite
/
rust
/
compile
/
macro40.rs
blob
f9d048e8ab1d2e6e6761c4e0cd85537dffc1851e
1
// { dg-additional-options "-w" }
2
3
#[lang = "sized"]
4
pub trait Sized {}
5
6
macro_rules! t {
7
() => {
8
i32
9
};
10
}
11
12
macro_rules! s {
13
() => {
14
*const i8
15
};
16
}
17
18
extern "C" {
19
fn printf(s: s!(), ...);
20
}
21
22
fn square(arg: t!()) -> t!() {
23
let input: t!() = arg;
24
25
input * input
26
}
27
28
trait Trait {
29
fn f() -> t!();
30
fn g(arg: t!());
31
}
32
33
struct Wrapper {
34
inner: t!(),
35
}
36
37
impl Trait for Wrapper {
38
fn f() -> t!() {
39
1
40
}
41
42
fn g(arg: t!()) {}
43
}
44
45
fn id<T>(arg: T) -> T {
46
arg
47
}
48
49
fn main() {
50
id::<t!()>(15);
51
}