-
Notifications
You must be signed in to change notification settings - Fork 676
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
Add allow(unused_unsafe) to some functions. #1294
Conversation
a401dd2
to
df9b44e
Compare
Or shall a bunch of |
src/lib.rs
Outdated
@@ -11,6 +11,7 @@ | |||
#![cfg_attr(test, deny(warnings))] | |||
#![recursion_limit = "500"] | |||
#![deny(unused)] | |||
#![allow(unused_unsafe)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are these unused unsafe blocks? Can't you add the lint more locally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect it to be this.
Shall it be fixed just for for this use case or also for possible future unsafe-to-safe conversions?
Shall it be fixed by just removing unsafe{}
or by allowing unused_unsafe
selectively?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do it selectively, just where we need it. And BTW we'll have to make a 0.18.1 release just for this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a point release? Shouldn't lint caps hide those errors when nix is used as a crates.io dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are "lint caps"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cargo builds dependencies by calling rustc --cap-lints allow
. This means lints are turned off when building dependencies, so crates work with newer rustc even if they use deny(warnings)
(which would otherwise be a really bad idea, it would basically make it impossible to ever add new lints to rustc).
src/lib.rs
Outdated
@@ -11,6 +11,7 @@ | |||
#![cfg_attr(test, deny(warnings))] | |||
#![recursion_limit = "500"] | |||
#![deny(unused)] | |||
#![allow(unused_unsafe)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do it selectively, just where we need it. And BTW we'll have to make a 0.18.1 release just for this change.
(rust-lang/libc#1870) Denied lint being overridden instead of unsafe block removed to preserve compatibility with old `libc` versions.
df9b44e
to
4db701d
Compare
Edited the pull request. Is this this one still needed in face of #1281 which includes similar (but somewhat conflicting) changes? |
@asomers What more to be done for this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
bors r+
Build succeeded: |
No description provided.