]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hygiene/specialization.rs
Rollup merge of #90202 - matthewjasper:xcrate-hygiene, r=petrochenkov
[rust.git] / src / test / ui / hygiene / specialization.rs
1 // run-pass
2 // ignore-pretty pretty-printing is unhygienic
3
4 #![feature(decl_macro)]
5
6 trait Tr {
7     fn f(&self) -> &'static str {
8         "This shouldn't happen"
9     }
10 }
11
12 pub macro m($t:ty) {
13     impl Tr for $t {
14         fn f(&self) -> &'static str {
15             "Run me"
16         }
17     }
18 }
19
20 struct S;
21 m!(S);
22
23 fn main() {
24     assert_eq!(S.f(), "Run me");
25 }