]> git.lizzy.rs Git - rust.git/commit - src/tools/rust-analyzer
Rollup merge of #85937 - m-ou-se:macro-ref-suggestions, r=estebank
authorYuki Okushi <jtitor@2k36.org>
Fri, 4 Jun 2021 04:42:58 +0000 (13:42 +0900)
committerGitHub <noreply@github.com>
Fri, 4 Jun 2021 04:42:58 +0000 (13:42 +0900)
commit99fc56b9dedc18e13942e06c1b964cf93cf5a6e7
tree1e41df2aeebe6aa81605c35bba42b76f05451b02
parent5b0a49efa8d5ecc2838edfb93820e46dbff1a606
parente735f6086d4f131ccc6f0205e850860faaea3411
Rollup merge of #85937 - m-ou-se:macro-ref-suggestions, r=estebank

Fix bad suggestions for code from proc_macro

Fixes #85932

This disables these suggestions for spans from external macros, while keeping them for macros defined locally:

Before:
```
3 | #[hello]
  | ^^^^^^^^
  | |
  | expected `&mut i32`, found integer
  | help: consider mutably borrowing here: `&mut #[hello]`
```

After:
```
3 | #[hello]
  | ^^^^^^^^ expected `&mut i32`, found integer
```

Unchanged:
```
26 | macro_rules! bla { () => { x(123); } }
   |                              ^^^
   |                              |
   |                              expected `&mut i32`, found integer
   |                              help: consider mutably borrowing here: `&mut 123`
...
29 |     bla!();
   |     ------- in this macro invocation
```