This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
compiler/rustc_hir_typeck/src Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -501,6 +501,7 @@ pub enum SuggestBoxing {
501501#[ suggestion(
502502 hir_typeck_suggest_ptr_null_mut,
503503 applicability = "maybe-incorrect" ,
504+ style = "verbose" ,
504505 code = "core::ptr::null_mut()"
505506) ]
506507pub struct SuggestPtrNullMut {
Original file line number Diff line number Diff line change @@ -2,10 +2,8 @@ error[E0308]: mismatched types
22 --> $DIR/ptr-null-mutability-suggestions.rs:9:24
33 |
44LL | 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+ | |
97 | arguments to this function are incorrect
108 |
119 = note: expected raw pointer `*mut u8`
@@ -15,6 +13,10 @@ note: function defined here
1513 |
1614LL | fn expecting_null_mut(_: *mut u8) {}
1715 | ^^^^^^^^^^^^^^^^^^ ----------
16+ help: consider using `core::ptr::null_mut` instead
17+ |
18+ LL | expecting_null_mut(core::ptr::null_mut());
19+ | ~~~~~~~~~~~~~~~~~~~~~
1820
1921error: aborting due to 1 previous error
2022
You can’t perform that action at this time.
0 commit comments