Skip to content

Commit d87d401

Browse files
authored
Merge pull request #2105 from asomers/r0.26.3
Prepare release 0.26.3
2 parents 1e3f062 + 9dc34de commit d87d401

26 files changed

+246
-146
lines changed

.cirrus.yml

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,32 @@ cargo_cache:
55
env:
66
# Build by default; don't just check
77
BUILD: build
8+
CLIPPYFLAGS: -D warnings -A unknown-lints
89
RUSTFLAGS: -D warnings
910
RUSTDOCFLAGS: -D warnings
1011
TOOL: cargo
11-
# The MSRV
12-
TOOLCHAIN: 1.56.1
12+
MSRV: 1.56.1
1313
ZFLAGS:
1414

1515
# Tests that don't require executing the build binaries
1616
build: &BUILD
1717
build_script:
1818
- . $HOME/.cargo/env || true
19-
- $TOOL +$TOOLCHAIN -Vv
20-
- rustc +$TOOLCHAIN -Vv
21-
- $TOOL +$TOOLCHAIN $BUILD $ZFLAGS --target $TARGET --all-targets
22-
- $TOOL +$TOOLCHAIN doc $ZFLAGS --no-deps --target $TARGET
23-
- $TOOL +$TOOLCHAIN clippy $ZFLAGS --target $TARGET --all-targets -- -D warnings
19+
- $TOOL -Vv
20+
- rustc -Vv
21+
- $TOOL $BUILD $ZFLAGS --target $TARGET --all-targets
22+
- $TOOL doc $ZFLAGS --no-deps --target $TARGET
23+
- $TOOL clippy $ZFLAGS --target $TARGET --all-targets -- $CLIPPYFLAGS
2424
- if [ -z "$NOHACK" ]; then mkdir -p $HOME/.cargo/bin; export PATH=$HOME/.cargo/bin:$PATH; fi
2525
- if [ -z "$NOHACK" ]; then curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-${HOST:-$TARGET}.tar.gz | tar xzf - -C ~/.cargo/bin; fi
26-
- if [ -z "$NOHACK" ]; then $TOOL +$TOOLCHAIN hack $ZFLAGS check --target $TARGET --each-feature; fi
26+
- if [ -z "$NOHACK" ]; then $TOOL hack $ZFLAGS check --target $TARGET --each-feature; fi
2727

2828
# Tests that do require executing the binaries
2929
test: &TEST
3030
<< : *BUILD
3131
test_script:
3232
- . $HOME/.cargo/env || true
33-
- $TOOL +$TOOLCHAIN test --target $TARGET
33+
- $TOOL test --target $TARGET
3434

3535
# Test FreeBSD in a full VM. Test the i686 target too, in the
3636
# same VM. The binary will be built in 32-bit mode, but will execute on a
@@ -52,10 +52,10 @@ task:
5252
setup_script:
5353
- kldload mqueuefs
5454
- fetch https://sh.rustup.rs -o rustup.sh
55-
- sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
55+
- sh rustup.sh -y --profile=minimal --default-toolchain $MSRV
5656
- . $HOME/.cargo/env
5757
- rustup target add i686-unknown-freebsd
58-
- rustup component add --toolchain $TOOLCHAIN clippy
58+
- rustup component add clippy
5959
<< : *TEST
6060
i386_test_script:
6161
- . $HOME/.cargo/env
@@ -76,9 +76,9 @@ task:
7676
image: ghcr.io/cirruslabs/macos-ventura-base:latest
7777
setup_script:
7878
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
79-
- sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
79+
- sh rustup.sh -y --profile=minimal --default-toolchain $MSRV
8080
- . $HOME/.cargo/env
81-
- rustup component add --toolchain $TOOLCHAIN clippy
81+
- rustup component add clippy
8282
<< : *TEST
8383
before_cache_script: rm -rf $CARGO_HOME/registry/index
8484

@@ -129,9 +129,9 @@ task:
129129
setup_script:
130130
- mkdir /tmp/home
131131
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
132-
- sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
132+
- sh rustup.sh -y --profile=minimal --default-toolchain $MSRV
133133
- . $HOME/.cargo/env
134-
- cargo install cross --version 0.2.1 # cross 0.2.2 bumped the MSRV to 1.58.1
134+
- cargo install cross --version 0.2.1 --locked # cross 0.2.2 bumped the MSRV to 1.58.1
135135
<< : *TEST
136136
before_cache_script: rm -rf $CARGO_HOME/registry/index
137137

@@ -142,7 +142,6 @@ task:
142142
arm_container:
143143
image: rust:1.56
144144
env:
145-
RUSTFLAGS: --cfg graviton -D warnings
146145
TARGET: aarch64-unknown-linux-gnu
147146
- name: Linux x86_64
148147
container:
@@ -166,9 +165,7 @@ task:
166165
image: rust:latest
167166
env:
168167
TARGET: x86_64-unknown-linux-gnu
169-
TOOLCHAIN:
170168
setup_script:
171-
- rustup target add $TARGET
172169
- rustup component add clippy
173170
<< : *TEST
174171
before_cache_script: rm -rf $CARGO_HOME/registry/index
@@ -243,38 +240,36 @@ task:
243240
TARGET: x86_64-unknown-netbsd
244241
setup_script:
245242
- rustup target add $TARGET
246-
- rustup toolchain install $TOOLCHAIN --profile minimal --target $TARGET
247-
- rustup component add --toolchain $TOOLCHAIN clippy
243+
- rustup component add clippy
248244
<< : *BUILD
249245
before_cache_script: rm -rf $CARGO_HOME/registry/index
250246

251247
task:
252248
container:
253-
image: rust:1.56
249+
# Redox's MSRV policy is unclear. Until they define it, use nightly.
250+
image: rustlang/rust:nightly
254251
env:
255252
BUILD: check
256253
name: Redox x86_64
257254
env:
258255
HOST: x86_64-unknown-linux-gnu
259256
TARGET: x86_64-unknown-redox
260-
# Redox's MSRV policy is unclear. Until they define it, use nightly.
261-
TOOLCHAIN: nightly
257+
CLIPPYFLAGS: -D warnings
262258
setup_script:
263259
- rustup target add $TARGET
264-
- rustup toolchain install $TOOLCHAIN --profile minimal --target $TARGET
265-
- rustup component add --toolchain $TOOLCHAIN clippy
260+
- rustup component add clippy
266261
<< : *BUILD
267262
before_cache_script: rm -rf $CARGO_HOME/registry/index
268263

269-
# Rust Tier 3 targets can't use Rustup
264+
## Rust Tier 3 targets can't use Rustup
270265
task:
271266
container:
272267
image: rustlang/rust:nightly
273268
env:
274269
BUILD: check
275270
HOST: x86_64-unknown-linux-gnu
276-
TOOLCHAIN: nightly
277271
ZFLAGS: -Zbuild-std
272+
CLIPPYFLAGS: -D warnings
278273
matrix:
279274
- name: DragonFly BSD x86_64
280275
env:
@@ -300,7 +295,6 @@ task:
300295
name: Minver
301296
env:
302297
HOST: x86_64-unknown-linux-gnu
303-
TOOLCHAIN: nightly
304298
container:
305299
image: rustlang/rust:nightly
306300
setup_script:
@@ -314,5 +308,5 @@ task:
314308
name: Rust Formatter
315309
container:
316310
image: rust:latest
317-
setup_script: rustup +$TOOLCHAIN component add rustfmt
318-
test_script: $TOOL +$TOOLCHAIN fmt --all -- --check **/*.rs
311+
setup_script: rustup component add rustfmt
312+
test_script: cargo fmt --all -- --check **/*.rs

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](https://semver.org/).
55

6+
## [Unreleased] - ReleaseDate
7+
8+
### Fixed
9+
- Fix: send `ETH_P_ALL` in htons format
10+
([#1925](https://github.com/nix-rust/nix/pull/1925))
11+
- Fix: `recvmsg` now sets the length of the received `sockaddr_un` field
12+
correctly on Linux platforms. ([#2041](https://github.com/nix-rust/nix/pull/2041))
13+
- Fix potentially invalid conversions in
14+
`SockaddrIn::from<std::net::SocketAddrV4>`,
15+
`SockaddrIn6::from<std::net::SockaddrV6>`, `IpMembershipRequest::new`, and
16+
`Ipv6MembershipRequest::new` with future Rust versions.
17+
([#2061](https://github.com/nix-rust/nix/pull/2061))
18+
- Fixed an incorrect lifetime returned from `recvmsg`.
19+
([#2095](https://github.com/nix-rust/nix/pull/2095))
20+
621
## [0.26.2] - 2023-01-18
722
### Fixed
823
- Fix `SockaddrIn6` bug that was swapping flowinfo and scope_id byte ordering.

Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ targets = [
2828

2929
[dependencies]
3030
libc = { version = "0.2.137", features = [ "extra_traits" ] }
31-
bitflags = "1.1"
31+
bitflags = "2.3.1"
3232
cfg-if = "1.0"
3333
pin-utils = { version = "0.1.0", optional = true }
34-
static_assertions = "1"
3534

3635
[target.'cfg(not(target_os = "redox"))'.dependencies]
3736
memoffset = { version = "0.7", optional = true }
@@ -83,7 +82,9 @@ assert-impl = "0.1"
8382
lazy_static = "1.4"
8483
parking_lot = "0.12"
8584
rand = "0.8"
86-
tempfile = "3.3.0"
85+
# tempfile 3.7.0 doesn't build on Haiku
86+
# https://github.com/Stebalien/tempfile/issues/246
87+
tempfile = ">=3.3.0, < 3.7.0"
8788
semver = "1.0.7"
8889

8990
[target.'cfg(any(target_os = "android", target_os = "linux"))'.dev-dependencies]

src/dir.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ impl Drop for Dir {
101101
}
102102
}
103103

104+
// The pass by mut is technically needless only because the inner NonNull is
105+
// Copy. But philosophically we're mutating the Dir, so we pass by mut.
106+
#[allow(clippy::needless_pass_by_ref_mut)]
104107
fn next(dir: &mut Dir) -> Option<Result<Entry>> {
105108
unsafe {
106109
// Note: POSIX specifies that portable applications should dynamically allocate a

src/fcntl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ pub fn vmsplice(
638638
}
639639
}
640640

641-
#[cfg(any(target_os = "linux"))]
641+
#[cfg(target_os = "linux")]
642642
#[cfg(feature = "fs")]
643643
libc_bitflags!(
644644
/// Mode argument flags for fallocate determining operation performed on a given range.
@@ -678,7 +678,7 @@ feature! {
678678
///
679679
/// Allows the caller to directly manipulate the allocated disk space for the
680680
/// file referred to by fd.
681-
#[cfg(any(target_os = "linux"))]
681+
#[cfg(target_os = "linux")]
682682
#[cfg(feature = "fs")]
683683
pub fn fallocate(
684684
fd: RawFd,

src/macros.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ macro_rules! libc_bitflags {
6363
}
6464
) => {
6565
::bitflags::bitflags! {
66+
#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
67+
#[repr(transparent)]
6668
$(#[$outer])*
6769
pub struct $BitFlags: $T {
6870
$(

src/mount/bsd.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ impl<'a> Nmount<'a> {
391391
});
392392

393393
let niov = self.iov.len() as c_uint;
394-
let iovp = self.iov.as_mut_ptr() as *mut libc::iovec;
395-
let res = unsafe { libc::nmount(iovp, niov, flags.bits) };
394+
let iovp = self.iov.as_mut_ptr();
395+
let res = unsafe { libc::nmount(iovp, niov, flags.bits()) };
396396
match Errno::result(res) {
397397
Ok(_) => Ok(()),
398398
Err(error) => {
@@ -446,7 +446,7 @@ where
446446
P: ?Sized + NixPath,
447447
{
448448
let res = mountpoint.with_nix_path(|cstr| unsafe {
449-
libc::unmount(cstr.as_ptr(), flags.bits)
449+
libc::unmount(cstr.as_ptr(), flags.bits())
450450
})?;
451451

452452
Errno::result(res).map(drop)

src/mount/linux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub fn mount<
8888
s,
8989
t.as_ptr(),
9090
ty,
91-
flags.bits,
91+
flags.bits(),
9292
d as *const libc::c_void,
9393
)
9494
})
@@ -108,7 +108,7 @@ pub fn umount<P: ?Sized + NixPath>(target: &P) -> Result<()> {
108108

109109
pub fn umount2<P: ?Sized + NixPath>(target: &P, flags: MntFlags) -> Result<()> {
110110
let res = target.with_nix_path(|cstr| unsafe {
111-
libc::umount2(cstr.as_ptr(), flags.bits)
111+
libc::umount2(cstr.as_ptr(), flags.bits())
112112
})?;
113113

114114
Errno::result(res).map(drop)

src/mqueue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl MqAttr {
139139
/// Open a message queue
140140
///
141141
/// See also [`mq_open(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_open.html)
142-
// The mode.bits cast is only lossless on some OSes
142+
// The mode.bits() cast is only lossless on some OSes
143143
#[allow(clippy::cast_lossless)]
144144
pub fn mq_open(
145145
name: &CStr,

src/sys/event.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct KEvent {
2626
target_os = "openbsd"
2727
))]
2828
type type_of_udata = *mut libc::c_void;
29-
#[cfg(any(target_os = "netbsd"))]
29+
#[cfg(target_os = "netbsd")]
3030
type type_of_udata = intptr_t;
3131

3232
#[cfg(target_os = "netbsd")]
@@ -87,7 +87,7 @@ libc_enum! {
8787
target_os = "openbsd"
8888
))]
8989
pub type type_of_event_flag = u16;
90-
#[cfg(any(target_os = "netbsd"))]
90+
#[cfg(target_os = "netbsd")]
9191
pub type type_of_event_flag = u32;
9292
libc_bitflags! {
9393
pub struct EventFlag: type_of_event_flag {

0 commit comments

Comments
 (0)