Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make working with unsafe pointers easier #10429

Closed
brson opened this issue Nov 11, 2013 · 1 comment
Closed

Make working with unsafe pointers easier #10429

brson opened this issue Nov 11, 2013 · 1 comment

Comments

@brson
Copy link
Contributor

brson commented Nov 11, 2013

There are a number of common tricks to writing unsafe Rust that tend to be just passed around as received wisdom, but it's not particularly easy or obvious. For some use cases using unsafe pointers is just easier, so we should cater to this with nicer library functions. This is an open-ended task to identify common unsafe patterns and extract them into the standard library. The only things I have in mind off hand are alloc and free functions to encapsulate the transmutes from unique pointers.

@aturon
Copy link
Member

aturon commented Dec 15, 2014

Closing in favor of an RFC issue: rust-lang/rfcs#433

@aturon aturon closed this as completed Dec 15, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 2, 2023
new lint: `missing_fields_in_debug`

Fixes rust-lang#10429

This PR adds a new lint that looks for manual `Debug` implementations that do not "use" all of the fields.
This often happens when adding a new field to a struct.
It also acts as a style lint in case leaving out a field was intentional. In that case, it's preferred to use [`DebugStruct::finish_non_exhaustive`](https://doc.rust-lang.org/stable/std/fmt/struct.DebugStruct.html#method.finish_non_exhaustive), which indicates that there are more fields that were explicitly not shown.

```
changelog: [`missing_fields_in_debug`]: missing fields in manual `Debug` implementation
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants