Use verbose suggestion for ptr::null_mut()
This commit is contained in:
parent
c422581297
commit
fca286a39e
@ -501,6 +501,7 @@ pub enum SuggestBoxing {
|
||||
#[suggestion(
|
||||
hir_typeck_suggest_ptr_null_mut,
|
||||
applicability = "maybe-incorrect",
|
||||
style = "verbose",
|
||||
code = "core::ptr::null_mut()"
|
||||
)]
|
||||
pub struct SuggestPtrNullMut {
|
||||
|
@ -2,10 +2,8 @@ error[E0308]: mismatched types
|
||||
--> $DIR/ptr-null-mutability-suggestions.rs:9:24
|
||||
|
|
||||
LL | expecting_null_mut(ptr::null());
|
||||
| ------------------ ^^^^^^^^^^^
|
||||
| | |
|
||||
| | types differ in mutability
|
||||
| | help: consider using `core::ptr::null_mut` instead: `core::ptr::null_mut()`
|
||||
| ------------------ ^^^^^^^^^^^ types differ in mutability
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected raw pointer `*mut u8`
|
||||
@ -15,6 +13,10 @@ note: function defined here
|
||||
|
|
||||
LL | fn expecting_null_mut(_: *mut u8) {}
|
||||
| ^^^^^^^^^^^^^^^^^^ ----------
|
||||
help: consider using `core::ptr::null_mut` instead
|
||||
|
|
||||
LL | expecting_null_mut(core::ptr::null_mut());
|
||||
| ~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user