diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 615d080..4ff6c27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: include: # Test MSRV - - rust: 1.60.0 + - rust: 1.77.0 TARGET: x86_64-unknown-linux-gnu # Test nightly but don't fail @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - rust: [nightly-2023-11-01] + rust: [stable] TARGET: [x86_64-unknown-linux-gnu, thumbv6m-none-eabi, thumbv7m-none-eabi] diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml index 3a4e37d..e9e07a1 100644 --- a/.github/workflows/rustfmt.yml +++ b/.github/workflows/rustfmt.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2023-11-01 + toolchain: stable components: rustfmt - run: cargo fmt --all -- --check working-directory: embedded-nal-async diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c558bb..31b3760 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -No unreleased changes yet +- Bump MSRV to 1.77.0 for `ip_in_core`. +- Removed the `no-std-net` and `ip_in_core` features, `ip_in_core` is now the default. ## [0.8.0] - 2023-11-10 diff --git a/Cargo.toml b/Cargo.toml index f49c60c..982fb76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,10 +17,5 @@ readme = "README.md" keywords = ["network"] categories = ["embedded", "hardware-support", "no-std", "network-programming"] -[features] -default = ["no-std-net"] -ip_in_core = [] - [dependencies] nb = "1" -no-std-net = { version = "0.6", optional = true } \ No newline at end of file diff --git a/README.md b/README.md index 24b2df2..0e9630c 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ These issues / PRs will be labeled as `proposal`s in the issue tracker. ## Minimum Supported Rust Version (MSRV) -This crate is guaranteed to compile on stable Rust 1.60.0 and up. It _might_ +This crate is guaranteed to compile on stable Rust 1.77.0 and up. It _might_ compile with older versions but that may change in any new patch release. ## License diff --git a/embedded-nal-async/CHANGELOG.md b/embedded-nal-async/CHANGELOG.md index 7cc0b9a..99d1a99 100644 --- a/embedded-nal-async/CHANGELOG.md +++ b/embedded-nal-async/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] -No unreleased changes yet. +- Removed the `ip_in_core` feature, this is now the default. ## [0.7.1] - 2023-11-28 diff --git a/embedded-nal-async/Cargo.toml b/embedded-nal-async/Cargo.toml index b39be77..83a07d1 100644 --- a/embedded-nal-async/Cargo.toml +++ b/embedded-nal-async/Cargo.toml @@ -11,10 +11,6 @@ readme = "README.md" keywords = ["network"] categories = ["embedded", "hardware-support", "no-std", "network-programming", "asynchronous"] -[features] -ip_in_core = [] - [dependencies] -no-std-net = "0.6" embedded-nal = { version = "0.8.0", path = "../" } embedded-io-async = { version = "0.6.0" } diff --git a/embedded-nal-async/build.rs b/embedded-nal-async/build.rs deleted file mode 100644 index d58f744..0000000 --- a/embedded-nal-async/build.rs +++ /dev/null @@ -1,18 +0,0 @@ -use std::env; -use std::ffi::OsString; -use std::process::Command; - -fn main() { - println!("cargo:rerun-if-changed=build.rs"); - - let rustc = env::var_os("RUSTC").unwrap_or_else(|| OsString::from("rustc")); - - let output = Command::new(rustc) - .arg("--version") - .output() - .expect("failed to run `rustc --version`"); - - if String::from_utf8_lossy(&output.stdout).contains("nightly") { - println!("cargo:rustc-cfg=nightly"); - } -} diff --git a/embedded-nal-async/src/dns.rs b/embedded-nal-async/src/dns.rs index bbfdf2f..6ff5327 100644 --- a/embedded-nal-async/src/dns.rs +++ b/embedded-nal-async/src/dns.rs @@ -1,4 +1,4 @@ -use crate::IpAddr; +use core::net::IpAddr; use embedded_nal::AddrType; /// This trait is an extension trait for [`TcpStack`] and [`UdpStack`] for dns diff --git a/embedded-nal-async/src/lib.rs b/embedded-nal-async/src/lib.rs index 17f3533..2a8e390 100644 --- a/embedded-nal-async/src/lib.rs +++ b/embedded-nal-async/src/lib.rs @@ -1,21 +1,13 @@ //! # embedded-nal-async - An async Network Abstraction Layer for Embedded Systems #![no_std] -#![cfg_attr(nightly, allow(stable_features, unknown_lints))] -#![cfg_attr(nightly, feature(async_fn_in_trait, impl_trait_projections))] #![allow(async_fn_in_trait)] #![deny(missing_docs)] #![deny(unsafe_code)] -#![cfg_attr(feature = "ip_in_core", feature(ip_in_core))] mod dns; mod stack; -#[cfg(feature = "ip_in_core")] -pub use core::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}; -#[cfg(not(feature = "ip_in_core"))] -pub use no_std_net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}; - pub use dns::Dns; pub use embedded_nal::AddrType; pub use stack::TcpConnect; diff --git a/embedded-nal-async/src/stack/tcp.rs b/embedded-nal-async/src/stack/tcp.rs index 6aa66ee..3549c43 100644 --- a/embedded-nal-async/src/stack/tcp.rs +++ b/embedded-nal-async/src/stack/tcp.rs @@ -1,4 +1,4 @@ -use crate::SocketAddr; +use core::net::SocketAddr; /// This trait is implemented by TCP/IP stacks. The trait allows the underlying driver to /// construct multiple connections that implement the I/O traits from embedded-io-async. diff --git a/embedded-nal-async/src/stack/udp.rs b/embedded-nal-async/src/stack/udp.rs index 49981ce..d425846 100644 --- a/embedded-nal-async/src/stack/udp.rs +++ b/embedded-nal-async/src/stack/udp.rs @@ -14,7 +14,7 @@ //! Implementing `UniquelyBound` and `MultiplyBound` with the same type is expected to be a //! common choice. -use crate::SocketAddr; +use core::net::SocketAddr; /// This trait is implemented by UDP sockets. /// @@ -140,7 +140,7 @@ pub trait UdpStack { &self, remote: SocketAddr, ) -> Result<(SocketAddr, Self::Connected), Self::Error> { - use crate::{Ipv4Addr, Ipv6Addr, SocketAddr::*, SocketAddrV4, SocketAddrV6}; + use core::net::{Ipv4Addr, Ipv6Addr, SocketAddr::*, SocketAddrV4, SocketAddrV6}; let local = match remote { V4(_) => V4(SocketAddrV4::new(Ipv4Addr::UNSPECIFIED, 0)), diff --git a/src/dns.rs b/src/dns.rs index be4c04e..7470421 100644 --- a/src/dns.rs +++ b/src/dns.rs @@ -1,4 +1,4 @@ -use crate::IpAddr; +use core::net::IpAddr; /// This is the host address type to be returned by `gethostbyname`. /// diff --git a/src/lib.rs b/src/lib.rs index 2114588..5cf4aa8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,21 +2,12 @@ #![no_std] #![deny(missing_docs)] #![deny(unsafe_code)] -#![cfg_attr(feature = "ip_in_core", feature(ip_in_core))] mod dns; mod stack; pub use nb; -#[cfg(not(any(feature = "ip_in_core", feature = "no-std-net")))] -compile_error!("You must select the ip_in_core feature or the no-std-net feature"); - -#[cfg(feature = "ip_in_core")] -pub use core::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}; -#[cfg(not(feature = "ip_in_core"))] -pub use no_std_net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}; - pub use dns::{AddrType, Dns}; pub use stack::{ SharableStack, SharedStack, TcpClientStack, TcpError, TcpErrorKind, TcpFullStack, diff --git a/src/stack/share.rs b/src/stack/share.rs index d16ffd8..c8caec8 100644 --- a/src/stack/share.rs +++ b/src/stack/share.rs @@ -1,5 +1,6 @@ -use crate::{nb, SocketAddr, TcpClientStack, TcpFullStack, UdpClientStack, UdpFullStack}; +use crate::{nb, TcpClientStack, TcpFullStack, UdpClientStack, UdpFullStack}; use core::cell::RefCell; +use core::net::SocketAddr; /// Sharable wrapper for a network stack implementation. /// @@ -12,7 +13,8 @@ use core::cell::RefCell; /// /// ``` /// use embedded_nal::SharableStack; -/// # use embedded_nal::{UdpClientStack, SocketAddr, SocketAddrV4, Ipv4Addr, nb}; +/// use core::net::{SocketAddr, SocketAddrV4, Ipv4Addr}; +/// # use embedded_nal::{UdpClientStack, nb}; /// # struct SomeNalDriver {} /// # impl SomeNalDriver { /// # fn new() -> Self { Self {} } diff --git a/src/stack/tcp.rs b/src/stack/tcp.rs index beaf494..d28f76f 100644 --- a/src/stack/tcp.rs +++ b/src/stack/tcp.rs @@ -1,4 +1,4 @@ -use crate::SocketAddr; +use core::net::SocketAddr; /// Represents specific errors encountered during TCP operations. #[non_exhaustive] diff --git a/src/stack/udp.rs b/src/stack/udp.rs index 32f7b3e..c45e6fb 100644 --- a/src/stack/udp.rs +++ b/src/stack/udp.rs @@ -1,4 +1,4 @@ -use crate::SocketAddr; +use core::net::SocketAddr; /// This trait is implemented by UDP/IP stacks. You could, for example, have /// an implementation which knows how to send AT commands to an ESP8266 WiFi