]>
Commit | Line | Data |
---|---|---|
ea8adc8c XL |
1 | // ignore-pretty pretty-printing is unhygienic |
2 | ||
3 | #![feature(decl_macro)] | |
4 | #![allow(unused)] | |
5 | ||
6 | mod ok { | |
7 | macro mac_trait_item($method: ident) { | |
8 | fn $method(); | |
9 | } | |
10 | ||
11 | trait Tr { | |
12 | mac_trait_item!(method); | |
13 | } | |
14 | ||
15 | macro mac_trait_impl() { | |
16 | impl Tr for u8 { // OK | |
17 | fn method() {} // OK | |
18 | } | |
19 | } | |
20 | ||
21 | mac_trait_impl!(); | |
22 | } | |
23 | ||
24 | mod error { | |
25 | macro mac_trait_item() { | |
26 | fn method(); | |
27 | } | |
28 | ||
29 | trait Tr { | |
30 | mac_trait_item!(); | |
31 | } | |
32 | ||
33 | macro mac_trait_impl() { | |
34 | impl Tr for u8 { //~ ERROR not all trait items implemented, missing: `method` | |
35 | fn method() {} //~ ERROR method `method` is not a member of trait `Tr` | |
36 | } | |
37 | } | |
38 | ||
39 | mac_trait_impl!(); | |
40 | } | |
41 | ||
42 | fn main() {} |