Skip to content

Commit 03fb484

Browse files
committed
Delete ArrayVecCopy::new_const since it doesn't work on Rust 1.51
``` error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable --> src/arrayvec_copy.rs:59:6 | 59 | impl<T: Copy, const CAP: usize> ArrayVecCopy<T, CAP> { | ^ | = note: see issue #57563 <rust-lang/rust#57563> for more information = help: add `#![feature(const_fn)]` to the crate attributes to enable ```
1 parent 4f348df commit 03fb484

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

src/arrayvec_copy.patch

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/src/arrayvec_copy_generated.rs b/src/arrayvec_copy.rs
2-
index b12aa9e..5597af9 100644
2+
index b12aa9e..8e4c3a9 100644
33
--- a/src/arrayvec_copy_generated.rs
44
+++ b/src/arrayvec_copy.rs
55
@@ -27,6 +27,9 @@ use crate::utils::MakeMaybeUninit;
@@ -27,7 +27,28 @@ index b12aa9e..5597af9 100644
2727
macro_rules! panic_oob {
2828
($method_name:expr, $index:expr, $len:expr) => {
2929
panic!(concat!("ArrayVecCopy::", $method_name, ": index {} is out of bounds in vector of length {}"),
30-
@@ -964,21 +959,6 @@ impl<T: Copy, const CAP: usize> DoubleEndedIterator for IntoIter<T, CAP> {
30+
@@ -87,20 +82,6 @@ impl<T: Copy, const CAP: usize> ArrayVecCopy<T, CAP> {
31+
}
32+
}
33+
34+
- /// Create a new empty `ArrayVecCopy` (const fn).
35+
- ///
36+
- /// The maximum capacity is given by the generic parameter `CAP`.
37+
- ///
38+
- /// ```
39+
- /// use arrayvec::ArrayVecCopy;
40+
- ///
41+
- /// static ARRAY: ArrayVecCopy<u8, 1024> = ArrayVecCopy::new_const();
42+
- /// ```
43+
- pub const fn new_const() -> ArrayVecCopy<T, CAP> {
44+
- assert_capacity_limit_const!(CAP);
45+
- ArrayVecCopy { xs: MakeMaybeUninit::ARRAY, len: 0 }
46+
- }
47+
-
48+
/// Return the number of elements in the `ArrayVecCopy`.
49+
///
50+
/// ```
51+
@@ -964,21 +945,6 @@ impl<T: Copy, const CAP: usize> DoubleEndedIterator for IntoIter<T, CAP> {
3152

3253
impl<T: Copy, const CAP: usize> ExactSizeIterator for IntoIter<T, CAP> { }
3354

src/arrayvec_copy.rs

-14
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,6 @@ impl<T: Copy, const CAP: usize> ArrayVecCopy<T, CAP> {
8282
}
8383
}
8484

85-
/// Create a new empty `ArrayVecCopy` (const fn).
86-
///
87-
/// The maximum capacity is given by the generic parameter `CAP`.
88-
///
89-
/// ```
90-
/// use arrayvec::ArrayVecCopy;
91-
///
92-
/// static ARRAY: ArrayVecCopy<u8, 1024> = ArrayVecCopy::new_const();
93-
/// ```
94-
pub const fn new_const() -> ArrayVecCopy<T, CAP> {
95-
assert_capacity_limit_const!(CAP);
96-
ArrayVecCopy { xs: MakeMaybeUninit::ARRAY, len: 0 }
97-
}
98-
9985
/// Return the number of elements in the `ArrayVecCopy`.
10086
///
10187
/// ```

0 commit comments

Comments
 (0)