Skip to content

Commit 32e08c2

Browse files
committed
syntax: Don't use unstable fn to convert single element to a slice
1 parent 90566d6 commit 32e08c2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libsyntax/util/small_vector.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ impl<T> SmallVector<T> {
6464
let result: &[T] = &[];
6565
result
6666
}
67-
One(ref v) => slice::ref_slice(v),
67+
One(ref v) => {
68+
// FIXME: Could be replaced with `slice::ref_slice(v)` when it is stable.
69+
unsafe { slice::from_raw_parts(v, 1) }
70+
}
6871
Many(ref vs) => vs
6972
}
7073
}

0 commit comments

Comments
 (0)