|
| 1 | +error[E0308]: mismatched types |
| 2 | + --> $DIR/suggest-null-ptr.rs:18:13 |
| 3 | + | |
| 4 | +LL | foo(0); |
| 5 | + | --- ^ expected `*const u8`, found `usize` |
| 6 | + | | |
| 7 | + | arguments to this function are incorrect |
| 8 | + | |
| 9 | + = note: expected raw pointer `*const u8` |
| 10 | + found type `usize` |
| 11 | +note: function defined here |
| 12 | + --> $DIR/suggest-null-ptr.rs:7:8 |
| 13 | + | |
| 14 | +LL | fn foo(ptr: *const u8); |
| 15 | + | ^^^ |
| 16 | +help: if you meant to create a null pointer, use `std::ptr::null()` |
| 17 | + | |
| 18 | +LL | foo(std::ptr::null()); |
| 19 | + | ~~~~~~~~~~~~~~~~ |
| 20 | + |
| 21 | +error[E0308]: mismatched types |
| 22 | + --> $DIR/suggest-null-ptr.rs:21:17 |
| 23 | + | |
| 24 | +LL | foo_mut(0); |
| 25 | + | ------- ^ expected `*mut u8`, found `usize` |
| 26 | + | | |
| 27 | + | arguments to this function are incorrect |
| 28 | + | |
| 29 | + = note: expected raw pointer `*mut u8` |
| 30 | + found type `usize` |
| 31 | +note: function defined here |
| 32 | + --> $DIR/suggest-null-ptr.rs:9:8 |
| 33 | + | |
| 34 | +LL | fn foo_mut(ptr: *mut u8); |
| 35 | + | ^^^^^^^ |
| 36 | +help: if you meant to create a null pointer, use `std::ptr::null_mut()` |
| 37 | + | |
| 38 | +LL | foo_mut(std::ptr::null_mut()); |
| 39 | + | ~~~~~~~~~~~~~~~~~~~~ |
| 40 | + |
| 41 | +error[E0308]: mismatched types |
| 42 | + --> $DIR/suggest-null-ptr.rs:24:15 |
| 43 | + | |
| 44 | +LL | usize(0); |
| 45 | + | ----- ^ expected `*const usize`, found `usize` |
| 46 | + | | |
| 47 | + | arguments to this function are incorrect |
| 48 | + | |
| 49 | + = note: expected raw pointer `*const usize` |
| 50 | + found type `usize` |
| 51 | +note: function defined here |
| 52 | + --> $DIR/suggest-null-ptr.rs:11:8 |
| 53 | + | |
| 54 | +LL | fn usize(ptr: *const usize); |
| 55 | + | ^^^^^ |
| 56 | +help: if you meant to create a null pointer, use `std::ptr::null()` |
| 57 | + | |
| 58 | +LL | usize(std::ptr::null()); |
| 59 | + | ~~~~~~~~~~~~~~~~ |
| 60 | + |
| 61 | +error[E0308]: mismatched types |
| 62 | + --> $DIR/suggest-null-ptr.rs:27:19 |
| 63 | + | |
| 64 | +LL | usize_mut(0); |
| 65 | + | --------- ^ expected `*mut usize`, found `usize` |
| 66 | + | | |
| 67 | + | arguments to this function are incorrect |
| 68 | + | |
| 69 | + = note: expected raw pointer `*mut usize` |
| 70 | + found type `usize` |
| 71 | +note: function defined here |
| 72 | + --> $DIR/suggest-null-ptr.rs:13:8 |
| 73 | + | |
| 74 | +LL | fn usize_mut(ptr: *mut usize); |
| 75 | + | ^^^^^^^^^ |
| 76 | +help: if you meant to create a null pointer, use `std::ptr::null_mut()` |
| 77 | + | |
| 78 | +LL | usize_mut(std::ptr::null_mut()); |
| 79 | + | ~~~~~~~~~~~~~~~~~~~~ |
| 80 | + |
| 81 | +error: aborting due to 4 previous errors |
| 82 | + |
| 83 | +For more information about this error, try `rustc --explain E0308`. |
0 commit comments