Closed
Description
Given the following code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=08b90ff4a7eec137c7da11cbb5f8d81f
use core::ptr;
fn test(_: *mut u8){}
fn main() {
test(ptr::null());
}
The current output is:
error[E0308]: mismatched types
--> src/main.rs:6:10
|
6 | test(ptr::null());
| ^^^^^^^^^^^ types differ in mutability
|
= note: expected raw pointer `*mut u8`
found raw pointer `*const _`
Ideally it would suggest me to use ptr::null_mut()
instead.
@estebank (opened this issue because you always ask people on twitter to open issues about diagnostic improvements :) )