Skip to content

Commit c70364b

Browse files
committed
Remove more features
1 parent 2964a84 commit c70364b

File tree

2 files changed

+5
-27
lines changed

2 files changed

+5
-27
lines changed

src/lib.rs

-21
Original file line numberDiff line numberDiff line change
@@ -1933,34 +1933,13 @@ impl<'a> Drop for SetLenOnDrop<'a> {
19331933
}
19341934
}
19351935

1936-
#[cfg(feature = "const_generics")]
19371936
unsafe impl<T, const N: usize> Array for [T; N] {
19381937
type Item = T;
19391938
fn size() -> usize {
19401939
N
19411940
}
19421941
}
19431942

1944-
#[cfg(not(feature = "const_generics"))]
1945-
macro_rules! impl_array(
1946-
($($size:expr),+) => {
1947-
$(
1948-
unsafe impl<T> Array for [T; $size] {
1949-
type Item = T;
1950-
fn size() -> usize { $size }
1951-
}
1952-
)+
1953-
}
1954-
);
1955-
1956-
#[cfg(not(feature = "const_generics"))]
1957-
impl_array!(
1958-
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1959-
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 36, 0x40, 0x60, 0x80,
1960-
0x100, 0x200, 0x400, 0x600, 0x800, 0x1000, 0x2000, 0x4000, 0x6000, 0x8000, 0x10000, 0x20000,
1961-
0x40000, 0x60000, 0x80000, 0x10_0000
1962-
);
1963-
19641943
/// Convenience trait for constructing a `SmallVec`
19651944
pub trait ToSmallVec<A: Array> {
19661945
/// Construct a new `SmallVec` from a slice.

src/tests.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,11 @@ fn test_from() {
609609
let small_vec: SmallVec<[u8; 128]> = SmallVec::from(array);
610610
assert_eq!(&*small_vec, vec![99u8; 128].as_slice());
611611
drop(small_vec);
612+
613+
let array = [99; 987];
614+
let small_vec: SmallVec<[u8; 987]> = SmallVec::from(array);
615+
assert_eq!(&*small_vec, vec![99u8; 987].as_slice());
616+
drop(small_vec);
612617
}
613618

614619
#[test]
@@ -890,12 +895,6 @@ fn grow_spilled_same_size() {
890895
assert_eq!(v[..], [0, 1, 2]);
891896
}
892897

893-
#[cfg(feature = "const_generics")]
894-
#[test]
895-
fn const_generics() {
896-
let _v = SmallVec::<[i32; 987]>::default();
897-
}
898-
899898
#[test]
900899
fn empty_macro() {
901900
let _v: SmallVec<[u8; 1]> = smallvec![];

0 commit comments

Comments
 (0)