Skip to content

Commit

Permalink
Bump MSRV to 1.63
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jun 11, 2023
1 parent 0185ddf commit 75fcca4
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stjepang@gmail.com>"]
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://github.com/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

0 comments on commit 75fcca4

Please sign in to comment.