about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/cmp_null.stderr
blob: 8a75b050111931178af0d91c2290bbc0d0fcb117 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
error: comparing with null is better expressed by the `.is_null()` method
  --> tests/ui/cmp_null.rs:9:8
   |
LL |     if p == ptr::null() {
   |        ^^^^^^^^^^^^^^^^ help: try: `p.is_null()`
   |
   = note: `-D clippy::cmp-null` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::cmp_null)]`

error: comparing with null is better expressed by the `.is_null()` method
  --> tests/ui/cmp_null.rs:14:8
   |
LL |     if ptr::null() == p {
   |        ^^^^^^^^^^^^^^^^ help: try: `p.is_null()`

error: comparing with null is better expressed by the `.is_null()` method
  --> tests/ui/cmp_null.rs:22:8
   |
LL |     if m == ptr::null_mut() {
   |        ^^^^^^^^^^^^^^^^^^^^ help: try: `m.is_null()`

error: comparing with null is better expressed by the `.is_null()` method
  --> tests/ui/cmp_null.rs:27:8
   |
LL |     if ptr::null_mut() == m {
   |        ^^^^^^^^^^^^^^^^^^^^ help: try: `m.is_null()`

error: comparing with null is better expressed by the `.is_null()` method
  --> tests/ui/cmp_null.rs:33:13
   |
LL |     let _ = x as *const () == ptr::null();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(x as *const ()).is_null()`

error: comparing with null is better expressed by the `.is_null()` method
  --> tests/ui/cmp_null.rs:39:19
   |
LL |     debug_assert!(f != std::ptr::null_mut());
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!f.is_null()`

error: aborting due to 6 previous errors