Skip to content

Commit ab1e9c0

Browse files
authored
Remove internal usage of std (#9)
* MSRV: bump from 1.63 to 1.81 * Remove internal usage of std std was used for the Error trait and Duration type, both of which are available in core. * remove "std" feature. the functionality "std" enabled in rustix-uring is now available without the "std" feature. this feature also enabled the "std" feature for the crates rustix and bitflags. downstream users of rustix-uring should explicitly enable the "std" features for those crates if needed. * release 0.4.0 breaking changes: - MSRV 1.63 -> 1.81 - "std" feature removed
1 parent cea0654 commit ab1e9c0

File tree

6 files changed

+11
-17
lines changed

6 files changed

+11
-17
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
matrix:
4343
toolchain:
4444
- stable
45-
- "1.63"
45+
- "1.81"
4646
target:
4747
- x86_64-unknown-linux-gnu
4848
- x86_64-unknown-linux-musl
@@ -68,7 +68,7 @@ jobs:
6868
matrix:
6969
toolchain:
7070
- stable
71-
- "1.63"
71+
- "1.81"
7272
target:
7373
- i686-unknown-linux-gnu
7474

Cargo.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustix-uring"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
authors = ["Jordan Isaacs <mail@jdisaacs.com>"]
55
edition = "2021"
66
license = "MIT OR Apache-2.0"
@@ -9,24 +9,21 @@ homepage = "https://github.com/jordanisaacs/rustix-uring"
99
documentation = "https://docs.rs/rustix-uring"
1010
description = "The low-level `io_uring` userspace interface for Rust"
1111
categories = [ "asynchronous", "network-programming", "filesystem" ]
12-
rust-version = "1.63"
12+
rust-version = "1.81"
1313

1414
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1515

1616
[workspace]
1717
exclude = ["/flake.*", ".envrc"]
1818
members = [ "io-uring-test", "io-uring-bench" ]
1919

20-
[features]
21-
default = ["std"]
22-
std = ["rustix/std", "bitflags/std"]
23-
2420
[dependencies]
2521
bitflags = { version = "2.4.0", default-features = false }
2622
rustix = { version = "1.0.2", default-features = false, features = ["io_uring", "mm", "thread"] }
2723

2824
[dev-dependencies]
2925
libc = "0.2.98"
3026
anyhow = "1"
27+
rustix = "1.0.2"
3128
socket2 = "0.5"
3229
slab = "0.4"

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! The crate only provides a summary of the parameters.
44
//! For more detailed documentation, see manpage.
5-
#![cfg_attr(not(feature = "std"), no_std)]
5+
#![no_std]
66

77
#[macro_use]
88
mod util;

src/register.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ pub const SKIP_FILE: BorrowedFd<'static> = rustix::io_uring::IORING_REGISTER_FIL
144144

145145
#[test]
146146
fn test_probe_layout() {
147-
use std::alloc::Layout;
147+
use core::alloc::Layout;
148148

149149
let probe = Probe::new();
150150
assert_eq!(

src/squeue.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
//! Submission Queue
22
3+
use core::error::Error;
34
use core::fmt::{self, Debug, Display, Formatter};
45
use core::mem;
56
use core::sync::atomic;
6-
#[cfg(feature = "std")]
7-
use std::error::Error;
87

98
use crate::sys;
109
use crate::util::{private, unsync_load, Mmap};
@@ -452,7 +451,6 @@ impl Display for PushError {
452451
}
453452
}
454453

455-
#[cfg(feature = "std")]
456454
impl Error for PushError {}
457455

458456
impl<E: EntryMarker> Debug for SubmissionQueue<'_, E> {

src/types.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,8 @@ impl Timespec {
194194
}
195195
}
196196

197-
#[cfg(feature = "std")]
198-
impl From<std::time::Duration> for Timespec {
199-
fn from(value: std::time::Duration) -> Self {
197+
impl From<core::time::Duration> for Timespec {
198+
fn from(value: core::time::Duration) -> Self {
200199
Timespec::new()
201200
.sec(value.as_secs())
202201
.nsec(value.subsec_nanos())
@@ -680,7 +679,7 @@ impl FutexWaitV {
680679

681680
#[cfg(test)]
682681
mod tests {
683-
use std::time::Duration;
682+
use core::time::Duration;
684683

685684
use crate::types::sealed::Target;
686685

0 commit comments

Comments
 (0)