소스 검색

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