1 #![warn(clippy::eq_op)]
3 // lint also in macro definition
4 macro_rules! assert_in_macro_def {
9 debug_assert_eq!(a, a);
10 debug_assert_ne!(a, a);
14 // lint identical args in assert-like macro invocations (see #3574)
16 assert_in_macro_def!();
21 // lint identical args in `assert_eq!`
23 assert_eq!(a + 1, a + 1);
27 assert_eq!(a + 1, b + 1);
29 // lint identical args in `assert_ne!`
31 assert_ne!(a + 1, a + 1);
35 assert_ne!(a + 1, b + 1);
37 // lint identical args in `debug_assert_eq!`
38 debug_assert_eq!(a, a);
39 debug_assert_eq!(a + 1, a + 1);
41 debug_assert_eq!(a, b);
42 debug_assert_eq!(a, a + 1);
43 debug_assert_eq!(a + 1, b + 1);
45 // lint identical args in `debug_assert_ne!`
46 debug_assert_ne!(a, a);
47 debug_assert_ne!(a + 1, a + 1);
49 debug_assert_ne!(a, b);
50 debug_assert_ne!(a, a + 1);
51 debug_assert_ne!(a + 1, b + 1);
53 let my_vec = vec![1; 5];
54 let mut my_iter = my_vec.iter();
55 assert_ne!(my_iter.next(), my_iter.next());