Commit graph

14 commits

Author SHA1 Message Date
bors
786f874c34 New macro utils
changelog: none

Sorry, this is a big one. A lot of interrelated changes and I wanted to put the new utils to use to make sure they are somewhat battle-tested. We may want to divide some of the lint-specific refactoring commits into batches for smaller reviewing tasks. I could also split into more PRs.

Introduces a bunch of new utils at `clippy_utils::macros::...`. Please read through the docs and give any feedback! I'm happy to introduce `MacroCall` and various functions to retrieve an instance. It feels like the missing puzzle piece. I'm also introducing `ExpnId` from rustc as "useful for Clippy too". `@rust-lang/clippy`

Fixes #7843 by not parsing every node of macro implementations, at least the major offenders.

I probably want to get rid of `is_expn_of` at some point.
2022-01-04 22:32:02 +00:00
Andre Bogus
a4ede72b3d update most tests to 2021 edition 2021-10-30 14:50:53 +02:00
Cameron Steffen
0a23fff82d Fix clippy with changed macro statement spans 2021-10-15 02:36:58 -05:00
Aaron Hill
4698b366c4 Show macro name in 'this error originates in macro' message
When there are multiple macros in use, it can be difficult to tell
which one was responsible for producing an error.
2021-05-12 19:03:06 -04:00
Mara Bos
0767a0f9c7 Fix/allow non_fmt_panic in clippy tests. 2021-02-03 23:15:51 +01:00
Lzu Tao
c6a4beaf56 Rustup https://github.com/rust-lang/rust/pull/67359 2020-02-07 10:40:09 +07:00
Yuki Okushi
fdda3c3f25 Tweak wording in assertions_on_constants 2020-01-20 11:52:58 +09:00
Matthias Seiffert
22f057972f Match any expr for panic message 2019-10-07 20:40:05 +02:00
Matthias Seiffert
72a5d7b612 Add message to replace assert!(false) help 2019-10-07 19:13:10 +02:00
flip1995
88359a136f
Update *.stderr file 2019-04-18 12:05:09 +02:00
flip1995
cb2d987ed4
Add tests for assertion_on_constants macro check 2019-02-05 19:37:54 +01:00
A.A.Abroskin
c771f339d7 allow assertions_on_constants for collapsible_if and missing_test_files 2019-01-23 17:58:33 +03:00
A.A.Abroskin
a9f8d3c8fd add assert(true/false, some message) tests 2019-01-09 21:30:47 +03:00
A.A.Abroskin
906b51637c change assert_checks to assertions_on_constants 2019-01-09 13:38:38 +03:00