From bc6d990adbad6109cf096acc04cc5ab7dfd5b5ff Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Thu, 16 Apr 2015 19:56:37 -0700 Subject: [PATCH] syntax: Don't use unstable fn to convert single element to a slice --- src/libsyntax/util/small_vector.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libsyntax/util/small_vector.rs b/src/libsyntax/util/small_vector.rs index 6b864d5294766..153f9d4a26df1 100644 --- a/src/libsyntax/util/small_vector.rs +++ b/src/libsyntax/util/small_vector.rs @@ -64,7 +64,10 @@ impl SmallVector { let result: &[T] = &[]; result } - One(ref v) => slice::ref_slice(v), + One(ref v) => { + // FIXME: Could be replaced with `slice::ref_slice(v)` when it is stable. + unsafe { slice::from_raw_parts(v, 1) } + } Many(ref vs) => vs } }