about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/errors.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-07-03 21:07:44 +0000
committerbors <bors@rust-lang.org>2023-07-03 21:07:44 +0000
commit3f4e5999b241fab30a51fa7fa45a55697c40dbb4 (patch)
treebe71eb0d4c9df15e0324f1e31946f623a0145051 /compiler/rustc_codegen_llvm/src/errors.rs
parentba3bd8f0f1255a7899d17a451c959c9307c9f854 (diff)
parentb4549c50b599929ec47ff4e9d880c27654342bb9 (diff)
downloadrust-3f4e5999b241fab30a51fa7fa45a55697c40dbb4.tar.gz
rust-3f4e5999b241fab30a51fa7fa45a55697c40dbb4.zip
Auto merge of #11094 - y21:issue11084, r=Alexendoo
[`useless_vec`]: add more tests and don't lint inside of macros

Closes #11084.

I realized that the fix I added in #11081 itself also causes an error in a suggestion when inside of a macro. Example:
```rs
macro_rules! x {
  () => {
    for _ in vec![1, 2] {}
  }
}
x!();
```
Here it would suggest replacing `vec![1, 2]` with `[x!()]`, because that's what the source callsite is (reminder: it does this to get the correct span of `x!()` for code like `for _ in vec![x!()]`), but that's wrong when *inside* macros, so I decided to make it not lint if the whole loop construct is inside a macro to avoid this issue.

changelog: [`useless_vec`]: add more tests and don't lint inside of macros

r? `@Alexendoo` since these were your tests, I figured it makes most sense to assign you
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions