about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-06-12 17:44:37 +0200
committerGitHub <noreply@github.com>2023-06-12 17:44:37 +0200
commita5245b5894883d6a7803da96ed0899d2066177d4 (patch)
treef1b13d47f49f0ff946373a4e55fc26e9e6f99e80 /compiler/rustc_const_eval/src/errors.rs
parentcb882fa998571e8a7ec1c06bb5d9dd9bc3423629 (diff)
parent432ce39c8bb5520cdaea7a633c86eb11036a5985 (diff)
downloadrust-a5245b5894883d6a7803da96ed0899d2066177d4.tar.gz
rust-a5245b5894883d6a7803da96ed0899d2066177d4.zip
Rollup merge of #112302 - jieyouxu:issue-85184, r=WaffleLapkin
Suggest using `ptr::null_mut` when user provided `ptr::null` to a function expecting `ptr::null_mut`

```
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()`
   |     arguments to this function are incorrect
   |
   = note: expected raw pointer `*mut u8`
              found raw pointer `*const _`
note: function defined here
  --> $DIR/ptr-null-mutability-suggestions.rs:6:4
   |
LL | fn expecting_null_mut(_: *mut u8) {}
   |    ^^^^^^^^^^^^^^^^^^ ----------
```

Closes #85184.
Diffstat (limited to 'compiler/rustc_const_eval/src/errors.rs')
0 files changed, 0 insertions, 0 deletions