aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/execute/torture/macros23.rs
blob: b27985d3befd2abc96c944c5a69a3bb144436384 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#[lang = "sized"]
pub trait Sized {}

trait Valuable {
    const VALUE: i32;
}

struct Something;

macro_rules! implement {
    () => {
        const VALUE: i32 = 18;
    };
}

impl Valuable for Something {
    implement!();
}

fn main() -> i32 {
    Something::VALUE - 18
}