Add allow(unused_unsafe) to some functions.#1294
Conversation
a401dd2 to
df9b44e
Compare
|
Or shall a bunch of |
src/lib.rs
Outdated
| #![cfg_attr(test, deny(warnings))] | ||
| #![recursion_limit = "500"] | ||
| #![deny(unused)] | ||
| #![allow(unused_unsafe)] |
There was a problem hiding this comment.
Where are these unused unsafe blocks? Can't you add the lint more locally?
There was a problem hiding this comment.
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.
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.
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.
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
| #![cfg_attr(test, deny(warnings))] | ||
| #![recursion_limit = "500"] | ||
| #![deny(unused)] | ||
| #![allow(unused_unsafe)] |
There was a problem hiding this comment.
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? |
|
Build succeeded: |
No description provided.