浏览代码

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.
whitequark 6 年之前
父节点
当前提交
2139686711
共有 2 个文件被更改,包括 6 次插入1 次删除
  1. 3 0
      Cargo.toml
  2. 3 1
      src/phy/loopback.rs

+ 3 - 0
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"

+ 3 - 1
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};