Переглянути джерело

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};