]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hygiene/missing-self-diag.rs
Rollup merge of #90202 - matthewjasper:xcrate-hygiene, r=petrochenkov
[rust.git] / src / test / ui / hygiene / missing-self-diag.rs
1 // Regression test for issue #66898
2 // Tests that we don't emit a nonsensical error message
3 // when a macro invocation tries to access `self` from a function
4 // that has a 'self' parameter
5
6 pub struct Foo;
7
8 macro_rules! call_bar {
9     () => {
10         self.bar(); //~ ERROR expected value
11     }
12 }
13
14 impl Foo {
15     pub fn foo(&self) {
16         call_bar!();
17     }
18
19     pub fn bar(&self) {
20     }
21 }
22
23 fn main() {}