@@ -55,13 +55,33 @@ error: `as` casting to make a mutable null pointer into an immutable null pointe
55
55
LL | let _ = ptr::null_mut::<u32>() as *const u32;
56
56
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `null()` directly instead: `std::ptr::null::<u32>()`
57
57
58
+ error: changing constness of a null pointer
59
+ --> tests/ui/ptr_cast_constness.rs:77:13
60
+ |
61
+ LL | let _ = ptr::null::<u32>().cast_mut();
62
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `null_mut()` directly instead: `std::ptr::null_mut::<u32>()`
63
+
64
+ error: changing constness of a null pointer
65
+ --> tests/ui/ptr_cast_constness.rs:78:13
66
+ |
67
+ LL | let _ = ptr::null_mut::<u32>().cast_const();
68
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `null()` directly instead: `std::ptr::null::<u32>()`
69
+
58
70
error: `as` casting to make a const null pointer into a mutable null pointer
59
- --> tests/ui/ptr_cast_constness.rs:79 :21
71
+ --> tests/ui/ptr_cast_constness.rs:81 :21
60
72
|
61
73
LL | let _ = inline!(ptr::null::<u32>() as *mut u32);
62
74
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `null_mut()` directly instead: `std::ptr::null_mut::<u32>()`
63
75
|
64
76
= note: this error originates in the macro `__inline_mac_fn_null_pointers` (in Nightly builds, run with -Z macro-backtrace for more info)
65
77
66
- error: aborting due to 10 previous errors
78
+ error: changing constness of a null pointer
79
+ --> tests/ui/ptr_cast_constness.rs:82:21
80
+ |
81
+ LL | let _ = inline!(ptr::null::<u32>().cast_mut());
82
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `null_mut()` directly instead: `std::ptr::null_mut::<u32>()`
83
+ |
84
+ = note: this error originates in the macro `__inline_mac_fn_null_pointers` (in Nightly builds, run with -Z macro-backtrace for more info)
85
+
86
+ error: aborting due to 13 previous errors
67
87
0 commit comments