mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 23:24:24 +00:00
786f874c34
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.
95 lines
2.9 KiB
Text
95 lines
2.9 KiB
Text
error: identical args used in this `assert_eq!` macro call
|
|
--> $DIR/eq_op_macros.rs:7:20
|
|
|
|
|
LL | assert_eq!(a, a);
|
|
| ^^^^
|
|
...
|
|
LL | assert_in_macro_def!();
|
|
| ---------------------- in this macro invocation
|
|
|
|
|
= note: `-D clippy::eq-op` implied by `-D warnings`
|
|
= note: this error originates in the macro `assert_in_macro_def` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: identical args used in this `assert_ne!` macro call
|
|
--> $DIR/eq_op_macros.rs:8:20
|
|
|
|
|
LL | assert_ne!(a, a);
|
|
| ^^^^
|
|
...
|
|
LL | assert_in_macro_def!();
|
|
| ---------------------- in this macro invocation
|
|
|
|
|
= note: this error originates in the macro `assert_in_macro_def` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: identical args used in this `debug_assert_eq!` macro call
|
|
--> $DIR/eq_op_macros.rs:9:26
|
|
|
|
|
LL | debug_assert_eq!(a, a);
|
|
| ^^^^
|
|
...
|
|
LL | assert_in_macro_def!();
|
|
| ---------------------- in this macro invocation
|
|
|
|
|
= note: this error originates in the macro `assert_in_macro_def` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: identical args used in this `debug_assert_ne!` macro call
|
|
--> $DIR/eq_op_macros.rs:10:26
|
|
|
|
|
LL | debug_assert_ne!(a, a);
|
|
| ^^^^
|
|
...
|
|
LL | assert_in_macro_def!();
|
|
| ---------------------- in this macro invocation
|
|
|
|
|
= note: this error originates in the macro `assert_in_macro_def` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: identical args used in this `assert_eq!` macro call
|
|
--> $DIR/eq_op_macros.rs:22:16
|
|
|
|
|
LL | assert_eq!(a, a);
|
|
| ^^^^
|
|
|
|
error: identical args used in this `assert_eq!` macro call
|
|
--> $DIR/eq_op_macros.rs:23:16
|
|
|
|
|
LL | assert_eq!(a + 1, a + 1);
|
|
| ^^^^^^^^^^^^
|
|
|
|
error: identical args used in this `assert_ne!` macro call
|
|
--> $DIR/eq_op_macros.rs:30:16
|
|
|
|
|
LL | assert_ne!(a, a);
|
|
| ^^^^
|
|
|
|
error: identical args used in this `assert_ne!` macro call
|
|
--> $DIR/eq_op_macros.rs:31:16
|
|
|
|
|
LL | assert_ne!(a + 1, a + 1);
|
|
| ^^^^^^^^^^^^
|
|
|
|
error: identical args used in this `debug_assert_eq!` macro call
|
|
--> $DIR/eq_op_macros.rs:38:22
|
|
|
|
|
LL | debug_assert_eq!(a, a);
|
|
| ^^^^
|
|
|
|
error: identical args used in this `debug_assert_eq!` macro call
|
|
--> $DIR/eq_op_macros.rs:39:22
|
|
|
|
|
LL | debug_assert_eq!(a + 1, a + 1);
|
|
| ^^^^^^^^^^^^
|
|
|
|
error: identical args used in this `debug_assert_ne!` macro call
|
|
--> $DIR/eq_op_macros.rs:46:22
|
|
|
|
|
LL | debug_assert_ne!(a, a);
|
|
| ^^^^
|
|
|
|
error: identical args used in this `debug_assert_ne!` macro call
|
|
--> $DIR/eq_op_macros.rs:47:22
|
|
|
|
|
LL | debug_assert_ne!(a + 1, a + 1);
|
|
| ^^^^^^^^^^^^
|
|
|
|
error: aborting due to 12 previous errors
|
|
|