File tree 2 files changed +7
-4
lines changed
compiler/rustc_hir_typeck/src
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -501,6 +501,7 @@ pub enum SuggestBoxing {
501
501
#[ suggestion(
502
502
hir_typeck_suggest_ptr_null_mut,
503
503
applicability = "maybe-incorrect" ,
504
+ style = "verbose" ,
504
505
code = "core::ptr::null_mut()"
505
506
) ]
506
507
pub struct SuggestPtrNullMut {
Original file line number Diff line number Diff line change @@ -2,10 +2,8 @@ error[E0308]: mismatched types
2
2
--> $DIR/ptr-null-mutability-suggestions.rs:9:24
3
3
|
4
4
LL | expecting_null_mut(ptr::null());
5
- | ------------------ ^^^^^^^^^^^
6
- | | |
7
- | | types differ in mutability
8
- | | help: consider using `core::ptr::null_mut` instead: `core::ptr::null_mut()`
5
+ | ------------------ ^^^^^^^^^^^ types differ in mutability
6
+ | |
9
7
| arguments to this function are incorrect
10
8
|
11
9
= note: expected raw pointer `*mut u8`
@@ -15,6 +13,10 @@ note: function defined here
15
13
|
16
14
LL | fn expecting_null_mut(_: *mut u8) {}
17
15
| ^^^^^^^^^^^^^^^^^^ ----------
16
+ help: consider using `core::ptr::null_mut` instead
17
+ |
18
+ LL | expecting_null_mut(core::ptr::null_mut());
19
+ | ~~~~~~~~~~~~~~~~~~~~~
18
20
19
21
error: aborting due to 1 previous error
20
22
You can’t perform that action at this time.
0 commit comments