]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hygiene/trait_items-2.rs
Rollup merge of #90202 - matthewjasper:xcrate-hygiene, r=petrochenkov
[rust.git] / src / test / ui / hygiene / trait_items-2.rs
1 // check-pass
2 // ignore-pretty pretty-printing is unhygienic
3
4 #![feature(decl_macro)]
5
6 macro m($T:ident, $f:ident) {
7     pub trait $T {
8         fn f(&self) -> u32 { 0 }
9         fn $f(&self) -> i32 { 0 }
10     }
11     impl $T for () {}
12
13     let _: u32 = ().f();
14     let _: i32 = ().$f();
15 }
16
17 fn main() {
18     m!(T, f);
19     let _: i32 = ().f();
20 }