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

RFC 2235 - Implement PartialEq,Eq,Hash,Debug for all types #1217

Merged
merged 7 commits into from
Feb 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
target
Cargo.lock
*~
style
340 changes: 0 additions & 340 deletions Cargo.lock

This file was deleted.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ default = ["use_std"]
use_std = []
align = []
rustc-dep-of-std = ['align', 'rustc-std-workspace-core']
extra_traits = ["align"]

[workspace]
members = ["libc-test"]
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ activate the *align* feature. This requires Rust 1.25 or newer:
libc = { version = "0.2", features = ["align"] }
```

All structs implemented by the libc crate have the `Copy` and `Clone` traits
implemented for them. The additional traits of `Debug, `Eq`, `Hash`, and

Choose a reason for hiding this comment

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

Looks like there's a missing backtick after Debug.

`PartialEq` can be enabled with the *extra_traits* feature (requires Rust 1.25
or newer):

```toml
[dependencies]
libc = { version = "0.2", features = ["extra_traits"] }
```

## What is libc?

The primary purpose of this crate is to provide all of the definitions necessary
Expand Down
4 changes: 4 additions & 0 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,8 @@ fi
if [ "$(rustc --version | sed -E 's/^rustc 1\.([0-9]*)\..*/\1/')" -ge 25 ]; then
cargo test $opt --features align --manifest-path libc-test/Cargo.toml --target "${TARGET}"
fi
# Test the `extra_traits` feature if this is building on Rust >= 1.25
if [ "$(rustc --version | sed -E 's/^rustc 1\.([0-9]*)\..*/\1/')" -ge 25 ]; then
cargo test $opt --features extra_traits --manifest-path libc-test/Cargo.toml --target "${TARGET}"
fi
exec cargo test $opt --manifest-path libc-test/Cargo.toml --target "${TARGET}"
1 change: 1 addition & 0 deletions libc-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ctest = "0.2.8"
default = [ "use_std" ]
use_std = [ "libc/use_std" ]
align = [ "libc/align" ]
extra_traits = [ "libc/extra_traits" ]

[[test]]
name = "main"
Expand Down
Loading