Skip to content

Commit 0a10e02

Browse files
authored
Update the MSRV to Rust 1.63. (#64)
This allows us to make a few more functions `const`.
1 parent 3092329 commit 0a10e02

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
rust: [stable, nightly, 1.48]
15+
rust: [stable, nightly, 1.63]
1616

1717
env:
1818
RUSTFLAGS: -D warnings

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ description = "Generated bindings for Linux's userspace API"
66
documentation = "https://docs.rs/linux-raw-sys"
77
license = "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT"
88
repository = "https://github.com/sunfishcode/linux-raw-sys"
9-
edition = "2018"
9+
edition = "2021"
1010
keywords = ["linux", "uapi", "ffi"]
1111
categories = ["external-ffi-bindings"]
1212
exclude = ["/gen", "/.*"]
13-
rust-version = "1.48"
13+
rust-version = "1.63"
1414

1515
[dependencies]
1616
core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ exported by Linux's headers but nonetheless needed by userspace.
3636
# Minimum Supported Rust Version (MSRV)
3737

3838
This crate currently works on the version of [Rust on Debian stable], which is
39-
currently Rust 1.48. This policy may change in the future, in minor version
39+
currently Rust 1.63. This policy may change in the future, in minor version
4040
releases, so users using a fixed version of Rust should pin to a specific
4141
version of this crate.
4242

gen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "gen"
33
version = "0.0.0"
4-
edition = "2018"
4+
edition = "2021"
55
publish = false
66

77
[dependencies]

src/lib.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ pub mod cmsg_macros {
9090
(len + c_long_size - 1) & !(c_long_size - 1)
9191
}
9292

93-
// TODO: In Rust 1.63 we can make this a `const fn`.
94-
pub unsafe fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar {
93+
pub const unsafe fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar {
9594
(cmsg as *mut c_uchar).add(size_of::<cmsghdr>())
9695
}
9796

@@ -103,8 +102,7 @@ pub mod cmsg_macros {
103102
size_of::<cmsghdr>() as c_uint + len
104103
}
105104

106-
// TODO: In Rust 1.63 we can make this a `const fn`.
107-
pub unsafe fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
105+
pub const unsafe fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
108106
if (*mhdr).msg_controllen < size_of::<cmsghdr>() as _ {
109107
return ptr::null_mut();
110108
}
@@ -178,9 +176,8 @@ pub mod signal_macros {
178176
/// `SIG_IGN` value into a function pointer in a `const` initializer, so
179177
/// we make it a function instead.
180178
///
181-
// TODO: In Rust 1.56 we can make this a `const fn`.
182179
#[inline]
183-
pub fn sig_ign() -> super::general::__kernel_sighandler_t {
180+
pub const fn sig_ign() -> super::general::__kernel_sighandler_t {
184181
// Safety: This creates an invalid pointer, but the pointer type
185182
// includes `unsafe`, which covers the safety of calling it.
186183
Some(unsafe {

0 commit comments

Comments
 (0)