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

More cleanups and enable some more compiler lints #837

Merged
merged 14 commits into from
Jan 31, 2018
Merged

Conversation

Susurrus
Copy link
Contributor

Gonna run this through CI and see what breaks on non-Linux-x64 platforms.

These changes are minor cleanups, but improve our doc story and should help with future submitted PRs.

@@ -205,6 +205,7 @@ libc_bitflags!(
}
);

#[allow(missing_debug_implementations)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you allow missing debug impls for certain types?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No libc types implement Debug, so derive(Debug) doesn't work for them. I've decided to defer these implementations for now in order to get these checks working for PRs in general. I'd like to come back and add impl Debug for all types as a future PR.

@Susurrus
Copy link
Contributor Author

The latest version relies on rust-lang/libc#898 being merged, but that's passing test so should happen soon.

@Susurrus Susurrus changed the title WIP More cleanups and enable some more compiler lints More cleanups and enable some more compiler lints Jan 15, 2018
@Susurrus
Copy link
Contributor Author

@asomers This is now passing on all platforms and should be good to merge once the OS X backlog dies down a bit on Travis. Can you take a look-see in the meantime? I only expect 429af5e to possibly be controversial since it adds Copy/Clone to a bunch of times, maybe some where it doesn't make sense to have those implemented, specifically RemoteIoVec, SignalIterator, and OpenptyResult.

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a problem with Clone/Copy on any of the types where you added it. They're all plain-old-data types. The only one that could potentially be a problem is OpenptyResult, but given that the public API already promises nothing special on Drop, it's not a problem. It would only be a problem if we significantly reworked the public interface for that type, such as by having it return a pair of File objects instead of RawFds. I found just a few other nits in other changes. Otherwise, the PR looks good.

CHANGELOG.md Outdated
@@ -96,6 +96,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
([#814](https://github.com/nix-rust/nix/pull/814))
- Removed return type from `pause`.
([#829](https://github.com/nix-rust/nix/pull/829))
- Display and Debug for SysControlAddr now includes all fields.
([#829](https://github.com/nix-rust/nix/pull/829))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR number is wrong.

src/features.rs Outdated
@@ -82,6 +83,7 @@ mod os {
}
}

/// Check if the OS supports atmomic close-on-exec for sockets
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/atmomic/atomic here and on line 99

src/sys/aio.rs Outdated
@@ -86,7 +86,7 @@ pub struct AioCb<'a> {
/// Could this `AioCb` potentially have any in-kernel state?
in_progress: bool,
/// Used to keep buffers from Drop'ing
keeper: Keeper<'a>
_keeper: Keeper<'a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes will be unnecessary after and will conflict with #820 . You should revert the changes to this file.

@Susurrus
Copy link
Contributor Author

I've updated based on your first 2 comments. I'll block this one on the merging of #820 and update this once that's merged.

@Susurrus
Copy link
Contributor Author

@asomers All good?

@asomers
Copy link
Member

asomers commented Jan 31, 2018

Yep.

bors r+

bors bot added a commit that referenced this pull request Jan 31, 2018
837: More cleanups and enable some more compiler lints r=asomers a=Susurrus

Gonna run this through CI and see what breaks on non-Linux-x64 platforms.

These changes are minor cleanups, but improve our doc story and should help with future submitted PRs.
@bors
Copy link
Contributor

bors bot commented Jan 31, 2018

@bors bors bot merged commit 3406b1b into nix-rust:master Jan 31, 2018
@Susurrus Susurrus deleted the lints branch February 3, 2018 04:26
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

Successfully merging this pull request may close these issues.

None yet

2 participants