File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ fn main() {
5
5
let _ = 0 as * mut f64 ;
6
6
let _: * const u8 = 0 as * const _ ;
7
7
8
+ // FIXME: ugly suggestion
9
+ #[ rustfmt:: skip]
10
+ let _ = 0 as * const usize ;
11
+
8
12
foo ( 0 as _ , 0 as _ ) ;
9
13
foo ( 0 as * const _ , 0 as * mut _ ) ;
10
14
Original file line number Diff line number Diff line change @@ -19,16 +19,22 @@ LL | let _: *const u8 = 0 as *const _;
19
19
| ^^^^^^^^^^^^^ help: try: `std::ptr::null()`
20
20
21
21
error: `0 as *const _` detected
22
- --> $DIR/zero_ptr.rs:9:9
22
+ --> $DIR/zero_ptr.rs:10:13
23
+ |
24
+ LL | let _ = 0 as * const usize;
25
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::null::<* const usize>()`
26
+
27
+ error: `0 as *const _` detected
28
+ --> $DIR/zero_ptr.rs:13:9
23
29
|
24
30
LL | foo(0 as *const _, 0 as *mut _);
25
31
| ^^^^^^^^^^^^^ help: try: `std::ptr::null()`
26
32
27
33
error: `0 as *mut _` detected
28
- --> $DIR/zero_ptr.rs:9 :24
34
+ --> $DIR/zero_ptr.rs:13 :24
29
35
|
30
36
LL | foo(0 as *const _, 0 as *mut _);
31
37
| ^^^^^^^^^^^ help: try: `std::ptr::null_mut()`
32
38
33
- error: aborting due to 5 previous errors
39
+ error: aborting due to 6 previous errors
34
40
You can’t perform that action at this time.
0 commit comments