Skip to content

Commit

Permalink
Merge #1108
Browse files Browse the repository at this point in the history
1108: Raise minimum supported Rust version to 1.36.0 r=asomers a=otavio

Signed-off-by: Otavio Salvador <[email protected]>

Co-authored-by: Otavio Salvador <[email protected]>
Co-authored-by: Alan Somers <[email protected]>
  • Loading branch information
3 people authored Aug 29, 2019
2 parents 22b2cc5 + a9dd7ce commit faaacf9
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ task:
setup_script:
- pkg install -y curl
- curl https://sh.rustup.rs -sSf --output rustup.sh
- sh rustup.sh -y --default-toolchain 1.31.0
- sh rustup.sh -y --default-toolchain 1.36.0
- $HOME/.cargo/bin/rustup target add i686-unknown-freebsd
amd64_test_script:
- . $HOME/.cargo/env
Expand Down
50 changes: 25 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,71 +18,71 @@ matrix:
# week. Additionally they're moved to the front of the line to get them in
# the Travis OS X build queue first.
- env: TARGET="aarch64-apple-ios;armv7-apple-ios;armv7s-apple-ios;i386-apple-ios;x86_64-apple-ios" DISABLE_TESTS=1
rust: 1.31.0
rust: 1.36.0
os: osx

# Mac builds
# These are also moved to be first because they wait in a long queue with
# Travis
- env: TARGET=i686-apple-darwin
rust: 1.31.0
rust: 1.36.0
os: osx
- env: TARGET=x86_64-apple-darwin
rust: 1.31.0
rust: 1.36.0
os: osx

# Android
- env: TARGET=aarch64-linux-android DISABLE_TESTS=1
rust: 1.31.0
rust: 1.36.0
- env: TARGET=arm-linux-androideabi DISABLE_TESTS=1
rust: 1.31.0
rust: 1.36.0
- env: TARGET=armv7-linux-androideabi DISABLE_TESTS=1
rust: 1.31.0
rust: 1.36.0
- env: TARGET=i686-linux-android DISABLE_TESTS=1
rust: 1.31.0
rust: 1.36.0
- env: TARGET=x86_64-linux-android DISABLE_TESTS=1
rust: 1.31.0
rust: 1.36.0

# Linux
- env: TARGET=aarch64-unknown-linux-gnu
rust: 1.31.0
rust: 1.36.0
- env: TARGET=arm-unknown-linux-gnueabi
rust: 1.31.0
rust: 1.36.0
- env: TARGET=arm-unknown-linux-musleabi DISABLE_TESTS=1
rust: 1.31.0
rust: 1.36.0
- env: TARGET=armv7-unknown-linux-gnueabihf
rust: 1.31.0
rust: 1.36.0
- env: TARGET=i686-unknown-linux-gnu
rust: 1.31.0
rust: 1.36.0
- env: TARGET=i686-unknown-linux-musl
rust: 1.31.0
rust: 1.36.0
- env: TARGET=mips-unknown-linux-gnu
rust: 1.31.0
rust: 1.36.0
- env: TARGET=mips64-unknown-linux-gnuabi64
rust: 1.31.0
rust: 1.36.0
- env: TARGET=mips64el-unknown-linux-gnuabi64
rust: 1.31.0
rust: 1.36.0
- env: TARGET=mipsel-unknown-linux-gnu
rust: 1.31.0
rust: 1.36.0
- env: TARGET=powerpc-unknown-linux-gnu DISABLE_TESTS=1
rust: 1.31.0
rust: 1.36.0
- env: TARGET=powerpc64-unknown-linux-gnu
rust: 1.31.0
rust: 1.36.0
- env: TARGET=powerpc64le-unknown-linux-gnu
rust: 1.31.0
rust: 1.36.0
- env: TARGET=s390x-unknown-linux-gnu DISABLE_TESTS=1
rust: 1.31.0
rust: 1.36.0
- env: TARGET=x86_64-unknown-linux-gnu
rust: 1.31.0
rust: 1.36.0
- env: TARGET=x86_64-unknown-linux-musl
rust: 1.31.0
rust: 1.36.0

# *BSD
# FreeBSD i686 and x86_64 use Cirrus instead of Travis
# - env: TARGET=i686-unknown-freebsd DISABLE_TESTS=1
# - env: TARGET=x86_64-unknown-freebsd DISABLE_TESTS=1
- env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1
rust: 1.31.0
rust: 1.36.0

# Make sure stable is always working too
- env: TARGET=x86_64-unknown-linux-gnu
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
let _: OsString = readlinkat(dirfd, &path);
```

- Minimum supported Rust version is now 1.36.0.
([#1108](https://github.com/nix-rust/nix/pull/1108))
### Fixed
### Removed

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Tier 2:

## Usage

`nix` requires Rust 1.31.0 or newer.
`nix` requires Rust 1.36.0 or newer.

To use `nix`, first add this to your `Cargo.toml`:

Expand Down
43 changes: 24 additions & 19 deletions test/sys/test_ioctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,67 +33,72 @@ mod linux {
#[test]
fn test_op_none() {
if cfg!(any(target_arch = "mips", target_arch = "mips64", target_arch="powerpc", target_arch="powerpc64")){
assert_eq!(request_code_none!(b'q', 10), 0x2000_710A);
assert_eq!(request_code_none!(b'a', 255), 0x2000_61FF);
assert_eq!(request_code_none!(b'q', 10) as u32, 0x2000_710A);
assert_eq!(request_code_none!(b'a', 255) as u32, 0x2000_61FF);
} else {
assert_eq!(request_code_none!(b'q', 10), 0x0000_710A);
assert_eq!(request_code_none!(b'a', 255), 0x0000_61FF);
assert_eq!(request_code_none!(b'q', 10) as u32, 0x0000_710A);
assert_eq!(request_code_none!(b'a', 255) as u32, 0x0000_61FF);
}
}

#[test]
fn test_op_write() {
if cfg!(any(target_arch = "mips", target_arch = "mips64", target_arch="powerpc", target_arch="powerpc64")){
assert_eq!(request_code_write!(b'z', 10, 1), 0x8001_7A0A);
assert_eq!(request_code_write!(b'z', 10, 512), 0x8200_7A0A);
assert_eq!(request_code_write!(b'z', 10, 1) as u32, 0x8001_7A0A);
assert_eq!(request_code_write!(b'z', 10, 512) as u32, 0x8200_7A0A);
} else {
assert_eq!(request_code_write!(b'z', 10, 1), 0x4001_7A0A);
assert_eq!(request_code_write!(b'z', 10, 512), 0x4200_7A0A);
assert_eq!(request_code_write!(b'z', 10, 1) as u32, 0x4001_7A0A);
assert_eq!(request_code_write!(b'z', 10, 512) as u32, 0x4200_7A0A);
}
}

#[cfg(target_pointer_width = "64")]
#[test]
fn test_op_write_64() {
if cfg!(any(target_arch = "mips64", target_arch="powerpc64")){
assert_eq!(request_code_write!(b'z', 10, (1 as u64) << 32), 0x8000_7A0A);
assert_eq!(request_code_write!(b'z', 10, (1 as u64) << 32) as u32,
0x8000_7A0A);
} else {
assert_eq!(request_code_write!(b'z', 10, (1 as u64) << 32), 0x4000_7A0A);
assert_eq!(request_code_write!(b'z', 10, (1 as u64) << 32) as u32,
0x4000_7A0A);
}

}

#[test]
fn test_op_read() {
if cfg!(any(target_arch = "mips", target_arch = "mips64", target_arch="powerpc", target_arch="powerpc64")){
assert_eq!(request_code_read!(b'z', 10, 1), 0x4001_7A0A);
assert_eq!(request_code_read!(b'z', 10, 512), 0x4200_7A0A);
assert_eq!(request_code_read!(b'z', 10, 1) as u32, 0x4001_7A0A);
assert_eq!(request_code_read!(b'z', 10, 512) as u32, 0x4200_7A0A);
} else {
assert_eq!(request_code_read!(b'z', 10, 1), 0x8001_7A0A);
assert_eq!(request_code_read!(b'z', 10, 512), 0x8200_7A0A);
assert_eq!(request_code_read!(b'z', 10, 1) as u32, 0x8001_7A0A);
assert_eq!(request_code_read!(b'z', 10, 512) as u32, 0x8200_7A0A);
}
}

#[cfg(target_pointer_width = "64")]
#[test]
fn test_op_read_64() {
if cfg!(any(target_arch = "mips64", target_arch="powerpc64")){
assert_eq!(request_code_read!(b'z', 10, (1 as u64) << 32), 0x4000_7A0A);
assert_eq!(request_code_read!(b'z', 10, (1 as u64) << 32) as u32,
0x4000_7A0A);
} else {
assert_eq!(request_code_read!(b'z', 10, (1 as u64) << 32), 0x8000_7A0A);
assert_eq!(request_code_read!(b'z', 10, (1 as u64) << 32) as u32,
0x8000_7A0A);
}
}

#[test]
fn test_op_read_write() {
assert_eq!(request_code_readwrite!(b'z', 10, 1), 0xC001_7A0A);
assert_eq!(request_code_readwrite!(b'z', 10, 512), 0xC200_7A0A);
assert_eq!(request_code_readwrite!(b'z', 10, 1) as u32, 0xC001_7A0A);
assert_eq!(request_code_readwrite!(b'z', 10, 512) as u32, 0xC200_7A0A);
}

#[cfg(target_pointer_width = "64")]
#[test]
fn test_op_read_write_64() {
assert_eq!(request_code_readwrite!(b'z', 10, (1 as u64) << 32), 0xC000_7A0A);
assert_eq!(request_code_readwrite!(b'z', 10, (1 as u64) << 32) as u32,
0xC000_7A0A);
}
}

Expand Down

0 comments on commit faaacf9

Please sign in to comment.