Skip to content

Commit 85f48d3

Browse files
committed
Make FixedSizeArray an unsafe trait
1 parent 72a10fa commit 85f48d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/array.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ use slice::{Iter, IterMut, SliceExt};
3535
///
3636
/// This trait can be used to implement other traits on fixed-size arrays
3737
/// without causing much metadata bloat.
38-
pub trait FixedSizeArray<T> {
38+
pub unsafe trait FixedSizeArray<T> {
3939
/// Converts the array to immutable slice
4040
fn as_slice(&self) -> &[T];
4141
/// Converts the array to mutable slice
4242
fn as_mut_slice(&mut self) -> &mut [T];
4343
}
4444

45-
impl<T, A: Unsize<[T]>> FixedSizeArray<T> for A {
45+
unsafe impl<T, A: Unsize<[T]>> FixedSizeArray<T> for A {
4646
#[inline]
4747
fn as_slice(&self) -> &[T] {
4848
self

0 commit comments

Comments
 (0)