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

Use #![forbid(unsafe_code)] instead of #![deny(unsafe_code)] #20

Closed
SmushyTaco opened this issue Jan 3, 2020 · 1 comment
Closed

Use #![forbid(unsafe_code)] instead of #![deny(unsafe_code)] #20

SmushyTaco opened this issue Jan 3, 2020 · 1 comment

Comments

@SmushyTaco
Copy link

#![deny(unsafe_code)] can be reversed with #![allow(unsafe_code)] while #![forbid(unsafe_code)] can't. With #![forbid(unsafe_code)] you just have to put it at the top of each file (Above the imports so at the very top of the file). So with #![deny(unsafe_code)] you might be using unsafe unknowingly.

@mehcode
Copy link
Member

mehcode commented Jan 3, 2020

Fixed in 8d8fea8


Note that when the sqlite feature is added we'll need to conditionally make that deny(unsafe_code) so we can allow specific areas where we must use unsafe to interact with the SQLite C API. But we can leave it forbid(unsafe_code) as long as the sqlite feature is not enabled.

@mehcode mehcode closed this as completed Jan 3, 2020
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