From 2b7a25b1e24848a2ae5bbd493f2d7fceade0be88 Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 10 Aug 2018 14:53:28 +0000 Subject: [PATCH] Add an ARTIQ-specific cargo feature "rust-1.28". This cargo feature only exists because (a) ARTIQ uses a fork of Rust, (b) Rust has some ridiculous renaming going on in the alloc crate, (c) smoltcp exists because of ARTIQ. Such features will not be ordinarily provided by smoltcp. --- Cargo.toml | 3 +++ src/phy/loopback.rs | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 3d6e4c6..4d35282 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,6 +48,9 @@ default = [ "socket-raw", "socket-icmp", "socket-udp", "socket-tcp" ] +# experimental; do not use; no guarantees provided that this feature will be kept +"rust-1.28" = [] + [[example]] name = "packet2pcap" path = "utils/packet2pcap.rs" diff --git a/src/phy/loopback.rs b/src/phy/loopback.rs index 58758ff..58df47a 100644 --- a/src/phy/loopback.rs +++ b/src/phy/loopback.rs @@ -4,8 +4,10 @@ use std::vec::Vec; use std::collections::VecDeque; #[cfg(feature = "alloc")] use alloc::vec::Vec; -#[cfg(feature = "alloc")] +#[cfg(all(feature = "alloc", not(feature = "rust-1.28")))] use alloc::collections::VecDeque; +#[cfg(all(feature = "alloc", feature = "rust-1.28"))] +use alloc::VecDeque; use Result; use phy::{self, Device, DeviceCapabilities};