@@ -55,13 +55,33 @@ error: `as` casting to make a mutable null pointer into an immutable null pointe
5555LL | let _ = ptr::null_mut::<u32>() as *const u32;
5656 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `null()` directly instead: `std::ptr::null::<u32>()`
5757
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+
5870error: `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
6072 |
6173LL | let _ = inline!(ptr::null::<u32>() as *mut u32);
6274 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `null_mut()` directly instead: `std::ptr::null_mut::<u32>()`
6375 |
6476 = note: this error originates in the macro `__inline_mac_fn_null_pointers` (in Nightly builds, run with -Z macro-backtrace for more info)
6577
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
6787
0 commit comments