Skip to content

Commit 4fb157b

Browse files
committed
Add missing 'static bounds
1 parent c8ef5e1 commit 4fb157b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

‎src/array.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pub(crate) trait NonEmptyArray<const N_MINUS_ONE: usize> {
22
type Item;
3+
#[allow(unused)]
34
const N: usize;
45
}
56

‎src/lib.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ impl<const N: usize, T> MultiVec<N, T> {
181181
}
182182
}
183183

184-
impl<const N: usize, T> Deref for MultiVec<N, T> {
184+
impl<const N: usize, T: 'static> Deref for MultiVec<N, T> {
185185
type Target = MultiVecRef<N, T>;
186186

187187
fn deref(&self) -> &Self::Target {
@@ -195,7 +195,7 @@ impl<const N: usize, T> Deref for MultiVec<N, T> {
195195
}
196196
}
197197

198-
impl<const N: usize, T> DerefMut for MultiVec<N, T> {
198+
impl<const N: usize, T: 'static> DerefMut for MultiVec<N, T> {
199199
fn deref_mut(&mut self) -> &mut Self::Target {
200200
let ptr = Box::into_raw(Box::new(MultiVecRef {
201201
slice: self.inner.as_mut_slice() as *mut _,
@@ -223,7 +223,7 @@ impl<T> IndexMut<usize> for MultiVecRef<0, T> {
223223

224224
macro_rules! impl_index {
225225
($n:expr) => {
226-
impl<T: Debug> Index<usize> for MultiVecRef<$n, T> {
226+
impl<T: 'static + Debug> Index<usize> for MultiVecRef<$n, T> {
227227
type Output = MultiVecRef<{ $n - 1 }, T>;
228228

229229
fn index(&self, index: usize) -> &Self::Output {
@@ -240,7 +240,7 @@ macro_rules! impl_index {
240240
}
241241
}
242242

243-
impl<T: Debug> IndexMut<usize> for MultiVecRef<$n, T> {
243+
impl<T: 'static + Debug> IndexMut<usize> for MultiVecRef<$n, T> {
244244
fn index_mut(&mut self, index: usize) -> &mut Self::Output {
245245
let MultiVecRef {
246246
slice,

0 commit comments

Comments
 (0)