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

Elaborate the C-DEREF guideline #257

Open
NeverGivinUp opened this issue Dec 27, 2021 · 1 comment
Open

Elaborate the C-DEREF guideline #257

NeverGivinUp opened this issue Dec 27, 2021 · 1 comment

Comments

@NeverGivinUp
Copy link

The motivation for the C-DEREF guideline and the potential problems resulting from ignoring it are (imho) not self explaning. The strongest clue I can find is from the guideline being filed in the Predictability section.

Neither the guideline, the doc or the smart pointer section of The Book explicitly define the difference between smart pointers and general applications of the newtype pattern. Outside the std library contributors there does seem to be confusion (see this old reddit thread). Maybe just referencing C-SMART-PTR would suffice.

Ideally the guideline shouldn't just describe what not to do, but what to do instead: When to impl AsRef/AsMut? What other options are there?

@NeverGivinUp
Copy link
Author

I just saw #251, which might make this issue obsolete. If you feel it does, just close it.

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

1 participant