Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump MSRV to 1.63 #23

Merged
merged 2 commits into from
Jun 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [nightly, beta, stable]
steps:
- uses: actions/checkout@v3
Expand All @@ -51,7 +51,7 @@ jobs:
os: [ubuntu-latest, windows-latest]
# When updating this, the reminder to update the minimum supported
# Rust version in Cargo.toml.
rust: ['1.48']
rust: ['1.63']
steps:
- uses: actions/checkout@v3
- name: Install Rust
Expand Down
5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name = "async-net"
version = "1.7.0"
authors = ["Stjepan Glavina <[email protected]>"]
edition = "2018"
rust-version = "1.48"
rust-version = "1.63"
description = "Async networking primitives for TCP/UDP/Unix communication"
license = "Apache-2.0 OR MIT"
repository = "https:/smol-rs/async-net"
Expand All @@ -20,6 +20,3 @@ exclude = ["/.*"]
async-io = "1.6.0"
blocking = "1.0.0"
futures-lite = "1.11.0"

[build-dependencies]
autocfg = "1"
16 changes: 0 additions & 16 deletions build.rs

This file was deleted.

24 changes: 10 additions & 14 deletions src/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@ use std::convert::TryFrom;
use std::fmt;
use std::io::{self, IoSlice, Read as _, Write as _};
use std::net::{Shutdown, SocketAddr};
#[cfg(all(not(async_net_no_io_safety), unix))]
use std::os::unix::io::{AsFd, BorrowedFd, OwnedFd};
#[cfg(unix)]
use std::os::unix::io::{AsRawFd, RawFd};
use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd, OwnedFd, RawFd};
#[cfg(windows)]
use std::os::windows::io::{AsRawSocket, RawSocket};
#[cfg(all(not(async_net_no_io_safety), windows))]
use std::os::windows::io::{AsSocket, BorrowedSocket, OwnedSocket};
use std::os::windows::io::{AsRawSocket, AsSocket, BorrowedSocket, OwnedSocket, RawSocket};
use std::panic::{RefUnwindSafe, UnwindSafe};
use std::pin::Pin;
use std::sync::Arc;
Expand Down Expand Up @@ -244,14 +240,14 @@ impl AsRawFd for TcpListener {
}
}

#[cfg(all(not(async_net_no_io_safety), unix))]
#[cfg(unix)]
impl AsFd for TcpListener {
fn as_fd(&self) -> BorrowedFd<'_> {
self.inner.get_ref().as_fd()
}
}

#[cfg(all(not(async_net_no_io_safety), unix))]
#[cfg(unix)]
impl TryFrom<OwnedFd> for TcpListener {
type Error = io::Error;

Expand All @@ -267,14 +263,14 @@ impl AsRawSocket for TcpListener {
}
}

#[cfg(all(not(async_net_no_io_safety), windows))]
#[cfg(windows)]
impl AsSocket for TcpListener {
fn as_socket(&self) -> BorrowedSocket<'_> {
self.inner.get_ref().as_socket()
}
}

#[cfg(all(not(async_net_no_io_safety), windows))]
#[cfg(windows)]
impl TryFrom<OwnedSocket> for TcpListener {
type Error = io::Error;

Expand Down Expand Up @@ -610,14 +606,14 @@ impl AsRawFd for TcpStream {
}
}

#[cfg(all(not(async_net_no_io_safety), unix))]
#[cfg(unix)]
impl AsFd for TcpStream {
fn as_fd(&self) -> BorrowedFd<'_> {
self.inner.get_ref().as_fd()
}
}

#[cfg(all(not(async_net_no_io_safety), unix))]
#[cfg(unix)]
impl TryFrom<OwnedFd> for TcpStream {
type Error = io::Error;

Expand All @@ -633,14 +629,14 @@ impl AsRawSocket for TcpStream {
}
}

#[cfg(all(not(async_net_no_io_safety), windows))]
#[cfg(windows)]
impl AsSocket for TcpStream {
fn as_socket(&self) -> BorrowedSocket<'_> {
self.inner.get_ref().as_socket()
}
}

#[cfg(all(not(async_net_no_io_safety), windows))]
#[cfg(windows)]
impl TryFrom<OwnedSocket> for TcpStream {
type Error = io::Error;

Expand Down
16 changes: 6 additions & 10 deletions src/udp.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
use std::convert::TryFrom;
use std::io;
use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr};
#[cfg(all(not(async_net_no_io_safety), unix))]
use std::os::unix::io::{AsFd, BorrowedFd, OwnedFd};
#[cfg(unix)]
use std::os::unix::io::{AsRawFd, RawFd};
use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd, OwnedFd, RawFd};
#[cfg(windows)]
use std::os::windows::io::{AsRawSocket, RawSocket};
#[cfg(all(not(async_net_no_io_safety), windows))]
use std::os::windows::io::{AsSocket, BorrowedSocket, OwnedSocket};
use std::os::windows::io::{AsRawSocket, AsSocket, BorrowedSocket, OwnedSocket, RawSocket};
use std::sync::Arc;

use async_io::Async;
Expand Down Expand Up @@ -627,14 +623,14 @@ impl AsRawFd for UdpSocket {
}
}

#[cfg(all(not(async_net_no_io_safety), unix))]
#[cfg(unix)]
impl AsFd for UdpSocket {
fn as_fd(&self) -> BorrowedFd<'_> {
self.inner.get_ref().as_fd()
}
}

#[cfg(all(not(async_net_no_io_safety), unix))]
#[cfg(unix)]
impl TryFrom<OwnedFd> for UdpSocket {
type Error = io::Error;

Expand All @@ -650,14 +646,14 @@ impl AsRawSocket for UdpSocket {
}
}

#[cfg(all(not(async_net_no_io_safety), windows))]
#[cfg(windows)]
impl AsSocket for UdpSocket {
fn as_socket(&self) -> BorrowedSocket<'_> {
self.inner.get_ref().as_socket()
}
}

#[cfg(all(not(async_net_no_io_safety), windows))]
#[cfg(windows)]
impl TryFrom<OwnedSocket> for UdpSocket {
type Error = io::Error;

Expand Down
12 changes: 5 additions & 7 deletions src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ use std::convert::TryFrom;
use std::fmt;
use std::io::{self, Read as _, Write as _};
use std::net::Shutdown;
#[cfg(not(async_net_no_io_safety))]
use std::os::unix::io::{AsFd, BorrowedFd, OwnedFd};
#[cfg(unix)]
use std::os::unix::io::{AsRawFd, RawFd};
use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd, OwnedFd, RawFd};
#[cfg(windows)]
use std::os::windows::io::{AsRawSocket, RawSocket};
use std::panic::{RefUnwindSafe, UnwindSafe};
Expand Down Expand Up @@ -174,14 +172,14 @@ impl AsRawFd for UnixListener {
}
}

#[cfg(all(not(async_net_no_io_safety), unix))]
#[cfg(unix)]
impl AsFd for UnixListener {
fn as_fd(&self) -> BorrowedFd<'_> {
self.inner.get_ref().as_fd()
}
}

#[cfg(all(not(async_net_no_io_safety), unix))]
#[cfg(unix)]
impl TryFrom<OwnedFd> for UnixListener {
type Error = io::Error;

Expand Down Expand Up @@ -389,14 +387,14 @@ impl AsRawFd for UnixStream {
}
}

#[cfg(all(not(async_net_no_io_safety), unix))]
#[cfg(unix)]
impl AsFd for UnixStream {
fn as_fd(&self) -> BorrowedFd<'_> {
self.inner.get_ref().as_fd()
}
}

#[cfg(all(not(async_net_no_io_safety), unix))]
#[cfg(unix)]
impl TryFrom<OwnedFd> for UnixStream {
type Error = io::Error;

Expand Down