fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.4 KiB83 linesraw
1error[E0308]: mismatched types
2  --> $DIR/suggest-null-ptr.rs:18:13
3   |
4LL |         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`
11note: function defined here
12  --> $DIR/suggest-null-ptr.rs:7:8
13   |
14LL |     fn foo(ptr: *const u8);
15   |        ^^^
16help: if you meant to create a null pointer, use `std::ptr::null()`
17   |
18LL |         foo(std::ptr::null());
19   |             ~~~~~~~~~~~~~~~~
20
21error[E0308]: mismatched types
22  --> $DIR/suggest-null-ptr.rs:21:17
23   |
24LL |         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`
31note: function defined here
32  --> $DIR/suggest-null-ptr.rs:9:8
33   |
34LL |     fn foo_mut(ptr: *mut u8);
35   |        ^^^^^^^
36help: if you meant to create a null pointer, use `std::ptr::null_mut()`
37   |
38LL |         foo_mut(std::ptr::null_mut());
39   |                 ~~~~~~~~~~~~~~~~~~~~
40
41error[E0308]: mismatched types
42  --> $DIR/suggest-null-ptr.rs:24:15
43   |
44LL |         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`
51note: function defined here
52  --> $DIR/suggest-null-ptr.rs:11:8
53   |
54LL |     fn usize(ptr: *const usize);
55   |        ^^^^^
56help: if you meant to create a null pointer, use `std::ptr::null()`
57   |
58LL |         usize(std::ptr::null());
59   |               ~~~~~~~~~~~~~~~~
60
61error[E0308]: mismatched types
62  --> $DIR/suggest-null-ptr.rs:27:19
63   |
64LL |         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`
71note: function defined here
72  --> $DIR/suggest-null-ptr.rs:13:8
73   |
74LL |     fn usize_mut(ptr: *mut usize);
75   |        ^^^^^^^^^
76help: if you meant to create a null pointer, use `std::ptr::null_mut()`
77   |
78LL |         usize_mut(std::ptr::null_mut());
79   |                   ~~~~~~~~~~~~~~~~~~~~
80
81error: aborting due to 4 previous errors
82
83For more information about this error, try `rustc --explain E0308`.