Skip to content

Commit 9161a29

Browse files
authored
Merge branch 'nix-rust:master' into remove-deprecated-items
2 parents 4d5e5d8 + d96436e commit 9161a29

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
lines changed

.cirrus.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ env:
1111
# The MSRV
1212
TOOLCHAIN: 1.46.0
1313
ZFLAGS:
14+
# Temporarily disable cargo-hack until we raise the MSRV to 1.51.0 or later.
15+
# See https://github.com/nix-rust/nix/pull/1792
16+
NOHACK: 1
1417

1518
# Tests that don't require executing the build binaries
1619
build: &BUILD
@@ -64,7 +67,7 @@ task:
6467
- cargo test --target i686-unknown-freebsd
6568
i386_feature_script:
6669
- . $HOME/.cargo/env
67-
- cargo hack check --each-feature --target i686-unknown-freebsd
70+
- if [ -z "$NOHACK" ]; then cargo hack check --each-feature --target i686-unknown-freebsd; fi
6871
before_cache_script: rm -rf $CARGO_HOME/registry/index
6972

7073
# Test macOS x86_64 in a full VM
@@ -92,6 +95,9 @@ task:
9295
PATH: $HOME/.cargo/bin:$PATH
9396
RUSTFLAGS: --cfg qemu -D warnings
9497
TOOL: cross
98+
# Cross needs at least 1.51.0 after Serde accidentally raised its MSRV.
99+
# And Clippy has too many false positives from 1.51.0 through 1.53.0
100+
TOOLCHAIN: 1.54.0
95101
matrix:
96102
- name: Linux arm gnueabi
97103
env:

src/sys/signalfd.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,18 +147,17 @@ mod tests {
147147
#[test]
148148
fn create_signalfd() {
149149
let mask = SigSet::empty();
150-
let fd = SignalFd::new(&mask);
151-
fd.expect("assert failed");
150+
SignalFd::new(&mask).unwrap();
152151
}
153152

154153
#[test]
155154
fn create_signalfd_with_opts() {
156155
let mask = SigSet::empty();
157-
let fd = SignalFd::with_flags(
156+
SignalFd::with_flags(
158157
&mask,
159158
SfdFlags::SFD_CLOEXEC | SfdFlags::SFD_NONBLOCK,
160-
);
161-
fd.expect("assert failed");
159+
)
160+
.unwrap();
162161
}
163162

164163
#[test]

test/sys/test_aio.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ mod aio_fsync {
101101
0,
102102
SigevNotify::SigevNone,
103103
));
104-
let err = aiof.as_mut().submit();
105-
err.expect("assert failed");
104+
aiof.as_mut().submit().unwrap();
106105
poll_aio!(&mut aiof).unwrap();
107106
aiof.as_mut().aio_return().unwrap();
108107
}
@@ -148,8 +147,7 @@ mod aio_read {
148147
Box::pin(AioRead::new(fd, 2, &mut rbuf, 0, SigevNotify::SigevNone));
149148
aior.as_mut().submit().unwrap();
150149

151-
let cancelstat = aior.as_mut().cancel();
152-
cancelstat.expect("assert failed");
150+
aior.as_mut().cancel().unwrap();
153151

154152
// Wait for aiow to complete, but don't care whether it succeeded
155153
let _ = poll_aio!(&mut aior);
@@ -341,8 +339,7 @@ mod aio_write {
341339
let err = aiow.as_mut().error();
342340
assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS));
343341

344-
let cancelstat = aiow.as_mut().cancel();
345-
cancelstat.expect("assert failed");
342+
aiow.as_mut().cancel().unwrap();
346343

347344
// Wait for aiow to complete, but don't care whether it succeeded
348345
let _ = poll_aio!(&mut aiow);
@@ -564,8 +561,7 @@ fn test_aio_cancel_all() {
564561
let err = aiocb.as_mut().error();
565562
assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS));
566563

567-
let cancelstat = aio_cancel_all(f.as_raw_fd());
568-
cancelstat.expect("assert failed");
564+
aio_cancel_all(f.as_raw_fd()).unwrap();
569565

570566
// Wait for aiocb to complete, but don't care whether it succeeded
571567
let _ = poll_aio!(&mut aiocb);

test/sys/test_termios.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn test_tcgetattr_pty() {
2222
let _m = crate::PTSNAME_MTX.lock();
2323

2424
let pty = openpty(None, None).expect("openpty failed");
25-
termios::tcgetattr(pty.slave).expect("assert failed");
25+
termios::tcgetattr(pty.slave).unwrap();
2626
close(pty.master).expect("closing the master failed");
2727
close(pty.slave).expect("closing the slave failed");
2828
}

test/test_time.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ pub fn test_clock_gettime() {
2929
#[test]
3030
pub fn test_clock_getcpuclockid() {
3131
let clock_id = clock_getcpuclockid(nix::unistd::Pid::this()).unwrap();
32-
clock_gettime(clock_id).expect("assert failed");
32+
clock_gettime(clock_id).unwrap();
3333
}
3434

3535
#[cfg(not(target_os = "redox"))]
3636
#[test]
3737
pub fn test_clock_id_res() {
38-
ClockId::CLOCK_REALTIME.res().expect("assert failed");
38+
ClockId::CLOCK_REALTIME.res().unwrap();
3939
}
4040

4141
#[test]
4242
pub fn test_clock_id_now() {
43-
ClockId::CLOCK_REALTIME.now().expect("assert failed");
43+
ClockId::CLOCK_REALTIME.now().unwrap();
4444
}
4545

4646
#[cfg(any(
@@ -54,6 +54,6 @@ pub fn test_clock_id_now() {
5454
pub fn test_clock_id_pid_cpu_clock_id() {
5555
ClockId::pid_cpu_clock_id(nix::unistd::Pid::this())
5656
.map(ClockId::now)
57-
.expect("assert failed")
58-
.expect("assert failed");
57+
.unwrap()
58+
.unwrap();
5959
}

0 commit comments

Comments
 (0)