]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/suggest-ref-macro.rs
Account for method call and indexing when looking for inner-most path in expression
[rust.git] / tests / ui / suggestions / suggest-ref-macro.rs
1 // run-check
2 // aux-build:proc-macro-type-error.rs
3
4 extern crate proc_macro_type_error;
5
6 use proc_macro_type_error::hello;
7
8 #[hello] //~ERROR mismatched types
9 fn abc() {}
10
11 fn x(_: &mut i32) {}
12
13 macro_rules! bla {
14     () => {
15         x(123);
16         //~^ ERROR mismatched types
17         //~| SUGGESTION &mut 123
18     };
19     ($v:expr) => {
20         x($v)
21     }
22 }
23
24 fn main() {
25     bla!();
26     bla!(456);
27     //~^ ERROR mismatched types
28     //~| SUGGESTION &mut 456
29 }